kernel: Add the ability to manually elevate privileges for programs using prctl by specifying UID or PID.
This commit is contained in:
22
kernel/manual_su.h
Normal file
22
kernel/manual_su.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef __KSU_MANUAL_SU_H
|
||||
#define __KSU_MANUAL_SU_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
#define KSU_SU_VERIFIED_BIT (1UL << 0)
|
||||
|
||||
static inline bool ksu_is_current_verified(void)
|
||||
{
|
||||
return ((unsigned long)(current->security) & KSU_SU_VERIFIED_BIT) != 0;
|
||||
}
|
||||
|
||||
static inline void ksu_mark_current_verified(void)
|
||||
{
|
||||
current->security = (void *)((unsigned long)(current->security) | KSU_SU_VERIFIED_BIT);
|
||||
}
|
||||
|
||||
int ksu_manual_su_escalate(uid_t target_uid, pid_t target_pid,
|
||||
const char __user *user_password);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user