summaryrefslogtreecommitdiff
path: root/security/apparmor/lsm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-02-01 17:45:32 +0000
committerMark Brown <broonie@kernel.org>2024-02-01 17:45:32 +0000
commite81fdba0208666b65bafeaba814874b4d6e5edde (patch)
tree5de26e8be4ca1801ca27bffe25c129d29b13dba9 /security/apparmor/lsm.c
parent5513c5d0fb3d509cdd0a11afc18441c57eb7c94c (diff)
parent28876c1ae8b8cd1dacef50bd6c0555824774f0d2 (diff)
ALSA: Various fixes for Cirrus Logic CS35L56 support
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: These patches fixe various things that were undocumented, unknown or uncertain when the original driver code was written. And also a few things that were just bugs.
Diffstat (limited to 'security/apparmor/lsm.c')
-rw-r--r--security/apparmor/lsm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 7717354ce095..98e1150bee9d 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -469,8 +469,10 @@ static int apparmor_file_open(struct file *file)
* Cache permissions granted by the previous exec check, with
* implicit read and executable mmap which are required to
* actually execute the image.
+ *
+ * Illogically, FMODE_EXEC is in f_flags, not f_mode.
*/
- if (current->in_execve) {
+ if (file->f_flags & __FMODE_EXEC) {
fctx->allow = MAY_EXEC | MAY_READ | AA_EXEC_MMAP;
return 0;
}