From: Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>
To: Michael Tirado <mtirado418@gmail.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
linux-api@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Jann Horn <jannh@google.com>,
Serge Hallyn <serge.hallyn@ubuntu.com>,
Prakash Sangappa <prakash.sangappa@oracle.com>,
Oleg Nesterov <oleg@redhat.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Andrew Morton <akpm@linux-foundation.org>,
Andy Lutomirski <luto@amacapital.net>,
"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Subject: Re: [PATCH v6] pidns: introduce syscall translate_pid
Date: Mon, 23 Jul 2018 14:13:37 -0700 [thread overview]
Message-ID: <c877358b-b7eb-c019-691e-fec489329f88@oracle.com> (raw)
In-Reply-To: <CAMkWEXPTb2NJH5rv8WpKWQaZVOJZp91z5Rr-e19UjrwBxB2pNw@mail.gmail.com>
On 07/23/2018 01:55 PM, Michael Tirado wrote:
> Hey, I'm not seeing much activity on this so here's my $0.02
>
>> Unix socket automatically translates pid attached to SCM_CREDENTIALS.
>> This requires CAP_SYS_ADMIN for sending arbitrary pids and entering
>> into pid namespace, this expose process and could be insecure.
>
> Perhaps it would be a good idea to add a sysctl switch that prevents
> credential spoofing over AF_UNIX \by default\ if that is the main
> concern, or is there another concern and I have read this wrong? I'm
> having trouble thinking of a legitimate use of SCM_CREDENTIALS
> spoofing that isn't in a debugging or troubleshooting context and
> would be more comfortable if it were not possible at all... Anyone
> know of a program that relies on this spoofing functionality?
>
> If you look at socket(7) under SO_PEERCRED there is a way to get
> credentials at time of connect() for an AF_UNIX SOCK_STREAM, or at
> time of socketpair() for a SOCK_DGRAM. I would like to think these
> credentials are reliable, but will probably require some extra daemon
> to proxy a dgram syslog socket.
Thanks for the comments Michael! The usecase we are considering involves
non root monitor process be able to translate the process ID of other
non-root processes under same user within nested PID namespaces. With
SCM_CREDENTIALS method, we require open sockets and connections between
the processes which require PID translation and also CAP_SYS_ADMIN which
is higher than required privilege level for non-root monitor process.
The current patch solves this problem by enabling to open the related
procfs fd when required during PID translation. I believe almost
everyone agreed on this V6 patch but not sure why it is in limbo still.
Thanks,
Nagarathnam.
next prev parent reply other threads:[~2018-07-23 21:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 19:18 Konstantin Khlebnikov
2018-06-12 17:08 ` Nagarathnam Muthusamy
2018-06-20 16:53 ` Nagarathnam Muthusamy
2018-07-03 14:33 ` Nagarathnam Muthusamy
2018-07-16 17:57 ` Nagarathnam Muthusamy
2018-07-23 20:55 ` Michael Tirado
2018-07-23 21:13 ` Nagarathnam Muthusamy [this message]
2018-11-09 3:49 ` Dmitry V. Levin
2019-03-08 18:55 ` Nagarathnam Muthusamy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c877358b-b7eb-c019-691e-fec489329f88@oracle.com \
--to=nagarathnam.muthusamy@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=jannh@google.com \
--cc=khlebnikov@yandex-team.ru \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtirado418@gmail.com \
--cc=mtk.manpages@gmail.com \
--cc=oleg@redhat.com \
--cc=prakash.sangappa@oracle.com \
--cc=serge.hallyn@ubuntu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®