From patchwork Mon May 9 14:25:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1628636 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=bAOXe4lA; 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 4Kxk3J1mx3z9sGS for ; Tue, 10 May 2022 00:25:16 +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 1no4Jy-00079I-PT; Mon, 09 May 2022 14:25:10 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1no4Jw-00078T-U0 for kernel-team@lists.ubuntu.com; Mon, 09 May 2022 14:25:08 +0000 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.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-1.canonical.com (Postfix) with ESMTPS id B37203F1CC 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=LIOzJVS5b++qjwc0jLUagINgKVA3ErLF/tyQoVY5T60=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bAOXe4lA30Om2X2S91K2JSgAVCiUfw8FBy95PogAklhd+6cBBxl6308VtNN8vlp5D xeJL6bxAdZsvQ6RoQawGp/Os0gE6q7/xp9Ljy8g9DE+7h97wzsBw17NRAvhQRmPs8j PL2QJNC0qLpEqJw7OLnGIwA3OBhRuQlcNPn7l2h/hLRaXqkHPai4GnaXfVTRTfvR1E S+QMM2ZYdnVKkd4mKiYUYGqD08pHxRHaN1uZDfsKkqqoYpDQQxAXwTnl4ETQ+36Mqg 2M2b7i3r4HOBnss1QvyoKB8pSz95yx7/Y27pJkp/MV8DwkfMLrpBCQher9fD0VFTu+ 5zOcV/BBnK9mw== Received: by mail-ej1-f71.google.com with SMTP id qw30-20020a1709066a1e00b006f45e7f44b0so6809320ejc.5 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=LIOzJVS5b++qjwc0jLUagINgKVA3ErLF/tyQoVY5T60=; b=gk/kNAimOVtNR/vs9ZEXB2lRlK0mCHLwO3ZqrZcTAKE/3sUVSPW4NS05vF7jDmNF0z 6SUoToUqf48D7rm7whZm+/j6CBlRL0HRmG/WHR5MUUUl3xOqIhw4NFINExuOmL0tKbnb +itNru/VVntjzFg8lMa6noFuYo+0CC2watdFOb7Z86ElvM1R2VXd7fEOITLU+gFmGIzd fO6XVnFcg51Tv6CR8W3It5OOe4N4JIZi85yklw4JFxsAX+YHlUD9juHtwGvbKvL4MDbp o1u2QyXnYsjo5lsm0BdBXp3D728c20+ZzaozuMiEqMILxbZN7FCu0ycFkKm5HeS2+fnn 3inQ== X-Gm-Message-State: AOAM531fMRcftphZYGOFwv+mUgtRhS/odyjVBFvp8Y/Popp937VBmdQs aYwbvMUyjZlvIpgi+BpyDdRXTxrenfL5Xmc8GXOX1J4/kGyCRdC5WqyyJlPjJ2fSwIhyaVPmIS4 dNLeDSp9hSYoYX3Hd06LAXCp0kJXoXkZU1c2rWt7dlw== X-Received: by 2002:a05:6402:51d3:b0:428:4666:b389 with SMTP id r19-20020a05640251d300b004284666b389mr17966835edd.345.1652106307631; Mon, 09 May 2022 07:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOzViu1xiEqcwQXFCZmxb/VpJSYb6G09TJJLOiN/Y0OYs/lqixDPiHLQqNu8XJMcKxEybkDg== X-Received: by 2002:a05:6402:51d3:b0:428:4666:b389 with SMTP id r19-20020a05640251d300b004284666b389mr17966827edd.345.1652106307478; Mon, 09 May 2022 07:25:07 -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.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 07:25:06 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable][PATCH v2 1/3] UBUNTU: [Packaging] Move and update signature inclusion list Date: Mon, 9 May 2022 16:25:02 +0200 Message-Id: <20220509142504.493925-2-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 Move the signature inclusion list from the source tree to the debian/ directory to keep the upstream source clean. While at it, remove modules that are no longer in the staging area. Signed-off-by: Juerg Haefliger --- {drivers/staging => debian}/signature-inclusion | 7 ------- 1 file changed, 7 deletions(-) rename {drivers/staging => debian}/signature-inclusion (73%) diff --git a/drivers/staging/signature-inclusion b/debian/signature-inclusion similarity index 73% rename from drivers/staging/signature-inclusion rename to debian/signature-inclusion index 7e937c7fc0e3..f919d4dfddfa 100644 --- a/drivers/staging/signature-inclusion +++ b/debian/signature-inclusion @@ -2,13 +2,6 @@ # This file lists the staging drivers that are safe for signing # and loading in a secure boot environment with signed module enforcement. # -exfat.ko -rtl8192c-common.ko -rtl8192ce.ko -rtl8192cu.ko -rtl8192de.ko -rtl8192ee.ko -rtl8192se.ko r8188eu.ko r8192e_pci.ko r8192u_usb.ko 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) From patchwork Mon May 9 14:25:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1628638 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=LXl4iXGY; 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 4Kxk3J6dSbz9sGV for ; Tue, 10 May 2022 00:25:16 +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 1no4Jz-0007AB-VM; Mon, 09 May 2022 14:25:11 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.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-00078u-R3 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-1.canonical.com (Postfix) with ESMTPS id A69B73F1CC for ; Mon, 9 May 2022 14:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652106309; bh=tiICoyad91mScyog/66DLraxTlCk4LRoKRaZliXoYTA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LXl4iXGY7i/fOPExRLU0gz6Hwqt0LuoJ8mmmTPj7MBdU2uLHYUdu0VRl6jhNKk5aU W80ZKfRW1NRV7fKkXATIIAstWqsUjnGMWdxvorBO8bpKYt4mK4S1Hh/3M9FG3kFkfX axF0KzsfJhRSD8qoYsn8a4SAPmxTkWAYRJ3boGa69KlMXUZmu41yebzLMZeHxeCwt5 KQksVJUbljenlWp3Ltm8QES08gZOxx+qHyWBxN39gfb6jZwIKXSuUjiUv5jQrWkJCi nkd3P6zy7NTpVuC1MbkRRx5SSjBfYxHEUKECahSZBykLl3A+s9SBgAk7kTTo78I8Q1 kJzdxc/CSvmvg== Received: by mail-ed1-f70.google.com with SMTP id l24-20020a056402231800b00410f19a3103so8434743eda.5 for ; Mon, 09 May 2022 07:25:09 -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=tiICoyad91mScyog/66DLraxTlCk4LRoKRaZliXoYTA=; b=v+UIXGzxbxuL5X7FYJlRASCjqDvCWXAuNgMwkOcUwEzwGkRmCfBLxZ2sJu4GyYdsXL wNQtpZSCBYRrIfcNyMqLcRWuiQopaXDlsw/BIgzeNhCQUM88cj5Oxm4cHuLh+f03m9ba esLiRQj6euPp49BTDvimev1rR9o39SjeQ17PYcI53d049b7NrECF/EHyKIiT6jWUrHRX KGZ2niADvBWyUZVYajNCwW73WBuzJLRq9UosRmpXst1Y0886jhHU3RugCXYa2BOqDn5S U2vzfbkUFNOMOkbLwlUHI6rNPJiMDESWSXHgfsKV5HQiz7Moua4apY/cnsYgZdG1LRiI Ta+Q== X-Gm-Message-State: AOAM532q/hXEV7ASwkVBZtG9CyVU0ONGVWxZF3VoGUdtsWQ09xnV98Xq OktKlXTq9xpj7fpvzBzZir0U4kHIsYAFI8yRY4asQDYP4ByKvbNs0bn34Xulq3n6+EvE7iCDZv7 6yQjtJnJj2p+nPf7NFVFpwV3v1F3VvBakJbCOjI6V4g== X-Received: by 2002:a05:6402:4391:b0:427:f2f0:607b with SMTP id o17-20020a056402439100b00427f2f0607bmr17832839edc.45.1652106309340; Mon, 09 May 2022 07:25:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPgg83PsxZBI4uk5sFJjybUDGFKs68DoFEdmgoSB/thhPafcy5IPbyGCS+vhDpo2M6XkSH8Q== X-Received: by 2002:a05:6402:4391:b0:427:f2f0:607b with SMTP id o17-20020a056402439100b00427f2f0607bmr17832824edc.45.1652106309142; Mon, 09 May 2022 07:25:09 -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.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 07:25:08 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable][PATCH v2 3/3] UBUNTU: [Packaging] Add module-signature-check Date: Mon, 9 May 2022 16:25:04 +0200 Message-Id: <20220509142504.493925-4-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 Check the signature of staging modules during package build. Signed-off-by: Juerg Haefliger --- debian/rules.d/4-checks.mk | 10 +++- debian/scripts/module-signature-check | 67 +++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100755 debian/scripts/module-signature-check diff --git a/debian/rules.d/4-checks.mk b/debian/rules.d/4-checks.mk index d85de43adffc..ecc6b82aeab5 100644 --- a/debian/rules.d/4-checks.mk +++ b/debian/rules.d/4-checks.mk @@ -10,13 +10,21 @@ module-check-%: $(stampdir)/stamp-install-% $(DROOT)/scripts/module-check "$*" \ "$(prev_abidir)" "$(abidir)" $(skipmodule) +# Check the signature of staging modules +module-signature-check-%: $(stampdir)/stamp-install-% + @echo Debug: $@ + $(DROOT)/scripts/module-signature-check "$*" \ + "$(DROOT)/$(mods_pkg_name)-$*" \ + "$(DROOT)/$(mods_extra_pkg_name)-$*" \ + "$(DROOT)/signature-inclusion" + # Check the reptoline jmp/call functions against the last release. retpoline-check-%: $(stampdir)/stamp-install-% @echo Debug: $@ $(SHELL) $(DROOT)/scripts/retpoline-check "$*" \ "$(prev_abidir)" "$(abidir)" "$(skipretpoline)" "$(builddir)/build-$*" -checks-%: module-check-% abi-check-% retpoline-check-% +checks-%: module-check-% module-signature-check-% abi-check-% retpoline-check-% @echo Debug: $@ # Check the config against the known options list. diff --git a/debian/scripts/module-signature-check b/debian/scripts/module-signature-check new file mode 100755 index 000000000000..f28f4a89c913 --- /dev/null +++ b/debian/scripts/module-signature-check @@ -0,0 +1,67 @@ +#!/bin/bash -eu + +flavor="${1}" +mods_dir="${2}" +mods_extra_dir="${3}" +sig_inc="${4}" + +echo "II: Checking signature of staging modules for ${flavor}..." + +if [ -f "${sig_inc}" ] ; then + echo "II: Use signature inclusion file:" + echo " ${sig_inc}" + sig_all=0 +else + echo "WW: Signature inclusion file missing:" + echo " ${sig_inc}" + echo "II: All modules must be signed" + sig_all=1 +fi + +if ! [ -d "${mods_dir}" ] ; then + echo "EE: Modules directory missing:" + echo " ${mods_dir}" + exit 1 +fi + +echo "II: Checking modules directory:" +echo " ${mods_dir}" +mods_dirs=("${mods_dir}") + +if [ -d "${mods_extra_dir}" ] ; then + echo " ${mods_extra_dir}" + mods_dirs+=("${mods_extra_dir}") +fi + +pass=0 +fail=0 +while IFS= read -r mod ; do + is=0 + if /sbin/modinfo "${mod}" | grep -q "^signature:" ; then + # Module is signed + is=1 + fi + + must=0 + if [ ${sig_all} -eq 1 ] || grep -qFx "${mod##*/}" "${sig_inc}" ; then + # Module must be signed + must=1 + fi + + case "${is}${must}" in + 00) echo " PASS (unsigned) : ${mod##*/}" ; pass=$((pass + 1)) ;; + 01) echo " FAIL (unsigned) : ${mod##*/}" ; fail=$((fail + 1)) ;; + 10) echo " FAIL (signed) : ${mod##*/}" ; fail=$((fail + 1)) ;; + 11) echo " PASS (signed) : ${mod##*/}" ; pass=$((pass + 1)) ;; + esac +done < <(find "${mods_dirs[@]}" -path '*/drivers/staging/*.ko' | sort) + +echo "II: Checked $((pass + fail)) modules : ${pass} PASS, ${fail} FAIL" + +if [ ${fail} -eq 0 ] ; then + echo "II: Done" + exit 0 +else + echo "EE: Modules signature failures" + exit 1 +fi