Check-in [6546477ed5]
Overview
SHA1:6546477ed59c71f6a0f47e3b10f25f373a7c92ea
Date: 2016-01-20 15:26:56
User: rkeene
Comment:Updated to print UID of user invoking keyctl()
Timelines: family | ancestors | descendants | both | trunk | 1
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-01-20
15:48
[a0ad8fcf5e] Leaf: Updated with better search for sys_call_table address in files (user: rkeene, tags: trunk)
15:26
[6546477ed5] Updated to print UID of user invoking keyctl() (user: rkeene, tags: trunk, 1)
15:26
[3c8ede0b8b] Added extra clean operations (user: rkeene, tags: trunk)
Changes

Modified nokeyctl.c from [4f334e08a5] to [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);