Skip sendmsg_fd_cve if we don't have enough privileges to chroot(). Cc: Ammar Faizi <ammarfaizi2@xxxxxxxxx> Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- v2: fix error checking (Ammar Faizi) 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..3866e5d 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 (errno == EPERM) { + fprintf(stderr, "chroot not allowed, skip\n"); + return 0; + } + perror("chroot()"); return 1; } -- 2.32.0