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     26   
    27     27   #include <linux/init.h>
    28     28   
    29     29   #include <linux/module.h>
    30     30   #include <linux/kernel.h>
    31     31   #include <linux/syscalls.h>
    32     32   #include <linux/sched.h>
           33  +#include <linux/cred.h>
    33     34   
    34     35   MODULE_LICENSE("GPL");
    35     36   MODULE_AUTHOR("Alessandro Ghedini and Mike Perry");
    36     37   MODULE_DESCRIPTION("disable the keyctl() system call");
    37     38   
    38     39   /* ia32 entry */
    39     40   #define __NR_compat_keyctl 311
................................................................................
    40     41   
    41     42   static asmlinkage long (*o_ptr)(int cmd, ...);
    42     43   #if defined(__enable_32bits_support)
    43     44   static asmlinkage long (*o_ptr32)(int cmd, ...);
    44     45   #endif
    45     46   
    46     47   asmlinkage long nokeyctl(int cmd, ...) {
    47         -	printk("[nokeyctl] keyctl() invoked by process %i\n", current->pid);
           48  +	printk("[nokeyctl] keyctl() invoked by process %llu, user id = %llu\n", \
           49  +		(unsigned long long) current->pid, \
           50  +		(unsigned long long) (get_current_user()->uid.val)
           51  +	);
    48     52   
    49     53   	return(-EPERM);
    50     54   }
    51     55   
    52     56   static void sys_call_table_make_rw(void **addr);
    53     57   static void sys_call_table_make_ro(void **addr);
    54     58