Thread (5 messages) 5 messages, 4 authors, 2021-01-12

Re: Question about inode security blob

flat view

From: KP Singh <kpsingh@kernel.org>
Date: 2021-01-12 08:11:47

On Tue, Jan 12, 2021 at 5:39 AM James Morris [off-list ref] wrote:
On Mon, 11 Jan 2021, Fan Wu wrote:
quoted
quoted
The inode->i_security should never be NULL if the inode has been
initialized. Any LSM hook that finds this to be NULL has probably
identified a bug elsewhere in the system.
Thanks for the quick reply. If I understand correctly, I should follow the
first pattern if I want to use the inode blob.
I don't think it's necessary, and if there's a race somewhere causing
this, we shouldn't just paper it over.

Btw, none of the existing cases are even using WARN_ON or similar to let
the user know there's a problem.
I agree, for BPF, I will send a patch to switch to using WARN_ON_ONCE or just
get rid of the check altogether.

--
James Morris
[off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help