public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix tst-pkey expectations on pkey_get
@ 2020-02-07 13:46 Lucas A. M. Magalhaes
  2020-02-07 18:22 ` Florian Weimer
  2020-02-13 18:42 ` [PATCH V2] " Lucas A. M. Magalhaes
  0 siblings, 2 replies; 13+ messages in thread
From: Lucas A. M. Magalhaes @ 2020-02-07 13:46 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer

From the GNU LibC Manual the pkey_set can receive a combination of
PKEY_DISABLE_WRITE and PKEY_DISABLE_ACCESS.  However PKEY_DISABLE_ACCESS
is more restrictive than PKEY_DISABLE_WRITE and includes its behavior.

The test expects that after setting
(PKEY_DISABLE_WRITE|PKEY_DISABLE_ACCESS) pkey_get should return the
same.  This may not be true as PKEY_DISABLE_ACCESS will succeed in
describe the state of the key in this case.

---
Hi,

Florian, Your patch including pkey_set and pkey_get looks good to me.
Can you merge it?  This one
https://sourceware.org/ml/libc-alpha/2018-05/msg00760.html.

With this there will be one failure on this test on powerpc machines.
The test expects that during a signal handling the pkey_get returns
PKEY_DISABLE_ACCESS for all keys. In my tests it returns the same
permissions as before the signal. I couldn't find where this is done for
x86. Is this kernel implementation?

 sysdeps/unix/sysv/linux/tst-pkey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/tst-pkey.c b/sysdeps/unix/sysv/linux/tst-pkey.c
index 4ea1bc4f9a..11084520b3 100644
--- a/sysdeps/unix/sysv/linux/tst-pkey.c
+++ b/sysdeps/unix/sysv/linux/tst-pkey.c
@@ -37,7 +37,7 @@ static pthread_barrier_t barrier;
 
 /* The keys used for testing.  These have been allocated with access
    rights set based on their array index.  */
-enum { key_count = 4 };
+enum { key_count = 3 };
 static int keys[key_count];
 static volatile int *pages[key_count];
 
-- 
2.20.1

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

end of thread, other threads:[~2020-02-19 14:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 13:46 [PATCH] Fix tst-pkey expectations on pkey_get Lucas A. M. Magalhaes
2020-02-07 18:22 ` Florian Weimer
2020-02-11 14:03   ` Lucas A. M. Magalhaes
2020-02-11 16:09     ` Florian Weimer
2020-02-12 16:46       ` Lucas A. M. Magalhaes
2020-02-12 17:17         ` Florian Weimer
2020-02-13 18:42 ` [PATCH V2] " Lucas A. M. Magalhaes
2020-02-14 17:02   ` Florian Weimer
2020-02-14 20:44   ` [PATCH v3] Fix tst-pkey expectations on pkey_get [BZ #23202] Lucas A. M. Magalhaes
2020-02-15 13:12     ` Florian Weimer
2020-02-17 12:10       ` [PATCH v4] " Lucas A. M. Magalhaes
2020-02-17 12:51         ` Florian Weimer
2020-02-19 14:41         ` Tulio Magno Quites Machado Filho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).