Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2337804lqo; Mon, 13 May 2024 15:40:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHsdQgvWWmnlzvl8hFaZX3iV7Fuec6XbHcQKoc9lNNYmzrWHtqiFzxgzEe6m0mhemuu6BeFlVIupwO8j0eAX5P2FA9l/yr+k0FhyPJXg== X-Google-Smtp-Source: AGHT+IFfd+GgxUFMjfHUp7hvk/MlGg2wF0RS8a/XcNCaeqefDwcKVo4qA6zcz3YZMj3peMDIKFVX X-Received: by 2002:a17:90a:4418:b0:2b2:9456:1fa2 with SMTP id 98e67ed59e1d1-2b6ccd8debbmr8157943a91.44.1715640015259; Mon, 13 May 2024 15:40:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715640015; cv=pass; d=google.com; s=arc-20160816; b=tk+r3MEMH26ckj96VAm5XfkhsttAONS4gkEgSd8cU9WzTYGu5g4rqZgMMeepws7akN tpxtSrCWBgJ5m33Osph0M9mOJY2BRmBffHrIqhQWHI5jlFT4yUElLXSoJLqoICcLkijp dn40D6K5UfIhf4zNrk/HB0dLcW97tBQXopo8VYju0LkTBY8lInoxQMtQ24NuwTaKC2e8 aJ6DECyHEFJoCcwNm+dvftxo0JhYanNs0OINajcmS7OeTnBY1u8/Z7I3MwcS89DkTIAS A0yRy1uDw1DmE5qfUfJPQ9ZtbhBYtnmWCJUtpJgtmoTn/fEgppFt5Ycf5lRrWLUnVayb gy0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=lDU1Ng8TWUtDxaw/RakO06hRasPavlzQcHKZN28JJLM=; fh=evf36h5QxffvzKds9gi4mClig59zvsoI2Eo1konX1ds=; b=rEEWgHOsKwODR64APPc/qlB9KfAMNX7gwSz3Z0R2uw91iri6AQRfgOeNdJm4vsEb1Q 9Q0zvzwOHO1ogJwPMkBpBAZe29Brt3lV0RvMczdEqQoKHeU9SchOPMUiWBnJMss5TfH1 KcSTukzO09ryyWX4nf64zrAWd8a8OLfGuomKxs1V9PqLqRcDAURr+u8HYPzDPE83nDUc xRc27cf1JKuMnekYyK1F31qXYh0zf2I2Bg7FANOZg+FeVC+LQa0TD2heACBVb59Vx3Vh 0pE3MXlm9UhpXQLE8YWVnSagmvByXREFrPW5+xy1P7FDNSlqHE8hWHY5nL7g5tyL36Wk epgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eROTGHQI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340a06dc6esi10035442a12.42.2024.05.13.15.40.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 15:40:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eROTGHQI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D8925281821 for ; Mon, 13 May 2024 22:40:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3A1F84DF3; Mon, 13 May 2024 22:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eROTGHQI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B498053E30; Mon, 13 May 2024 22:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715640008; cv=none; b=Nu8+mucn9dqBq37FKKfLlMQMo943Bu2xolDmow9wtZeyjpQJkTmfuuQBZYz27KIfUAGUs7IprO0bewoVUY5uBGeVfQVGRtinFheLOk62iVWPgk2+pxSXtCU/m7aK1/+mupjC+9UkVmRpaumrHb6EoZ2MVWm3AB69ykSZUcRpwtw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715640008; c=relaxed/simple; bh=x/Nx1D89T1lHlU5B5CqZ/p8dOgkTvhf1i6pKCzFa02k=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=m0XVc1la8nwsBJUyFnR/M6790IQsjjbjKETfAQYFWclzXQ/3tNPy9pmkqBYCHJy7kqrK3/PXrrXuxsNaIk3pZNV+W5abTfUuSLDNavBIJRcZ+FPW6O0wvBPD212LUZrapdCCEK35zg/A0m4jjBgT6AbKJCiMj50Zn+edFdH15B8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eROTGHQI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AC92C4AF09; Mon, 13 May 2024 22:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715640008; bh=x/Nx1D89T1lHlU5B5CqZ/p8dOgkTvhf1i6pKCzFa02k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eROTGHQIRn/ruz3M/3Z51w7eviTp1FSvYe3lW2x9/oR/a3Z5Isxj1Z9guaGMWAp2+ zfDLKe9ysI4+bY/XJHjj0YK9k6wEEAa7QUh8BtQrfTvxGYFOCiCUUY+vHbDHLTQjWH ASOG4RUDXnuwmBYEW0aErhsPf4zrqDIjqgK/NdceGDsCJiEuemskHrRTmb1i+U/AYB WToNfHl4haQcCjwGrnF4Q2PRIH1D+80qVAbjRENSrvyRR4K+HGhAXMj3mkLoYDd4p3 cT+sN1+5vp9nSXPSQ1CE9SH0LaotGQr6ZIlXFVteQIwbTEfE8X8aBe+zjIdafIiGgz HxQ4ChTteGBxg== Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-51f1bf83f06so6113414e87.1; Mon, 13 May 2024 15:40:08 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCU6Toda41xdG9KxX9gROtvXXcQb24I/KplU/XYp1CmbejPafHqMod+VYNAX51baxpdVjMnZ3OI0qxggM/3BHPVrzUPiUaHfjJ/j/nvVSGwQSxTASZWc2JT6aFQO3+xQktN0mTG9f0B5Luvg5Xy3X7VKrurT2hgNT3YkKKgV3mJzs33oDBTRhBJpMw== X-Gm-Message-State: AOJu0YzGsHVmFO4Xm+Noa1KwWZDZm1J5Xm1JTEMKm0dxjfnKZwlADysf K5MqMEBVZnIrr/7QTnBx9cJWfu06lDKbn6+R2sR1NDNEKdU9kS796d6Axm844CUl+jn6onFpVVQ bICKtQd9R8hEh4Ne6qBSXdc5QX6o= X-Received: by 2002:a05:6512:6c7:b0:522:2dd4:bb30 with SMTP id 2adb3069b0e04-5222dd4bba8mr6686133e87.54.1715640007187; Mon, 13 May 2024 15:40:07 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240506133544.2861555-1-masahiroy@kernel.org> <202405131136.73E766AA8@keescook> In-Reply-To: <202405131136.73E766AA8@keescook> From: Masahiro Yamada Date: Tue, 14 May 2024 07:39:31 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/3] kbuild: remove many tool coverage variables To: Kees Cook Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Josh Poimboeuf , Peter Zijlstra , Peter Oberparleiter , Roberto Sassu , Johannes Berg , kasan-dev@googlegroups.com, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 14, 2024 at 3:48=E2=80=AFAM Kees Cook w= rote: > > In the future can you CC the various maintainers of the affected > tooling? :) Sorry, I was too lazy to add CC for treewide changes like this. Anyway, thanks for adding CC. > On Mon, May 06, 2024 at 10:35:41PM +0900, Masahiro Yamada wrote: > > > > This patch set removes many instances of the following variables: > > > > - OBJECT_FILES_NON_STANDARD > > - KASAN_SANITIZE > > - UBSAN_SANITIZE > > - KCSAN_SANITIZE > > - KMSAN_SANITIZE > > - GCOV_PROFILE > > - KCOV_INSTRUMENT > > > > Such tools are intended only for kernel space objects, most of which > > are listed in obj-y, lib-y, or obj-m. > > This is a reasonable assertion, and the changes really simplify things > now and into the future. Thanks for finding such a clean solution! I > note that it also immediately fixes the issue noticed and fixed here: > https://lore.kernel.org/all/20240513122754.1282833-1-roberto.sassu@huawei= cloud.com/ > > > The best guess is, objects in $(obj-y), $(lib-y), $(obj-m) can opt in > > such tools. Otherwise, not. > > > > This works in most places. > > I am worried about the use of "guess" and "most", though. :) Before, we > had some clear opt-out situations, and now it's more of a side-effect. I > think this is okay, but I'd really like to know more about your testing. - defconfig for arc, hexagon, loongarch, microblaze, sh, xtensa - allmodconfig for the other architectures (IIRC, allmodconfig failed for the first case, for reasons unrelated to this patch set, so I used defconfig instead. I do not remember what errors I observed) I checked the diff of .*.cmd files. > > It seems like you did build testing comparing build flags, since you > call out some of the explicit changes in patch 2, quoting: > > > - include arch/mips/vdso/vdso-image.o into UBSAN, GCOV, KCOV > > - include arch/sparc/vdso/vdso-image-*.o into UBSAN > > - include arch/sparc/vdso/vma.o into UBSAN > > - include arch/x86/entry/vdso/extable.o into KASAN, KCSAN, UBSAN, GCOV= , KCOV > > - include arch/x86/entry/vdso/vdso-image-*.o into KASAN, KCSAN, UBSAN,= GCOV, KCOV > > - include arch/x86/entry/vdso/vdso32-setup.o into KASAN, KCSAN, UBSAN,= GCOV, KCOV > > - include arch/x86/entry/vdso/vma.o into GCOV, KCOV > > - include arch/x86/um/vdso/vma.o into KASAN, GCOV, KCOV > > I would agree that these cases are all likely desirable. > > Did you find any cases where you found that instrumentation was _removed_ > where not expected? See the commit log of 1/3. > Note: > > The coverage for some objects will be changed: > > - exclude .vmlinux.export.o from UBSAN, KCOV > - exclude arch/csky/kernel/vdso/vgettimeofday.o from UBSAN > - exclude arch/parisc/kernel/vdso32/vdso32.so from UBSAN > - exclude arch/parisc/kernel/vdso64/vdso64.so from UBSAN > - exclude arch/x86/um/vdso/um_vdso.o from UBSAN > - exclude drivers/misc/lkdtm/rodata.o from UBSAN, KCOV > - exclude init/version-timestamp.o from UBSAN, KCOV > - exclude lib/test_fortify/*.o from all santizers and profilers > > I believe these are positive effects. --=20 Best Regards Masahiro Yamada