Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7412254ybl; Wed, 15 Jan 2020 22:29:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwUJR98bxXyOQUtaiLxOdT8pKcvglKuYptVzPMcho1YAdX+Jm81NMYaMs4l3R8/zk3Ku+KK X-Received: by 2002:a9d:7f83:: with SMTP id t3mr768604otp.115.1579156156442; Wed, 15 Jan 2020 22:29:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579156156; cv=none; d=google.com; s=arc-20160816; b=Z/Sv1k5XRrEjowB52hRSoCLt0e1rlwgetzAlWK5xdWTAjOuOH3w12ms0xLXnsWiEIG /rOI0vQ8vnqtIo3+69Sb3L+Je1kQBxuujPghBipb9R4MYvlYsK1H62t8TF3HxzSU/pSI W7Pc8hrcrMEYtlp5P3QXgMfYJH0ZaAmaPRSHnrybzK/G4p4bH+LS2l6xbMALEClSf1H4 7rKE6E1aCJEYL7BJ3qmdyzV8U1VRc6cd004Tv0i4hy5BfY7vW8r1ygzDoucjb/KxZHm0 eGz3+AFvvokg8Ah1kg7v/7yo3b9+LCQ1vwmPofVk/WR+fY5jlH9sB5Pqq9uFCIE6aknh I2VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=OjhLrwSUixWKfHPYVjag4pJ4Twky6Gk6dHImQohRolQ=; b=Vw6+aiaPhRZwdTyYJaJvdvBcAvZ1owjDZFLXNH7GN4B2rBnEbwnrdaz2vIojO5FMJP fVmVWXpJFKhCroErbwc5PRdc+dWOlYTqHxF2AcPlN73k6Fi7zedAhSXfyU+sz8UVazBm 51vNzIWX/4PZbKMfS/0d3Y7mVNsKjJ+ixyEBjVamX5cXF/bBbiAdMxv6oMFTESngM4Oa gkXCKqVeLlUcpcwyn+N3CFtyAwiDPIMs7z1yRMYuBLwQ2dSbPkxp1DNNO/kIsCUoartg gUPQYPWxVyJ3Xfjq9zx9ToJ5AMI8OXKJVSKRZ3EDzTUzh4NKYOL0ILNJdxrEiMbBtjtN Wrdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=ZgcbuRsf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si10558100oij.136.2020.01.15.22.29.04; Wed, 15 Jan 2020 22:29:16 -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=@axtens.net header.s=google header.b=ZgcbuRsf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726406AbgAPFe2 (ORCPT + 99 others); Thu, 16 Jan 2020 00:34:28 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42061 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbgAPFe2 (ORCPT ); Thu, 16 Jan 2020 00:34:28 -0500 Received: by mail-pf1-f194.google.com with SMTP id 4so9648401pfz.9 for ; Wed, 15 Jan 2020 21:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=OjhLrwSUixWKfHPYVjag4pJ4Twky6Gk6dHImQohRolQ=; b=ZgcbuRsf2JHWAKem4b8L9QCIstpEILQ+LtgpSvVyEIFmuJkHkq4wV3UhW+NB3I/p7L g8PhhD9MkXc8GNcgMLwPiGkXbVvTxOXXqfpvUxWGjbrkeerRAqqt7CgHVi3clSMsX94r 2eu6s/C0/gJJDbr9MjhIhO6KsPExdslbKPn1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=OjhLrwSUixWKfHPYVjag4pJ4Twky6Gk6dHImQohRolQ=; b=LX4If+iq320QcGq751gOgYkUcQNAdeqd8H7ls4djDnZP/2wU6ZAPO55EGpN722b9P3 qDc1U7V2dELSGMnSp5rJHke3IWxToo1ETaZZc7A+DKCPyJXg/YPy+8S9XDcPTfzKw1uw PevVih2yahiT+cX7Bnbsroy43ZCav/Xst/2zj6lSAHSqwPTBY/vYxg3uCPidvxqh1t1T UhmZ1Mx41ZYFEYAKbF48wHRkOlar44PSRxGyysZWyS/q7Y5dMHJAD4w3DPBnQIsd9cbH /uHEXzvwUkblOnBLd3tC1AW+4gsoavdjCTuPUGrUG2i8gP7jHtLisSrKD+bN/a7ntspw m1EQ== X-Gm-Message-State: APjAAAV8jrsWTBrTBeAexKttm+pKouHPNs4AZLqdJboLBXJRlJazfBs5 ou5abTXgLv/POafABSnvh1RaBQ== X-Received: by 2002:aa7:98d0:: with SMTP id e16mr34318946pfm.77.1579152866617; Wed, 15 Jan 2020 21:34:26 -0800 (PST) Received: from localhost (2001-44b8-1113-6700-097c-7eed-afd4-cd15.static.ipv6.internode.on.net. [2001:44b8:1113:6700:97c:7eed:afd4:cd15]) by smtp.gmail.com with ESMTPSA id p16sm24333466pfq.184.2020.01.15.21.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 21:34:25 -0800 (PST) From: Daniel Axtens To: Dmitry Vyukov , Christophe Leroy Cc: linux-s390 , linux-xtensa@linux-xtensa.org, the arch/x86 maintainers , LKML , kasan-dev , Linux-MM , Daniel Micay , Alexander Potapenko , Andrey Ryabinin , linuxppc-dev , Linux ARM Subject: Re: [PATCH 1/2] kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE In-Reply-To: References: <20200115063710.15796-1-dja@axtens.net> <20200115063710.15796-2-dja@axtens.net> <917cc571-a25c-3d3e-547c-c537149834d6@c-s.fr> Date: Thu, 16 Jan 2020 16:34:23 +1100 Message-ID: <87zheoj76o.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> >> +/* >> >> + * We assign some test results to these globals to make sure the tests >> >> + * are not eliminated as dead code. >> >> + */ >> >> + >> >> +int int_result; >> >> +void *ptr_result; >> > >> > These are globals, but are not static and don't have kasan_ prefix. >> > But I guess this does not matter for modules? >> > Otherwise: >> > >> > Reviewed-by: Dmitry Vyukov >> > >> >> I think if you make them static, GCC will see they aren't used and will >> eliminate everything still ? > > static volatile? :) Yeah so these are module globals. They'd be accessible from any other files you linked into the module (currently there are no such files). They're not visible outside the module because they're not EXPORTed. Making them static does lead to them getting eliminated, and 'static volatile' seems both gross and like something checkpatch would complain about. I'll leave them as they are but stick a kasan_ prefix on them just for the additional tidiness. Regards, Daniel