From patchwork Thu Dec 2 23:43:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Nowakowski-Krijger X-Patchwork-Id: 1563047 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=uoanQVmj; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4J4sxp6SX9z9t1r for ; Fri, 3 Dec 2021 10:44:46 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1msvkj-0005on-NO; Thu, 02 Dec 2021 23:44:37 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1msvkh-0005oW-Ji for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 23:44:35 +0000 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 6B2C43F1F2 for ; Thu, 2 Dec 2021 23:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638488675; bh=P9VbPDCvXThIVbpUbIJPsNurCMbKmfwlfnGBiBP3hZ8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uoanQVmj3aABTJoJRHQyUG8tfI7BoHxjWevyuxc0Xky1EeYokdHc0+LKmIdmUU05N vTTSvl7dGRHUnpfu4gGiLn+mlVVqh47Df+bZHCqoV1M9bNEQ+2+HO4kannxE6yFbPE Rki/Y9YJ5eGaWXVBm9qISQr7XHROkVaoJLIsLOmPovRgacOQh6FqOcra2tFy0oB7U3 MWFH1cc6Z54I4VlzNZJyEkqz2PXel4CPxQPw29rK4f5a9AcoMD17Fc/M97TPo6Yl0C 7vUcKphNz+2f9wEeqQ1g5gcFsBSJxpnLPFGtyOmQD7gO1rUHCQt6jB7FfcrvsqkYO7 pHC0GhfERhC9g== Received: by mail-oo1-f71.google.com with SMTP id g20-20020a4a7554000000b002caefc8179cso908824oof.1 for ; Thu, 02 Dec 2021 15:44:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P9VbPDCvXThIVbpUbIJPsNurCMbKmfwlfnGBiBP3hZ8=; b=epamcsWgPzRZu9SwiXGuWLaTieIPZ4Jn5dwkW7cIKkNSxc/R0x4B8aSgOCYYwnT3Jd eTFGuHfUb+ZTiZ44CnpcLQ6JMubE4xkmawXkoKJ1rwrCIaGBy4GxCRmkW8KoO6e/aSxi Y6QoCGrPkdRcyyr2/Z75BBy/5dm6gwdvPXhNvLC58rp3F+GGFSypgfWw/BZ5AJVocbB+ r/2JYNCUUiqBZ+h+R4MAAuV3g8NUHgSzwfVGnwBqm0cRbgkyeZIagjXh0dPeZyNfQMKh 72cBq41RoqdGuFJYwFAdJPnbPS68rgRe92IWXWK35IiG936JTmHa5AjIQiakJCkW90hi 1k3w== X-Gm-Message-State: AOAM533ggb4wwSHCZ9O0qVYj2OMuDET88677c7oNXOzf1HGC1RiznQT1 qZvZ2eQphRUsuiQSajX/gG0JORm7nQEjLLmP0zKGiUVUkYLMP7lLBTlEH48jOmGCBYkWuj3Yaii Y4dRj7LC63wqRFZtTKAZ4mZuozxBDICsskWqK0lGXww== X-Received: by 2002:a05:6808:1709:: with SMTP id bc9mr6975488oib.130.1638488673987; Thu, 02 Dec 2021 15:44:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7C8uNdrvuDl9f7SaNTUxKL3gBUKLaWYWzjShEz+Y6SsI4BtJFJYkmR9Mxz3fRo8WTB6Y97g== X-Received: by 2002:a05:6808:1709:: with SMTP id bc9mr6975475oib.130.1638488673796; Thu, 02 Dec 2021 15:44:33 -0800 (PST) Received: from localhost.localdomain (108-249-109-234.lightspeed.sndgca.sbcglobal.net. [108.249.109.234]) by smtp.gmail.com with ESMTPSA id o26sm313083otj.14.2021.12.02.15.44.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 15:44:33 -0800 (PST) From: Luke Nowakowski-Krijger To: kernel-team@lists.ubuntu.com Subject: [SRU][F][PATCH v2 1/1] UBUNTU: SAUCE: selftests/seccomp: fix "storage size of 'md' isn't known" build issue Date: Thu, 2 Dec 2021 15:43:34 -0800 Message-Id: <8ebe7816326a74d7188c0a5a566ad4180a8fb4a3.1638487717.git.luke.nowakowskikrijger@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: 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/1896420 There is a build issue on Bionic/5.4 kernels due to PTRACE_SECCOMP_GET_METADATA being defined in glibc header sys/ptrace.h, which then stops struct seccomp_metadata from being defined leading to: seccomp_bpf.c:3028:26: error: storage size of 'md' isn't known The solution here is to unconditonally define the seccomp_metadata definition that we need, and remove the linux/ptrace.h header where a definition of seccomp_metadata exists in Focal. Signed-off-by: Luke Nowakowski-Krijger Acked-by: Kleber Sacilotto de Souza Acked-by: Stefan Bader --- v2: Added comment to explain why there is a header definiton being defined in the file and to suggest to future developers that they might have to do the same for future fixes for defintion issues like this. tools/testing/selftests/seccomp/seccomp_bpf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index e9a00d26666f..64f2b43bc59b 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -158,12 +157,17 @@ struct seccomp_data { #ifndef PTRACE_SECCOMP_GET_METADATA #define PTRACE_SECCOMP_GET_METADATA 0x420d +#endif +/* + * There are conflicting definitions in ptrace system headers that lead to + * struct seccomp_metadata to not be defined. So until those conflicts get + * sorted out, we should rely on some of our own in-tree ptrace definitions. + */ struct seccomp_metadata { __u64 filter_off; /* Input: which filter */ __u64 flags; /* Output: filter's flags */ }; -#endif #ifndef SECCOMP_FILTER_FLAG_NEW_LISTENER #define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)