From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Casey Schaufler <casey@schaufler-ca.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
mptcp@lists.linux.dev, Paul Moore <paul@paul-moore.com>,
Ondrej Mosnacek <omosnace@redhat.com>,
SElinux list <selinux@vger.kernel.org>,
Linux Security Module list
<linux-security-module@vger.kernel.org>
Subject: Re: [PATCH mptcp-net] mptcp: fix LSM labeling for passive msk
Date: Thu, 8 Dec 2022 16:07:16 -0800 (PST) [thread overview]
Message-ID: <f84f2394-ae01-d55f-a990-9adca8f314a0@linux.intel.com> (raw)
In-Reply-To: <fc052c3c-7545-4d84-05d8-adb5659348a1@schaufler-ca.com>
On Thu, 8 Dec 2022, Casey Schaufler wrote:
> On 12/7/2022 6:19 PM, Mat Martineau wrote:
>> On Wed, 7 Dec 2022, Paolo Abeni wrote:
>>
>>> MPTCP sockets created via accept() inherit their LSM label
>>> from the initial request socket, which in turn get it from the
>>> listener socket's first subflow. The latter is a kernel socket,
>>> and get the relevant labeling at creation time.
>>>
>>> Due to all the above even the accepted MPTCP socket get a kernel
>>> label, causing unexpected behaviour and failure on later LSM tests.
>>>
>>> Address the issue factoring out a socket creation helper that does
>>> not include the post-creation LSM checks. Use such helper to create
>>> mptcp subflow as in-kernel sockets and doing explicitly LSM validation:
>>> vs the current user for the first subflow, as a kernel socket otherwise.
>>>
>>> Fixes: 0c14846032f2 ("mptcp: fix security context on server socket")
>>> Reported-by: Ondrej Mosnacek <omosnace@redhat.com>
>>> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
>>
>> The MPTCP content looks good to me:
>>
>> Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
>>
>>
>> I didn't see issues with the socket.c changes but I'd like to get some
>> security community feedback before upstreaming - Paul or other
>> security reviewers, what do you think?
>
> I haven't had the opportunity to work out what impact, if any, this will
> have on Smack. I haven't seen a reproducer for the problem, is one available?
> Sorry to chime in late.
>
Hi Casey -
There's more context in the original thread started by Ondrej, including
reproducer information:
https://lore.kernel.org/all/CAFqZXNs2LF-OoQBUiiSEyranJUXkPLcCfBkMkwFeM6qEwMKCTw@mail.gmail.com/
For impact on Smack, also check Paul's recent reply to this specific patch
(proposing a new LSM hook):
https://lore.kernel.org/all/CAHC9VhQzJAhNtpMnU7STEfq6QpaJo-xiie8HoHH2w3io3aXBHw@mail.gmail.com/
--
Mat Martineau
Intel
next prev parent reply other threads:[~2022-12-09 0:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 17:51 [PATCH mptcp-net] mptcp: fix LSM labeling for passive msk Paolo Abeni
2022-12-08 2:19 ` Mat Martineau
2022-12-08 15:33 ` Casey Schaufler
2022-12-09 0:07 ` Mat Martineau [this message]
2022-12-08 23:40 ` Paul Moore
2022-12-12 15:36 ` Paolo Abeni
2022-12-12 23:28 ` Paul Moore
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=f84f2394-ae01-d55f-a990-9adca8f314a0@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=casey@schaufler-ca.com \
--cc=linux-security-module@vger.kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=omosnace@redhat.com \
--cc=pabeni@redhat.com \
--cc=paul@paul-moore.com \
--cc=selinux@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).