From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D52EDC4338F for ; Sun, 22 Aug 2021 12:08:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A66566101A for ; Sun, 22 Aug 2021 12:08:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230120AbhHVMJD (ORCPT ); Sun, 22 Aug 2021 08:09:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbhHVMJC (ORCPT ); Sun, 22 Aug 2021 08:09:02 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D51C061575 for ; Sun, 22 Aug 2021 05:08:21 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id v10so10432907wrd.4 for ; Sun, 22 Aug 2021 05:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=zJbsT3qY5KkiBRgdFaAPKwhKk8M8Yn4DXefVqiW+zKo=; b=an8tOvdr3LF2rkvQmC7fMynDcQKqgIBPZNddx13swSYgpuby6Fj/6JiadlBTNZZk+y HY777qY+1sq/vE/uU4W9nSPI0MUJ6JvA5GMZuv2PxVM3mHSdcoM4d/ngirefwsLUi7sP pErKLxUOpJxjmD+NcfYBjc1g+btWQSiByCH5AuUVpU8/2l33ABLnRRITtGGU/4aJlBXc 5wJxLpaHB2/7cfUnpmydqM/lXPvB0/j2321HUZCRd4eFs++i1Rml5Pwb2sDJPGI9lQZv G5q6+/iPO+4KNTQ94pjYM41XK4MuVRmlI4FIVqnC5wat7Jz80Dw7VQkAy/w2LQh7axQG 1JBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=zJbsT3qY5KkiBRgdFaAPKwhKk8M8Yn4DXefVqiW+zKo=; b=HI4L3Xtqlvh096KHgUcN0P+kk0VwBELgDtGeWTbwOt6I1/PWve9avOHNLSQERytwd6 0AP3CP6kzvbXwCGPFISMEjzgLO5aHR3/adsmPfst8yDsqCNYYEaHvFrtoKX9zy3Gxi3Q X8YHFasBEZyDIB2gh5eBO+By7Hl/0oX7NBriqp687oP6uTEiuaPsuiBxfg7IT2DuDzAb 7kD7Pb3XV6otciytyjk+2hcSxi34SMCKF4Acsx5QpluPWUZnpQ6WtB5jIRMZ4+Fi4pqh 9rVn36jObKY+c9ruYKRSEzF2uT3UR3N+EreBhjQZksDmJ6zhXKvGWS68PILtHuyu2Abo 3eCA== X-Gm-Message-State: AOAM530c5L22mOIBmbmc35O6FJ1g6zJILjVJE55rD/48mr+wsA7eM8+A EuUiCZmCj3YaeIAlBjWzFDtVpHomMsw= X-Google-Smtp-Source: ABdhPJzUWP0w6/+97ZqZAF/XT4zX9nc4hfa5TeZNtKDF602XFANFRdTvV5R18XfyQHsbOhG5tzCBGg== X-Received: by 2002:adf:e9c3:: with SMTP id l3mr8536950wrn.300.1629634100199; Sun, 22 Aug 2021 05:08:20 -0700 (PDT) Received: from localhost.localdomain ([85.255.233.174]) by smtp.gmail.com with ESMTPSA id l2sm11604294wrx.2.2021.08.22.05.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Aug 2021 05:08:19 -0700 (PDT) From: Pavel Begunkov To: Jens Axboe , io-uring@vger.kernel.org Subject: [PATCH liburing] tests; skip non-root sendmsg_fs_cve Date: Sun, 22 Aug 2021 13:07:43 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Skip sendmsg_fd_cve if we don't have enough privileges to chroot(). Signed-off-by: Pavel Begunkov --- 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