Re: [PATCH v2 1/2] fs: Check f_cred as well as of current's creds in should_remove_suid()

2017-01-31 Thread Jeff Layton
On Fri, 2017-01-27 at 18:49 -0800, Andy Lutomirski wrote: > If an unprivileged program opens a setgid file for write and passes > the fd to a privileged program and the privileged program writes to > it, we currently fail to clear the setgid bit. Fix it by checking > f_cred in addition to

Re: [PATCH v2 1/2] fs: Check f_cred as well as of current's creds in should_remove_suid()

2017-01-31 Thread Jeff Layton
On Fri, 2017-01-27 at 18:49 -0800, Andy Lutomirski wrote: > If an unprivileged program opens a setgid file for write and passes > the fd to a privileged program and the privileged program writes to > it, we currently fail to clear the setgid bit. Fix it by checking > f_cred in addition to

Re: [PATCH v2 1/2] fs: Check f_cred as well as of current's creds in should_remove_suid()

2017-01-30 Thread Michael Kerrisk
[CC += linux-api@] On Sat, Jan 28, 2017 at 3:49 PM, Andy Lutomirski wrote: > If an unprivileged program opens a setgid file for write and passes > the fd to a privileged program and the privileged program writes to > it, we currently fail to clear the setgid bit. Fix it by

Re: [PATCH v2 1/2] fs: Check f_cred as well as of current's creds in should_remove_suid()

2017-01-30 Thread Michael Kerrisk
[CC += linux-api@] On Sat, Jan 28, 2017 at 3:49 PM, Andy Lutomirski wrote: > If an unprivileged program opens a setgid file for write and passes > the fd to a privileged program and the privileged program writes to > it, we currently fail to clear the setgid bit. Fix it by checking > f_cred in

[PATCH v2 1/2] fs: Check f_cred as well as of current's creds in should_remove_suid()

2017-01-27 Thread Andy Lutomirski
If an unprivileged program opens a setgid file for write and passes the fd to a privileged program and the privileged program writes to it, we currently fail to clear the setgid bit. Fix it by checking f_cred in addition to current's creds whenever a struct file is involved. I'm checking both

[PATCH v2 1/2] fs: Check f_cred as well as of current's creds in should_remove_suid()

2017-01-27 Thread Andy Lutomirski
If an unprivileged program opens a setgid file for write and passes the fd to a privileged program and the privileged program writes to it, we currently fail to clear the setgid bit. Fix it by checking f_cred in addition to current's creds whenever a struct file is involved. I'm checking both