syscall: remove PROT_WRITE|PROT_EXEC from brk02
PATCH 1/1 syscall: remove PROT_WRITE|PROT_EXEC from brk02
We got permission denied while performing the brk02 on x86_64/s390x (kernel-4.18). After looking at the manual page of mprotect(), seems the access issue caused by PROT_EXEC.
" POSIX says that the behavior of mprotect() is unspecified if it is applied to a region of memory that was not obtained via mmap(2). "
# ./brk02 tst_test.c:1291: TINFO: Timeout per run is 0h 05m 00s brk02.c:41: TFAIL: Cannot mprotect new VMA
From Liam Howlett:
Just removing the PROT_EXEC invalidates the test. However, if both PROT_EXEC and PROT_WRITE are removed, then the test still does what is intended.
So let's remove 'PROT_WRITE|PROT_EXEC' to make brk02 PASS with all platforms.
--- testcases/kernel/syscalls/brk/brk02.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
testcases/kernel/syscalls/brk/brk02.c +1 -2
@@ -36,8 +36,7 @@ void brk_down_vmas(void)return ; } -if (mprotect (addr - page_size, page_size, -PROT_READ |PROT_WRITE |PROT_EXEC )) { +if (mprotect (addr - page_size, page_size,PROT_READ )) {tst_res (TFAIL |TERRNO ,"Cannot mprotect new VMA" );return ; }
Signature · 1 line
2.30.2
PATCH 1/1 syscall: remove PROT_WRITE|PROT_EXEC from brk02
Quoted 43 lines · Li Wang
We got permission denied while performing the brk02 on x86_64/s390x (kernel-4.18). After looking at the manual page of
mprotect(), seems the access issue caused byPROT_EXEC." POSIX says that the behavior of
mprotect()is unspecified if it is applied to a region of memory that was not obtained via mmap(2). "# ./brk02 tst_test.c:1291: TINFO: Timeout per run is 0h 05m 00s brk02.c:41: TFAIL: Cannot mprotect new VMAFrom Liam Howlett:
Just removing thePROT_EXECinvalidates the test. However, if bothPROT_EXECandPROT_WRITEare removed, then the test still does what is intended.So let's remove 'PROT_WRITE|PROT_EXEC' to make brk02 PASS with all platforms.
Suggested-by Liam Howlett <[email protected]>Signed-off-by Li Wang <[email protected]>Cc Cyril Hrubis <[email protected]>--- testcases/kernel/syscalls/brk/brk02.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)testcases/kernel/syscalls/brk/brk02.c +1
-2@@ -36,8 +36,7 @@ void brk_down_vmas(void)return ; } -if (mprotect (addr - page_size, page_size, -PROT_READ |PROT_WRITE |PROT_EXEC )) { +if (mprotect (addr - page_size, page_size,PROT_READ )) {tst_res (TFAIL |TERRNO ,"Cannot mprotect new VMA" );return ; }Signature · 1 line
2.30.2
PATCH 1/1 syscall: remove PROT_WRITE|PROT_EXEC from brk02
Quoted 1 line · Liam Howlett
Reviewed-by Liam R. Howlett <[email protected]>
Thanks for the review! Patch applied.
Signature · 2 lines
Regards, Li Wang