Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp194865ybl; Tue, 28 Jan 2020 01:18:34 -0800 (PST) X-Google-Smtp-Source: APXvYqw4JvDwR/8j1MmqCrM8w5FFoNfmAp0oIBldLNGtyYKfVxU1z76mBkvL5R+0zfEj8dj0avXY X-Received: by 2002:a9d:53c2:: with SMTP id i2mr14518172oth.43.1580203114707; Tue, 28 Jan 2020 01:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580203114; cv=none; d=google.com; s=arc-20160816; b=ZAcWEFS3ELKausO30hc5HJJyYOq7Xm3bEB72vmSsdr1l7CKrneQY1K+GHCs2dgBPRc eIumiMQmXawnE5OOKrCvtKFxTND7Sm0MUWvDadTeXOYTKlNB1GTbQvCipPQM5lYXhtc4 OvtXdqhM8mj295qVWnWEKYoyyNZBoQA5Fa2sKQy6dZ6WevCw9BtYPUFYuWDJ+zHZhmoW CFkoRrD/n9vmqAzHuDhU2cpmUxbmHX3E/C0eWA/u1Lle0Fr1GnJIhtji2YtH93C/H1z/ 9z9nNTT89afiYUPklCLI1v+s7coxD1yGlaYNLCU03ilh/CHhQK6sUhwlyc72jr/miu21 F+5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/eguvHwOu0sO1sY9Y2sGUaUw1z+hAiiwi7HS5TszeM0=; b=clc9nCiU1ThFfQRVeV+p9R7pPnYmVBLTX1cO61v07qZki4RnZsIwJT2XwoSqRhfqTL KzyWIr88AJ3e5+57p3VX7bmDLbtTfRa4VBQsmnsjZMXwP6QPO9cZxKlAbpDt7KYolNzR xC60qzpB2ytBgk1P5dtXp3cCD7JSVkYxDd+rbzeBOBTWomepE7lXaMTZ6b/jQ20AOFgu OKZI1zjpSi0yIob1zsexx58dxrfe7RhOxOnuA0D+TYaPXTZzo8F5dENso6C6TY8cISvX ermzSqN5SOrEDfVYICNLTJKHtNWiUeL1Xyb/66aR8zsYuGQ3xVA+mF13Q8+aM8Z4NXXb mvmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dv17cOT0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si8002066otl.213.2020.01.28.01.18.22; Tue, 28 Jan 2020 01:18:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dv17cOT0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725919AbgA1JRY (ORCPT + 99 others); Tue, 28 Jan 2020 04:17:24 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36933 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbgA1JRY (ORCPT ); Tue, 28 Jan 2020 04:17:24 -0500 Received: by mail-wr1-f66.google.com with SMTP id w15so15131001wru.4 for ; Tue, 28 Jan 2020 01:17:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/eguvHwOu0sO1sY9Y2sGUaUw1z+hAiiwi7HS5TszeM0=; b=dv17cOT0ZvLsFiZ0yr19WQNg2zQBv0lDkp9UA7o/+y3XapJI+0ZYTgo1dbErZaZkI+ VrtRoHSf7fPZX9AWCfQzGVqgL9EAuEBlB6i7HvsuqsCnHRWJuNNVzZyRxwgyp2FmPVho iFppSCBqiKHitwA6onSMY3z5RpDrNdMnxU15dXUTYM8xvoWUhhwKbjywt+TkbGN0YeMD M91dazJWXfRdPk/Q/Gn9y31TrOaoJhmzBFpY/fdbKC9GQCG4ON5AJ7lEP4+lM87TSTnK wuL8JxVTOoq0uDzlXO4dfd3FwW07HCMcNZnOdzlJZVYuUb67qj6Ho/HPEiR8FrAWjPkT iHaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/eguvHwOu0sO1sY9Y2sGUaUw1z+hAiiwi7HS5TszeM0=; b=mewM0dT7/cLGTBSF7bim+57oucBFbomwbj1RZraCP7xqn6kmJOjykAWAnpYz88UpmL YDKeta1EmFGKNhyUoiB+JEjoPJ6CoIe8Q+IJrHeX36bbXGmzCPHszcDOJz20Ku1QaeX3 tYyNlURU1d7aicRq3JVI9dr/xSvi4EAtdFiy2esCzFlo4gSUNkKDmEX72XRFwXRF0vmL WLu/qP2CQFqmRvleRs4cS1ZwvqevgTV+ZomOpZhiQ/Iuriy/A4lR+FvdpwjyWZuTGeO+ AmDFpCCBEHcK3DuV7YOsZXpFUZrLHvQ9GkkYnzv5rcMpZ4So5+Lj1ux2/I5qKguBbaPr vd5A== X-Gm-Message-State: APjAAAU9pzqJV1H8FcavtJr64/ok3rLVxQx1uniy1F4SbUWRTXQXiQet lqPMsBmGZwWsAkFUrRXFLWrZpSFavAkJddwxfByvnQ== X-Received: by 2002:a5d:50cb:: with SMTP id f11mr1884084wrt.252.1580203042186; Tue, 28 Jan 2020 01:17:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Tue, 28 Jan 2020 10:17:11 +0100 Message-ID: Subject: Re: mmotm 2020-01-23-21-12 uploaded (efi) To: Dmitry Vyukov Cc: Qian Cai , Randy Dunlap , Andrew Morton , Mark Brown , linux-fsdevel , Linux Kernel Mailing List , Linux-MM , Linux-Next Mailing List , Michal Hocko , mm-commits@vger.kernel.org, Stephen Rothwell , Ard Biesheuvel , linux-efi , kasan-dev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Jan 2020 at 10:08, Dmitry Vyukov wrote: > > On Tue, Jan 28, 2020 at 8:33 AM Ard Biesheuvel > wrote: > > > > > Should be fixed by > > > > > > > > > > https://lore.kernel.org/linux-efi/20200121093912.5246-1-ardb@kernel.org/ > > > > > > > > Cc kasan-devel@ > > > > > > > > If everyone has to disable KASAN for the whole subdirectories like this, I am worried about we are losing testing coverage fairly quickly. Is there a bug in compiler? > > > > > > My understanding is that this is invalid C code in the first place, > > > no? It just happened to compile with some compilers, some options and > > > probably only with high optimization level. > > > > No, this is not true. The whole point of favoring IS_ENABLED(...) over > > #ifdef ... has always been that the code remains visible to the > > compiler, regardless of whether the option is selected or not, but > > that it gets optimized away entirely. The linker errors prove that > > there is dead code remaining in the object files, which means we can > > no longer rely on IS_ENABLED() to work as intended. > > I agree that exposing more code to compiler is good, I prefer to do it > as well. But I don't see how this proves anything wrt this particular > code being invalid C. Called functions still need to be defined. There > is no notion of dead code in C. Yes, this highly depends on compiler, > options, optimization level, etc. Some combinations may work, some > won't. E.g. my compiler compiles it just fine (clang 10) without > disabling instrumentation... what does it prove? I don't know. > > To clarify: I completely don't object to patching this case in gcc > with -O2, it just may be hard to find anybody willing to do this work > if we are talking about fixing compilation of invalid code. > I don't mind simply disabling KASAN altogether for this code if nobody can be bothered to fix the compiler.