From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BC40C33CB1 for ; Thu, 16 Jan 2020 05:34:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 04731206E6 for ; Thu, 16 Jan 2020 05:34:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="ZgcbuRsf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04731206E6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8DDCB8E0034; Thu, 16 Jan 2020 00:34:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 865E88E0026; Thu, 16 Jan 2020 00:34:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 706BC8E0034; Thu, 16 Jan 2020 00:34:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 627178E0026 for ; Thu, 16 Jan 2020 00:34:28 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 371768248047 for ; Thu, 16 Jan 2020 05:34:28 +0000 (UTC) X-FDA: 76382382216.29.twig43_7e49b4469fc56 X-HE-Tag: twig43_7e49b4469fc56 X-Filterd-Recvd-Size: 4384 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jan 2020 05:34:27 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id w62so9647022pfw.8 for ; Wed, 15 Jan 2020 21:34:27 -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=XP3vfwgdoleaeNyjxcy1kwCaPsrXCH0uoCw/k4gtJ80qyQ4VPy2Z+c4fFbQ7aUGbaW SqkTQf4h2Ky3GYPf7NnjpTX6U4hkUVwFsVrwICAtVEc/i1/gXE2LuN6yxq/KbyLAz7/y m/Rxz89q0w/sc70MwDW6WtcEOK5LWKj+md85eJ2Kj053gfJpzx/H1QWWXyvBcU5KttB9 dx4z8xAp8SvWkL/AwjRGxZ4McRhSz5PKmD/11VOpJW4Uzyfg9azXWpCXD5untksNFkrt g/cZC8v84SBfV6dZCxNSNQHnGuImZu+rfR7br8zOaS/IMkxD5hj/HtPh4isa9f7RlWUB 6xYg== X-Gm-Message-State: APjAAAWPqTCPd0UNsoolkxu7EJvuKBSuYXvy7xaYoBAs9NeM0kktlprO p5x/o7WHBR14YOCLHCAoYUbxZw== X-Google-Smtp-Source: APXvYqxrN0+qBEVUpua94Qb8xZteFhv2nkLn9S7EhrqzK/2c5Vhq+y51pzR4+MJYtOWvoNtguucHYw== 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: >> >> +/* >> >> + * 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