From patchwork Fri Apr 10 12:00:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1269041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48zGmT5WZkz9sSw; Fri, 10 Apr 2020 22:00:23 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jMsKZ-0006Pa-Dl; Fri, 10 Apr 2020 12:00:19 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jMsKX-0006Ok-Qn for kernel-team@lists.ubuntu.com; Fri, 10 Apr 2020 12:00:17 +0000 Received: from [179.174.30.106] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jMsKX-0001Gu-4T for kernel-team@lists.ubuntu.com; Fri, 10 Apr 2020 12:00:17 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [Disco/Eoan] Revert "selftests/seccomp: Catch garbage on SECCOMP_IOCTL_NOTIF_RECV" Date: Fri, 10 Apr 2020 09:00:06 -0300 Message-Id: <20200410120006.6261-2-cascardo@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200410120006.6261-1-cascardo@canonical.com> References: <20200410120006.6261-1-cascardo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1862588 This reverts upstream commit e4ab5ccc357b978999328fadae164e098c26fa40. Running linux/tools/testing/selftests/seccomp/seccomp_bpf will fail with: seccomp_bpf.c:3149:global.user_notification_basic:Expected -1 (18446744073709551615) == ret (0) seccomp_bpf.c:3150:global.user_notification_basic:Expected EINVAL (22) == errno (0) global.user_notification_basic: Test failed at step #3 [ FAIL ] global.user_notification_basic The test is checking that the given structure which the kernel will write to is all zeroes and would return EINVAL otherwise. It's doing it because it wants userspace to have the possibility in the future to give data there indicating support for an extension that might be developed in the future. As the test is there right now, not applying the breaking uABI fix might cause us to miss applications that would break in future kernels. As the backport for that is prone for more regression potential, we are deciding to revert the new test. Signed-off-by: Thadeu Lima de Souza Cascardo Acked-by: Andrea Righi Acked-by: Colin Ian King --- tools/testing/selftests/seccomp/seccomp_bpf.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index a819ab57fafe..f80b248eb389 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -3154,18 +3154,7 @@ TEST(user_notification_basic) EXPECT_GT(poll(&pollfd, 1, -1), 0); EXPECT_EQ(pollfd.revents, POLLIN); - /* Test that we can't pass garbage to the kernel. */ - memset(&req, 0, sizeof(req)); - req.pid = -1; - errno = 0; - ret = ioctl(listener, SECCOMP_IOCTL_NOTIF_RECV, &req); - EXPECT_EQ(-1, ret); - EXPECT_EQ(EINVAL, errno); - - if (ret) { - req.pid = 0; - EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_RECV, &req), 0); - } + EXPECT_EQ(ioctl(listener, SECCOMP_IOCTL_NOTIF_RECV, &req), 0); pollfd.fd = listener; pollfd.events = POLLIN | POLLOUT;