io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH liburing] tests; skip non-root sendmsg_fs_cve
@ 2021-08-22 12:07 Pavel Begunkov
  2021-08-22 12:43 ` Ammar Faizi
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Begunkov @ 2021-08-22 12:07 UTC (permalink / raw)
  To: Jens Axboe, io-uring

Skip sendmsg_fd_cve if we don't have enough privileges to chroot().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/sendmsg_fs_cve.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/sendmsg_fs_cve.c b/test/sendmsg_fs_cve.c
index 8de220a..57347af 100644
--- a/test/sendmsg_fs_cve.c
+++ b/test/sendmsg_fs_cve.c
@@ -154,7 +154,13 @@ int main(int argc, char *argv[])
 	if (!c) {
 		close(rcv_sock);
 
-		if (chroot(tmpdir)) {
+		r = chroot(tmpdir);
+		if (r) {
+			if (r == -EPERM) {
+				fprintf(stderr, "chroot not allowed, skip\n");
+				return 0;
+			}
+
 			perror("chroot()");
 			return 1;
 		}
-- 
2.32.0


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

end of thread, other threads:[~2021-08-22 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22 12:07 [PATCH liburing] tests; skip non-root sendmsg_fs_cve Pavel Begunkov
2021-08-22 12:43 ` Ammar Faizi
2021-08-22 12:46   ` Pavel Begunkov

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 NNTP newsgroup(s).