Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1722929
| From | ebiederm@xmission.com (Eric W. Biederman) |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN |
| Date | 2017-08-30 02:20 +0200 |
| Message-ID | <ujYTE-17H-7@gated-at.bofh.it> (permalink) |
| References | <ujCq6-3Ti-9@gated-at.bofh.it> <ujXNU-u3-13@gated-at.bofh.it> <ujYJZ-14v-47@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
"prakash.sangappa" <prakash.sangappa@oracle.com> writes: > On 08/29/2017 04:02 PM, David Miller wrote: >> From: Prakash Sangappa <prakash.sangappa@oracle.com> >> Date: Mon, 28 Aug 2017 17:12:20 -0700 >> >>> Currently passing tid(gettid(2)) of a thread in struct ucred in >>> SCM_CREDENTIALS message requires CAP_SYS_ADMIN capability otherwise >>> it fails with EPERM error. Some applications deal with thread id >>> of a thread(tid) and so it would help to allow tid in SCM_CREDENTIALS >>> message. Basically, either tgid(pid of the process) or the tid of >>> the thread should be allowed without the need for CAP_SYS_ADMIN capability. >>> >>> SCM_CREDENTIALS will be used to determine the global id of a process or >>> a thread running inside a pid namespace. >>> >>> This patch adds necessary check to accept tid in SCM_CREDENTIALS >>> struct ucred. >>> >>> Signed-off-by: Prakash Sangappa <prakash.sangappa@oracle.com> >> I'm pretty sure that by the descriptions in previous changes to this >> function, what you are proposing is basically a minor form of PID >> spoofing which we only want someone with CAP_SYS_ADMIN over the >> PID namespace to be able to do. > > The fix is to allow passing tid of the calling thread itself not of any > other thread or process. Curious why would this be considered > as pid spoofing? > > This change would enable a thread in a multi threaded process, running > inside a pid namespace to be identified by the recipient of the > message easily. I think a more practical problem is that change, changes what is being passed in the SCM_CREDENTIALS from a pid of a process to a tid of a thread. That could be confusing and that confusion could be exploited. It is definitely confusing because in some instances a value can be both a tgid and a tid. I definitely think this needs to be talked about in terms of changing what is passed in that field and what the consequences could be. I suspect you are ok. As nothing allows passing a tid today. But I don't see any analysis on why passing a tid instead of a tgid will not confuse the receiving application, and in such confusion introduce a security hole. Eric
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN Prakash Sangappa <prakash.sangappa@oracle.com> - 2017-08-29 02:20 +0200
Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN David Miller <davem@davemloft.net> - 2017-08-30 01:10 +0200
Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN "prakash.sangappa" <prakash.sangappa@oracle.com> - 2017-08-30 02:10 +0200
Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN ebiederm@xmission.com (Eric W. Biederman) - 2017-08-30 02:20 +0200
Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN ebiederm@xmission.com (Eric W. Biederman) - 2017-08-30 19:50 +0200
Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN Prakash Sangappa <prakash.sangappa@oracle.com> - 2017-09-01 19:40 +0200
Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN ebiederm@xmission.com (Eric W. Biederman) - 2017-09-01 21:30 +0200
csiph-web