From patchwork Thu Oct 24 13:05:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 2001717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ5l130G1z1xxC for ; Fri, 25 Oct 2024 00:06:05 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1t3xXH-00024p-UC; Thu, 24 Oct 2024 13:05:55 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1t3xXG-00023J-IC for kernel-team@lists.ubuntu.com; Thu, 24 Oct 2024 13:05:54 +0000 Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (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 4F5123F287 for ; Thu, 24 Oct 2024 13:05:54 +0000 (UTC) Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2fc969f6e27so6330071fa.3 for ; Thu, 24 Oct 2024 06:05:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729775153; x=1730379953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RsGWa0XDxE7Q/rZMrR7e/C+CuM/GjiRqieTa00sGonw=; b=Be8ggQCK9Xd219WDhdDOLM3tMwj6Rx4+9tmVjJwzq17r78cEpGTYUmzYM0VA00Zr3d +euFtW5P1BFOGw1EjYiMSesoOg6z+jBhL8logNiCbUO6L0ghMwmQdGKdSbHGhugT5I5k i2Pc6hA30DOo1xdDJn3zRCjaUmLJXsfYGZftB8FIU4U1707SOX8A/JlOnPJb4Uke1fye cvXZFIWyT8raRCbQU+l5mBlz1fFlQSyy12Vo7/snKgOJt55e4MAnxoTtGHtTTDVUooY3 1c+pUC0xxNADdchUsNZa/arg1njda2RNdETgO1Sbr+wjygbIMuvYlTrJ4kPsAbh/k0LV /3Lw== X-Gm-Message-State: AOJu0YyJLgDUOpfKF+Djcx2QhvxNx8266cSseEALXO+R8fXLxufpUo12 huQYcLy2uHvhIKTmJhuo2lDA2rd+EQHZ3/lW4BFYR/oVWp9QlqGrIQzcSza2kIK2A676EF6Myon 8M25buNU+vFwHiHAJDuDwF3ZNzO1zkaZtgI8kNRuevIwRRPfT3en/Gyn/2d3I601Nb57GZqTuh7 4CMfASCobUXw== X-Received: by 2002:a05:6512:3053:b0:539:f7a2:65ac with SMTP id 2adb3069b0e04-53b23e25304mr1188430e87.35.1729775153538; Thu, 24 Oct 2024 06:05:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeLXnVVVqNs5HDp6HPzYMCnNAh8vVqcMfgBWrqppYzb3tjKjVjD0vUUAwofuhS+sCuHm120g== X-Received: by 2002:a05:6512:3053:b0:539:f7a2:65ac with SMTP id 2adb3069b0e04-53b23e25304mr1188400e87.35.1729775152849; Thu, 24 Oct 2024 06:05:52 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4317d03b8b4sm70456375e9.0.2024.10.24.06.05.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 06:05:52 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable][PATCH 2/2] UBUNTU: [Packaging] Add list of used source files to buildinfo package Date: Thu, 24 Oct 2024 15:05:47 +0200 Message-ID: <20241024130547.1591256-3-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024130547.1591256-1-juerg.haefliger@canonical.com> References: <20241024130547.1591256-1-juerg.haefliger@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" For CVE triaging, it's helpful to have a list of all the kernel source files used for a particular build. Generate the list and add it to the buildinfo package. Signed-off-by: Juerg Haefliger --- debian.master/control.stub.in | 1 + debian/rules.d/2-binary-arch.mk | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in index 81730f7a22a4..744dce7bb70e 100644 --- a/debian.master/control.stub.in +++ b/debian.master/control.stub.in @@ -16,6 +16,7 @@ Build-Depends: debhelper-compat (= 10), default-jdk-headless , dkms , + dwarfdump , flex , gawk , java-common , diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index d825644602f7..435c70df686f 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -43,6 +43,14 @@ ifeq ($(do_dbgsym_package),true) $(kmake) O=$(builddir)/build-$* $(conc_level) scripts_gdb ; \ fi endif + + # Collect the list of kernel source files used for this build. Need to do this early + # before modules are stripped. Fail if the resulting file is empty. + find $(builddir)/build-$* -name vmlinux -o -name \*.ko -exec dwarfdump -i {} \; | \ + grep -E 'DW_AT_(call|decl)_file' | sed -n 's|.*\s/|/|p' | sort -u > \ + $(builddir)/build-$*/sources.list + test -s $(builddir)/build-$*/sources.list + $(stamp) define build_dkms_sign = @@ -479,6 +487,8 @@ endif fi install -m644 $(DROOT)/canonical-certs.pem $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/canonical-certs.pem install -m644 $(DROOT)/canonical-revoked-certs.pem $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/canonical-revoked-certs.pem + # List of source files used for this build + install -m644 $(builddir)/build-$*/sources.list $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/sources # Get rid of .o and .cmd artifacts in headers find $(hdrdir) -name \*.o -or -name \*.cmd -exec rm -f {} \;