Re: [RFC PATCH v8 00/17] Integrity Policy Enforcement LSM (IPE)

2022-06-08 Thread Matthew Wilcox
On Wed, Jun 08, 2022 at 12:01:12PM -0700, Deven Bowers wrote:
> IPE is a Linux Security Module which takes a complimentary approach to

Hello, IPE.  You're looking exceptionally attractive today.  Have you
been working out?

(maybe you meant "complementary"?  ;-)

--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit



Re: [PATCH] kernel: audit_tree: Fix a sleep-in-atomic-context bug

2018-06-21 Thread Matthew Wilcox
On Thu, Jun 21, 2018 at 11:32:45AM +0800, Jia-Ju Bai wrote:
> The kernel may sleep with holding a spinlock.
> The function call paths (from bottom to top) in Linux-4.16.7 are:
> 
> [FUNC] kmem_cache_alloc(GFP_KERNEL)
> fs/notify/mark.c, 439: 
>   kmem_cache_alloc in fsnotify_attach_connector_to_object
> fs/notify/mark.c, 520: 
>   fsnotify_attach_connector_to_object in fsnotify_add_mark_list
> fs/notify/mark.c, 590: 
>   fsnotify_add_mark_list in fsnotify_add_mark_locked
> kernel/audit_tree.c, 437: 
>   fsnotify_add_mark_locked in tag_chunk
> kernel/audit_tree.c, 423: 
>   spin_lock in tag_chunk

There are several locks here; your report would be improved by saying
which one is the problem.  I'm assuming it's old_entry->lock.

spin_lock(_entry->lock);
...
if (fsnotify_add_inode_mark_locked(chunk_entry,
 old_entry->connector->inode, 1)) {
...
return fsnotify_add_mark_locked(mark, inode, NULL, allow_dups);
...
ret = fsnotify_add_mark_list(mark, inode, mnt, allow_dups);
...
if (inode)
connp = >i_fsnotify_marks;
conn = fsnotify_grab_connector(connp);
if (!conn) {
err = fsnotify_attach_connector_to_object(connp, inode, mnt);

It seems to me that this is safe because old_entry is looked up from
fsnotify_find_mark, and it can't be removed while its lock is held.
Therefore there's always a 'conn' returned from fsnotify_grab_connector(),
and so this path will never be taken.

But this code path is confusing to me, and I could be wrong.  Jan, please
confirm my analysis is correct?

> [FUNC] kmem_cache_alloc(GFP_KERNEL)
> fs/notify/mark.c, 439: 
>   kmem_cache_alloc in fsnotify_attach_connector_to_object
> fs/notify/mark.c, 520: 
>   fsnotify_attach_connector_to_object in fsnotify_add_mark_list
> fs/notify/mark.c, 590: 
>   fsnotify_add_mark_list in fsnotify_add_mark_locked
> kernel/audit_tree.c, 291: 
>   fsnotify_add_mark_locked in untag_chunk
> kernel/audit_tree.c, 258: 
>   spin_lock in untag_chunk

I'm just going to assume this one is the same.

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


Re: [RFC PATCH V1 01/12] audit: add container id

2018-03-02 Thread Matthew Wilcox
On Fri, Mar 02, 2018 at 10:48:42AM -0500, Paul Moore wrote:
> On Thu, Mar 1, 2018 at 8:41 PM, Richard Guy Briggs  wrote:
> > On 2018-03-01 14:41, Richard Guy Briggs wrote:
> FYI, I think you may have a problem with something in your outgoing
> mail path; I didn't receive the original patchset you are referencing
> and it doesn't appear in the mail archive either.

I have those patches.  Which mail archive is missing them?

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit