process_keys.c (41f9d29f09ca0b22c3631e8a39676e74cda9bcc0) | process_keys.c (67d1214551e800f9fe7dc7c47a346d2df0fafed5) |
---|---|
1/* Manage a process's keyrings 2 * 3 * Copyright (C) 2004-2005, 2008 Red Hat, Inc. All Rights Reserved. 4 * Written by David Howells (dhowells@redhat.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 820 unchanged lines hidden (view full) --- 829 abort_creds(new); 830 return ret; 831} 832 833/* 834 * Replace a process's session keyring on behalf of one of its children when 835 * the target process is about to resume userspace execution. 836 */ | 1/* Manage a process's keyrings 2 * 3 * Copyright (C) 2004-2005, 2008 Red Hat, Inc. All Rights Reserved. 4 * Written by David Howells (dhowells@redhat.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 820 unchanged lines hidden (view full) --- 829 abort_creds(new); 830 return ret; 831} 832 833/* 834 * Replace a process's session keyring on behalf of one of its children when 835 * the target process is about to resume userspace execution. 836 */ |
837void key_change_session_keyring(struct task_work *twork) | 837void key_change_session_keyring(struct callback_head *twork) |
838{ 839 const struct cred *old = current_cred(); | 838{ 839 const struct cred *old = current_cred(); |
840 struct kludge *p = container_of(twork, struct kludge, twork); 841 struct cred *new = p->cred; | 840 struct cred *new = container_of(twork, struct cred, rcu); |
842 | 841 |
843 kfree(p); | |
844 if (unlikely(current->flags & PF_EXITING)) { 845 put_cred(new); 846 return; 847 } 848 849 new-> uid = old-> uid; 850 new-> euid = old-> euid; 851 new-> suid = old-> suid; --- 24 unchanged lines hidden --- | 842 if (unlikely(current->flags & PF_EXITING)) { 843 put_cred(new); 844 return; 845 } 846 847 new-> uid = old-> uid; 848 new-> euid = old-> euid; 849 new-> suid = old-> suid; --- 24 unchanged lines hidden --- |