Re: + selinux-use-vma_is_stack-and-vma_is_heap-fix.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2023/7/13 4:53, Andrew Morton wrote:

The patch titled
      Subject: selinux-use-vma_is_stack-and-vma_is_heap-fix
has been added to the -mm mm-unstable branch.  Its filename is
      selinux-use-vma_is_stack-and-vma_is_heap-fix.patch

This patch will shortly appear at
      https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selinux-use-vma_is_stack-and-vma_is_heap-fix.patch

This patch will later appear in the mm-unstable branch at
     git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
    a) Consider who else should be cc'ed
    b) Prefer to cc a suitable mailing list as well
    c) Ideally: find the original patch on the mailing list and do a
       reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: selinux-use-vma_is_stack-and-vma_is_heap-fix
Date: Wed Jul 12 01:42:33 PM PDT 2023

fix build

security/selinux/hooks.c: In function 'selinux_file_mprotect':
security/selinux/hooks.c:3768:42: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
  3768 |                 } else if (!vma->vm_file && vma_is_stack(vma) ||
       |                            ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
security/selinux/hooks.c:3769:59: error: expected statement before ')' token
  3769 |                             vma_is_stack_for_current(vma))) {
       |                                                           ^
security/selinux/hooks.c:3768:24: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
  3768 |                 } else if (!vma->vm_file && vma_is_stack(vma) ||
       |                        ^~
security/selinux/hooks.c:3769:61: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  3769 |                             vma_is_stack_for_current(vma))) {
       |                                                             ^
security/selinux/hooks.c:3772:19: error: expected '}' before 'else'
  3772 |                 } else if (vma->vm_file && vma->anon_vma) {
       |                   ^~~~
security/selinux/hooks.c:3780:25: error: 'rc' undeclared (first use in this function); did you mean 'rq'?
  3780 |                         rc = file_has_perm(cred, vma->vm_file, FILE__EXECMOD);
       |                         ^~
       |                         rq
security/selinux/hooks.c:3780:25: note: each undeclared identifier is reported only once for each function it appears in
security/selinux/hooks.c: At top level:
security/selinux/hooks.c:3786:9: error: expected identifier or '(' before 'return'
  3786 |         return file_map_prot_check(vma->vm_file, prot, vma->vm_flags&VM_SHARED);
       |         ^~~~~~
security/selinux/hooks.c:3787:1: error: expected identifier or '(' before '}' token
  3787 | }
       | ^
security/selinux/hooks.c: In function 'selinux_file_mprotect':
security/selinux/hooks.c:3784:9: error: control reaches end of non-void function [-Werror=return-type]
  3784 |         }
       |         ^

Cc: Eric Paris <eparis@xxxxxxxxxxxxxx>
Cc: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
Cc: Paul Moore <paul@xxxxxxxxxxxxxx>
Cc: Stephen Smalley <stephen.smalley.work@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

Sorry for the typo, my arm64 built without CONFIG_SECURITY_SELINUX
and missing this, thanks Andrew.


  security/selinux/hooks.c |    5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

--- a/security/selinux/hooks.c~selinux-use-vma_is_stack-and-vma_is_heap-fix
+++ a/security/selinux/hooks.c
@@ -3765,8 +3765,9 @@ static int selinux_file_mprotect(struct
  		if (vma_is_heap(vma)) {
  			rc = avc_has_perm(sid, sid, SECCLASS_PROCESS,
  					  PROCESS__EXECHEAP, NULL);
-		} else if (!vma->vm_file && vma_is_stack(vma) ||
-			    vma_is_stack_for_current(vma))) {
+		} else if (!vma->vm_file &&
+			  	(vma_is_stack(vma) ||
+				 vma_is_stack_for_current(vma))) {
  			rc = avc_has_perm(sid, sid, SECCLASS_PROCESS,
  					  PROCESS__EXECSTACK, NULL);
  		} else if (vma->vm_file && vma->anon_vma) {
_

Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are

mm-shmem-fix-race-in-shmem_undo_range-w-thp-fix.patch
swap-stop-add-to-avail-list-is-swap-is-full-checkpatch-fixes.patch
fs-buffer-clean-up-block_commit_write-fix.patch
mm-page_alloc-avoid-false-page-outside-zone-error-info-fix.patch
mm-make-pte_marker_swapin_error-more-general-fix.patch
selinux-use-vma_is_stack-and-vma_is_heap-fix.patch
signal-print-comm-and-exe-name-on-fatal-signals-fix.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux