Diff

Differences From Artifact [4f334e08a5]:

To Artifact [c5e833d508]:


26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47



48
49
50
51
52
53
54

#include <linux/init.h>

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/syscalls.h>
#include <linux/sched.h>


MODULE_LICENSE("GPL");
MODULE_AUTHOR("Alessandro Ghedini and Mike Perry");
MODULE_DESCRIPTION("disable the keyctl() system call");

/* ia32 entry */
#define __NR_compat_keyctl 311

static asmlinkage long (*o_ptr)(int cmd, ...);
#if defined(__enable_32bits_support)
static asmlinkage long (*o_ptr32)(int cmd, ...);
#endif

asmlinkage long nokeyctl(int cmd, ...) {
	printk("[nokeyctl] keyctl() invoked by process %i\n", current->pid);




	return(-EPERM);
}

static void sys_call_table_make_rw(void **addr);
static void sys_call_table_make_ro(void **addr);








>














|
>
>
>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

#include <linux/init.h>

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/syscalls.h>
#include <linux/sched.h>
#include <linux/cred.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Alessandro Ghedini and Mike Perry");
MODULE_DESCRIPTION("disable the keyctl() system call");

/* ia32 entry */
#define __NR_compat_keyctl 311

static asmlinkage long (*o_ptr)(int cmd, ...);
#if defined(__enable_32bits_support)
static asmlinkage long (*o_ptr32)(int cmd, ...);
#endif

asmlinkage long nokeyctl(int cmd, ...) {
	printk("[nokeyctl] keyctl() invoked by process %llu, user id = %llu\n", \
		(unsigned long long) current->pid, \
		(unsigned long long) (get_current_user()->uid.val)
	);

	return(-EPERM);
}

static void sys_call_table_make_rw(void **addr);
static void sys_call_table_make_ro(void **addr);