From: Paul Moore <paul@paul-moore.com>
To: "Christian Göttsche" <cgoettsche@seltendoof.de>
Cc: "Christian Göttsche" <cgzones@googlemail.com>,
"Stephen Smalley" <stephen.smalley.work@gmail.com>,
"Ondrej Mosnacek" <omosnace@redhat.com>,
"Thiébaud Weksteen" <tweek@google.com>,
"Bram Bonné" <brambonne@google.com>,
"Casey Schaufler" <casey@schaufler-ca.com>,
"Canfeng Guo" <guocanfeng@uniontech.com>,
"GUO Zihua" <guozihua@huawei.com>,
"Chen Zhou" <chenzhou10@huawei.com>,
selinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 5/6] selinux: unify OOM handling in network hashtables
Date: Fri, 11 Apr 2025 16:29:37 -0400 [thread overview]
Message-ID: <4e6ec6918748074d1f081320eba38eda@paul-moore.com> (raw)
In-Reply-To: <20250318083422.21489-4-cgoettsche@seltendoof.de>
On Mar 18, 2025 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgoettsche@seltendoof.de> wrote:
>
> For network objects, like interfaces, nodes, port and InfiniBands, the
> object to SID lookup is cached in hashtables. OOM during such hashtable
> additions of new objects is considered non-fatal and the computed SID is
> simply returned without adding the compute result into the hash table.
>
> Actually ignore OOM in the InfiniBand code, despite the comment already
> suggesting to do so. This reverts commit c350f8bea271 ("selinux: Fix
> error return code in sel_ib_pkey_sid_slow()").
>
> Add comments in the other places.
>
> Use kmalloc() instead of kzalloc(), since all members are initialized on
> success and the data is only used in internbal hash tables, so no risk
> of information leakage to userspace.
>
> Fixes: c350f8bea271 ("selinux: Fix error return code in sel_ib_pkey_sid_slow()")
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
> security/selinux/ibpkey.c | 11 +++++------
> security/selinux/netif.c | 6 +++++-
> security/selinux/netnode.c | 5 ++++-
> security/selinux/netport.c | 6 +++++-
> 4 files changed, 19 insertions(+), 9 deletions(-)
Merged into selinux/dev, thanks!
--
paul-moore.com
next prev parent reply other threads:[~2025-04-11 20:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 8:33 [RFC PATCH 2/6] selinux: contify network namespace pointer Christian Göttsche
2025-03-18 8:33 ` [RFC PATCH 3/6] selinux: add likely hints for fast paths Christian Göttsche
2025-04-11 20:29 ` [PATCH RFC " Paul Moore
2025-03-18 8:33 ` [RFC PATCH 4/6] selinux: improve network lookup failure warnings Christian Göttsche
2025-04-11 20:29 ` [PATCH RFC " Paul Moore
2025-04-15 14:28 ` Christian Göttsche
2025-05-20 21:09 ` Paul Moore
2025-03-18 8:33 ` [RFC PATCH 5/6] selinux: unify OOM handling in network hashtables Christian Göttsche
2025-04-11 20:29 ` Paul Moore [this message]
2025-03-18 8:33 ` [RFC PATCH 6/6] selinux: add cache stats for network tables Christian Göttsche
2025-03-18 8:33 ` [RFC PATCH 1/6] selinux: constify network address pointer Christian Göttsche
2025-04-11 20:29 ` [PATCH RFC " Paul Moore
2025-04-11 20:29 ` [PATCH RFC 2/6] selinux: contify network namespace pointer 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=4e6ec6918748074d1f081320eba38eda@paul-moore.com \
--to=paul@paul-moore.com \
--cc=brambonne@google.com \
--cc=casey@schaufler-ca.com \
--cc=cgoettsche@seltendoof.de \
--cc=cgzones@googlemail.com \
--cc=chenzhou10@huawei.com \
--cc=guocanfeng@uniontech.com \
--cc=guozihua@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=omosnace@redhat.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=tweek@google.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®