Kernel/linux

    [Linux] prepare_kernel_cred & commit_creds

    prepare_kernel_cred 와 commit_creds 함수는 보통 kernel exploit을 작성할 때 root 권한을 얻어오는 작업을 수행할 때 사용하는 함수이다. 이 함수들의 소스코드에 대한 분석을 진행해보았다. prepare_kernel_cred ... static struct kmem_cache *cred_jar; ... /* * initialise the credentials stuff */ void __init cred_init(void) { /* allocate a slab in which we can store credentials */ cred_jar = kmem_cache_create("cred_jar", sizeof(struct cred), 0, SLAB_HWCACHE_AL..