From patchwork Mon May 9 14:25:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1628639 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=fzjOIqTg; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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 4Kxk3K5VBDz9sGF for ; Tue, 10 May 2022 00:25:17 +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 1no4K1-0007BN-3g; Mon, 09 May 2022 14:25:13 +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 1no4Jx-00078e-1V for kernel-team@lists.ubuntu.com; Mon, 09 May 2022 14:25:09 +0000 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (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 D0EBE3F85D for ; Mon, 9 May 2022 14:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652106308; bh=Ry00yypfmOcmk3Ozrif7BKWCPQXPrYR6LIqC42TjsSY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fzjOIqTg5EDNFgbdRECyPSq1rAKBOek3c+X07omWRNYqcHhRHG0eVP/91+dYU4yYZ CkWMtXWtk8l4ZzTqY86jnE0telvt1A3s2E4HquktBZnXDjCCrghZeFIn8OkxRIcLat zZpbiO/qquIEdxcBQY94ZCSgAUE7YkaVf/nxH8pfLRfrhLKyJ1alujm7htA4ClWqBx Y9HjjOd3fngHLYivbigC22OnFvdJ8YKa0KmnRACQ1KHxJuo9OLcJuf3JPtASc9sLQF 41vTYF3L5iVHAbjjCGOPhPkOSXhMaElDc8CpP/Aq59gkJVOLQszBPASdKCvgb4VShH SZ8NWCALi2GEQ== Received: by mail-ed1-f70.google.com with SMTP id dk9-20020a0564021d8900b00425a9c3d40cso8440744edb.7 for ; Mon, 09 May 2022 07:25:08 -0700 (PDT) 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=Ry00yypfmOcmk3Ozrif7BKWCPQXPrYR6LIqC42TjsSY=; b=E6VIQdld4mcL8JL2L+M/tGmXuYZ24QD6bIDaLtYLFss96v2OHY6COObDEmBC+wpFGD U8nmRyyygTKKKSKY0kWIEdCxO77SEeOmpfjEp/KhneoiVZ3SLmYbaIlEWurJJOvukDWz JdLKPOnwi01HKdHyo7Ep64senODqydqDIYFCUj3iI7GGOvLw6E01ZWLUhPq5cfBFfoMH XrS6z3gDfvJ1sfCVuWUkS7DcMSgsliXy7xlVIXwx6omyngbJ8d4JLtZu+1/2dFeJ/ZL9 35GbENuh5OPRVxER7QqwrdB1qfuSsRkhJbkp29ZnanvNp0p8LOgthIwgKOSVRSE/WAzk xIvQ== X-Gm-Message-State: AOAM532p7Xv7lr5SrP+oSHDhzaHGLJBtJPTXNS5OeEgPEH2IjQMSM6fE uATPAyoN7lAsRUSO9G/mCgOfzgzDsW8jTd3lzLRWfQ/oidzMxgwYkuycRiCiSq+kBP2h0I5wsnh 3yNIXojRymYich199jVz5qJC8v7lCjtJEtY3pXznqlQ== X-Received: by 2002:a05:6402:2804:b0:420:caf1:961c with SMTP id h4-20020a056402280400b00420caf1961cmr17686301ede.280.1652106308550; Mon, 09 May 2022 07:25:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRkqCn/b/W7k/o5oGCyb/SZTM6X3OwBkT18vxrpcNys4cVDPbAFCE8Zp8iQQzpsmETY8Qk5w== X-Received: by 2002:a05:6402:2804:b0:420:caf1:961c with SMTP id h4-20020a056402280400b00420caf1961cmr17686281ede.280.1652106308359; Mon, 09 May 2022 07:25:08 -0700 (PDT) Received: from gollum.fritz.box ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id l15-20020a17090612cf00b006f3ef214df9sm5143736ejb.95.2022.05.09.07.25.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 07:25:07 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable][PATCH v2 2/3] UBUNTU: [Packaging] Strip signatures from untrusted staging modules Date: Mon, 9 May 2022 16:25:03 +0200 Message-Id: <20220509142504.493925-3-juergh@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220509142504.493925-1-juergh@canonical.com> References: <20220509142504.493925-1-juergh@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/1642368 'Untrusted' staging modules shouldn't be loadable in a secure boot environment so strip the signatures from staging modules that are not listed in debian/signature-inclusion. Signed-off-by: Juerg Haefliger --- debian/rules.d/2-binary-arch.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index c4906036ceb8..6e3456cfce81 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -189,6 +189,17 @@ endif INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$(pkgdir)/ \ INSTALL_FW_PATH=$(pkgdir)/lib/firmware/$(abi_release)-$* + # Strip signatures from 'untrusted' staging modules. + # Use --strip-debug per comments in scripts/Makefile.modinst. + if [ -f "$(DROOT)"/signature-inclusion ] ; then \ + find "$(pkgdir)" -path '*/drivers/staging/*.ko' | while IFS= read -r mod ; do \ + if ! grep -qFx "$${mod##*/}" "$(DROOT)"/signature-inclusion ; then \ + echo "UBUNTU: Strip $${mod}" ; \ + $(CROSS_COMPILE)strip --strip-debug "$${mod}" ; \ + fi ; \ + done ; \ + fi + # # Build module blacklists: # - blacklist all watchdog drivers (LP:1432837)