public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] pkey01: print more info when write buff fail
@ 2022-04-11  9:40 Li Wang
  2022-04-11  9:40 ` [LTP] [PATCH 2/2] pkey: correct the PKEY_DISABLE_ACCESS definitions on PowerPC Li Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Li Wang @ 2022-04-11  9:40 UTC (permalink / raw)
  To: ltp

We got sporadically failed on POWER9 but couldn't reproduce the problem
manually. Here add printf to show info to see if the PKEY_DISABLE_WRITE
takes effect on buffers.

  pkey01.c:149: TINFO: Set PKEY_DISABLE_WRITE on (MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB) buffer
  pkey01.c:174: TFAIL: Child: exited with 0
  pkey01.c:176: TINFO: Remove PKEY_DISABLE_WRITE from the buffer

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/pkeys/pkey01.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/syscalls/pkeys/pkey01.c b/testcases/kernel/syscalls/pkeys/pkey01.c
index 04f50924c..1a9194e1a 100644
--- a/testcases/kernel/syscalls/pkeys/pkey01.c
+++ b/testcases/kernel/syscalls/pkeys/pkey01.c
@@ -161,6 +161,8 @@ static void pkey_test(struct tcase *tc, struct mmap_param *mpa)
 		break;
 		case PKEY_DISABLE_WRITE:
 			*buffer = 'a';
+			tst_res(TFAIL | TERRNO,
+				"Write buffer success, buffer[0] = %d", *buffer);
 		break;
 		}
 		exit(0);
@@ -183,6 +185,7 @@ static void pkey_test(struct tcase *tc, struct mmap_param *mpa)
 	break;
 	case PROT_WRITE:
 		*buffer = 'a';
+		tst_res(TPASS, "Write buffer success, buffer[0] = %d", *buffer);
 	break;
 	case PROT_READ | PROT_WRITE:
 	case PROT_READ | PROT_WRITE | PROT_EXEC:
-- 
2.31.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2022-10-10 10:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11  9:40 [LTP] [PATCH 1/2] pkey01: print more info when write buff fail Li Wang
2022-04-11  9:40 ` [LTP] [PATCH 2/2] pkey: correct the PKEY_DISABLE_ACCESS definitions on PowerPC Li Wang
2022-04-11 10:57   ` Jan Stancek
2022-04-11 12:35     ` Li Wang
2022-10-10 10:45       ` Richard Palethorpe
2022-04-19  6:57 ` [LTP] [PATCH 1/2] pkey01: print more info when write buff fail Petr Vorel
2022-06-10  8:16 ` Cyril Hrubis
2022-06-14  7:23   ` Li Wang

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