Received: by 2002:a05:6a10:8a4f:0:0:0:0 with SMTP id dn15csp2601120pxb; Mon, 31 Jan 2022 03:41:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7O/WZxAnEm8frb+gfHzyHz87DZm8IBc6pJLhsRwiDjJPXYiiWLD61gkS/4iNe59+wVdoe X-Received: by 2002:a17:902:eb4d:: with SMTP id i13mr19842682pli.111.1643629282921; Mon, 31 Jan 2022 03:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643629282; cv=none; d=google.com; s=arc-20160816; b=yc3eXZonayoukHgU93Igsr3562jbSzrh5lpM+IM0PGBVfgtpU6hafsWlo6X+blrXyH iFc9nQpCd0EtOfFQpxJhV+LBtoMbTbVeZDsoSptsbpBetYaItL8KK1DSHlsXzYl0/r9r ut8WyB9A51JNZshglJaSzN5BJruQljsB/pmX4gWImTxKdpB+mlvJGYsrt3398LdF24Lj C5Ts7YyF7Fc92c0FXNI/zgBKvQviTOR7ZgskA/R1LWdSVBcTsy4OZQiAgpdhpXLoHRTH RACLoC3hGu/uiW2QPD6rnq0QhIUScrkS0Bf5wvWaNUFs5zedXGR0ZzY87Fm0hQgxrnLs nsKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3wXlxO8ivxh19lX0NUWVIj5SKVX6xM1bt7/6ivcawkI=; b=YygzO5Dr7k88xPjxgczLx/Z/KcBC9UoKlXoQmXm0VhmmxJhenuHWEECAUB2V7dN9Qj so/jhWY8Oq5sh/MYY1tVa91D8Uk8puE0WV2a5YsJ77khniDM8oASyGolqS+l/6+Mlw4m nVp9ub/Ma8zQDDWnKAQicX4lT27UMovDDoWeDcE2PQgnU8G6goIsmoU0wAsAvUUNiHsg QzKtYHCoicpLmgIEYP4n6ZMc0XzTavuMeBNwFYhghfYY+AAOngcfvvsfySdSg/6B3a4G FPAySAmqrvB5uZRiN5V/hLSzdDPk7DbzJ+mTwjpoMVpsiMM55Wmd+ZwgGdsI9r0AxyLT tdpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oaKziv6v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j72si7156910pge.589.2022.01.31.03.41.12; Mon, 31 Jan 2022 03:41:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oaKziv6v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349039AbiA1Vlj (ORCPT + 99 others); Fri, 28 Jan 2022 16:41:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238634AbiA1Vle (ORCPT ); Fri, 28 Jan 2022 16:41:34 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F240C061714 for ; Fri, 28 Jan 2022 13:41:34 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id oa14-20020a17090b1bce00b001b61aed4a03so6268657pjb.5 for ; Fri, 28 Jan 2022 13:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3wXlxO8ivxh19lX0NUWVIj5SKVX6xM1bt7/6ivcawkI=; b=oaKziv6vTJhWuDvXhdfjGZVLHKZ7L83vnVgyfI1+9l/jD7sXBS4r7CUk8PrAOaF54E epgiy7APhyZWhgKMr/MBLD6P2x6Cmj0RNCqWb0nXyoqbATE91TzVh02Lr6uOrCV85QGS Lr2dE/lBl5NP+xz5eIbm4Pk5LJNr4MpcOFPOk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3wXlxO8ivxh19lX0NUWVIj5SKVX6xM1bt7/6ivcawkI=; b=vpvKyKznV8XppIr3eUt4Qlwmlg1kNIBlT+XP2bBwIz+O+lpy4yXRnjURm5sLCeneZc SbfkA+tOvrhVOBLEmaGv2SaKMqZjKJHgPuI+uqfqCtODgow17uittzaMU4yxeQD7rmNy FStWF2gQLNF7qX2MbTRSxl114fnCNNMlWAL+E2tt2HyHjOemPZ+ofNJKm9/tHQlrwbnI klq78yOXYW4lKxsIczolaQTeOnRku5sx0uaxHQBa+OV+UanL5B550sdn3x8hxldo7Rcd 0bdDLicP2d24d5pq4iL1aZfTjZ3NnCANck+Xy//EOCSKzTbjIzr8kYD/YIH77WLBwqVo Lwcg== X-Gm-Message-State: AOAM531RZOKORIB2brDwTK9p2FC2QpSbz4Ek/7K6MMU9Eh6ecAngehXG i7ZnU4wHpTocFHw52mWrliyLDg== X-Received: by 2002:a17:902:a5c1:: with SMTP id t1mr10890722plq.106.1643406093578; Fri, 28 Jan 2022 13:41:33 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id rj1sm3460112pjb.49.2022.01.28.13.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 13:41:33 -0800 (PST) From: Kees Cook To: Andrew Morton Cc: Kees Cook , Nathan Chancellor , Masahiro Yamada , Nick Desaulniers , Miguel Ojeda , Peter Zijlstra , Tetsuo Handa , Isabella Basso , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH] Kconfig.debug: Make DEBUG_INFO always default=n Date: Fri, 28 Jan 2022 13:41:31 -0800 Message-Id: <20220128214131.580131-1-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2150; h=from:subject; bh=s9N1b3JvxLd7oL7UEPREgGNdTUKoGAUWw3SiLd7haIE=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBh9GMLirleATojwN3w57Xd5078WAD6SduT1rPt5nHf EBZlc2+JAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYfRjCwAKCRCJcvTf3G3AJl31D/ 9ft+lnP5M4ywaWKG9O5qM3gN9sPC7U6rj3pBTCI3T9DcMj+hNqsExa3v9nqxtx35MG+vmzfqhSisa0 ouiA9NrfacD8srxm+etJSmTPdjxu8x4XuesC/avRPeuazGXTwm1W0kizYnBXLjbT6ZNoFJ/TGQKqfI 5fZWRb407xFVfYmcdcCRmsU8z40c0XaTXD/pSbXWHK4dZsy9sYeJPkFBy2btTFB/WVBYBxpoX9yzM8 0CqjseXHvuYkxfjAqYMhJWozZEW9OBHmNjDT43exDBNwfHOo+viIc8cRQbFYGFcW2YEs15G7C5/qQH IMyxcmYIFoiZIkrEDYosigQExBoVIEXg8v+76M+B1GVcyt9Wp3mCoxqOmGOP3PBL4AIkPzoI9IPVvJ O0UP/nWg3Slu8guiRmGSQsIADBMSFjWKzy3K9f55THnW6SOyjO8OPkZGsV550X90RlDh63try++a38 19MJTobH+EGJJHCBTiERWwKnCa+wuvwYY19T4wRZVrOHFuRHsUDiyA8tuD2xsStAsJZhfRv9wg5hYG HpbrRozX/XPcOtqscWXqbDCKUETeHBgZczVz2wrEf8mt7zMjEcNT+OUKoOr4Xdw2km2tfySmAPDTQG IbUks5MlGWA0d0D+uQR5/R6svXYL3b6Zh1nXThDJFyGPyLMggEjEIu+KkHeA== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While trying to make sure CONFIG_DEBUG_INFO wasn't set for COMPILE_TEST, I ordered the choices incorrectly to retain the prior default=n state. Move DEBUG_INFO_NONE to the top so that the default choice is disabled, and remove the "if COMPILE_TEST" as it is now redundant. Reported-by: Nathan Chancellor Link: https://lore.kernel.org/lkml/YfRY6+CaQxX7O8vF@dev-arch.archlinux-ax161 Cc: Andrew Morton Cc: Masahiro Yamada Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Miguel Ojeda Signed-off-by: Kees Cook --- Andrew, this is a fix for kconfigdebug-make-debug_info-selectable-from-a-choice.patch --- lib/Kconfig.debug | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index a7b657d67318..a1262358d55a 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -234,7 +234,6 @@ config DEBUG_INFO choice prompt "Debug information" depends on DEBUG_KERNEL - default DEBUG_INFO_NONE if COMPILE_TEST help Selecting something other than "None" results in a kernel image that will include debugging info resulting in a larger kernel image. @@ -245,6 +244,12 @@ choice Choose which version of DWARF debug info to emit. If unsure, select "Toolchain default". +config DEBUG_INFO_NONE + bool "Disable debug information" + help + Do not build the kernel with debugging information, which will + result in a faster and smaller build. + config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT bool "Rely on the toolchain's implicit default DWARF version" select DEBUG_INFO @@ -283,12 +288,6 @@ config DEBUG_INFO_DWARF5 config if they rely on tooling that has not yet been updated to support DWARF Version 5. -config DEBUG_INFO_NONE - bool "Disable debug information" - help - Do not build the kernel with debugging information, which will - result in a faster and smaller build. - endchoice # "Debug information" if DEBUG_INFO -- 2.30.2