Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

apparmor: fix boolean argument in apparmor_mmap_file

The previous value of GFP_ATOMIC is an int and not a bool, potentially
resulting in UB when being assigned to a bool. In addition, the mmap hook
is called outside of locks (i.e. in a non-atomic context), so we can pass
a fixed constant value of false instead to common_mmap.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

authored by

Ryan Lee and committed by
John Johansen
48d5268e 8d34e16f

+1 -1
+1 -1
security/apparmor/lsm.c
··· 584 584 static int apparmor_mmap_file(struct file *file, unsigned long reqprot, 585 585 unsigned long prot, unsigned long flags) 586 586 { 587 - return common_mmap(OP_FMMAP, file, prot, flags, GFP_ATOMIC); 587 + return common_mmap(OP_FMMAP, file, prot, flags, false); 588 588 } 589 589 590 590 static int apparmor_file_mprotect(struct vm_area_struct *vma,