linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* LSM hook ordering in shmem_mknod() and shmem_tmpfile()?
@ 2023-08-30 16:05 Paul Moore
  2023-08-31  9:19 ` Hugh Dickins
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Moore @ 2023-08-30 16:05 UTC (permalink / raw)
  To: linux-mm, linux-security-module; +Cc: Hugh Dickins, Andrew Morton, selinux

Hello all,

While looking at some recent changes in mm/shmem.c I noticed that the
ordering between simple_acl_create() and
security_inode_init_security() is different between shmem_mknod() and
shmem_tmpfile().  In shmem_mknod() the ACL call comes before the LSM
hook, and in shmem_tmpfile() the LSM call comes before the ACL call.

Perhaps this is correct, but it seemed a little odd to me so I wanted
to check with all of you to make sure there is a good reason for the
difference between the two functions.  Looking back to when
shmem_tmpfile() was created ~2013 I don't see any explicit mention as
to why the ordering is different so I'm looking for a bit of a sanity
check to see if I'm missing something obvious.

My initial thinking this morning is that the
security_inode_init_security() call should come before
simple_acl_create() in both cases, but I'm open to different opinions
on this.

-- 
paul-moore.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-31 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30 16:05 LSM hook ordering in shmem_mknod() and shmem_tmpfile()? Paul Moore
2023-08-31  9:19 ` Hugh Dickins
2023-08-31 12:36   ` Christian Brauner
2023-08-31 15:13     ` Mimi Zohar
2023-08-31 15:26       ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox