Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp609879ybz; Fri, 1 May 2020 05:25:35 -0700 (PDT) X-Google-Smtp-Source: APiQypIu4JX7N6NYG6yQSWnxkThqQPq4Cl9KJToAtLYmzV7gd/ehC3AIqxn6BAzDCJvEmoQp6Kzj X-Received: by 2002:a17:907:2069:: with SMTP id qp9mr3018394ejb.137.1588335934990; Fri, 01 May 2020 05:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588335934; cv=none; d=google.com; s=arc-20160816; b=Tj89+OcUs8zdCh+AJeLAY5kleeQcqUDXGWY2oINZMlBEtQtyNoOshDYyYYs3Ohn6Wq 90mZyRTOooYA4eZ/mqxd6epTukC9p2aWyB3+4blWx3kgoG+cj4wnv+ihNVdZFwY0kzcV g7KlueUmUKKJ6h4Di0Y2xSeEVYP9rUIr8xp7Set6taRMO6XcvyBO0PiUeV9KlkOVHk4L 3v2XxDAWtsJIN9GcCEvDSljxEEUcJYjrze6CG9lEWXH1QtyOWfdUWzwynVxoLriCoWKH an7NqF1AdItisByAxayYy+1JDiHeVqM9VW78MJZWt7emlmrci8KSNmcD3J01fxVfLala 5kEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4mG4qBfAtTLoyMkOz50BSyv07PCU8ojhx0uykodQSgM=; b=JpEFRO2X+BMl4k9/SFYe/RsADaC/tN0VeDNWttjOKc1BxhufGRM55O20wMy/2voP3+ 6utOy0oF71hLXX8fTPQDo09tHakltu3u0j8yuScJ3vNi+apGG314DrIeWYltoom44RVy U9mIS8pQOIxNjvZ8OQSC3rSbbtIbJcvtLsucvG9g/z0BOQKmKN1MO4pQNAWPZ9+UdgIL rlBRaJV4osqVzsDV6LO25vBN0mwEdQuAJqIb/bkRxWV+CPDo639Lqz2xC3Jwie1zI5i+ uZaTQ/y53t13SEm9gcF4B9i7Ks4ACbF1shdui7krbqCnIcrLl8xXCNLZRkIpqHL+rRxC n9DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=iHgo0dCG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si1652978edd.366.2020.05.01.05.25.12; Fri, 01 May 2020 05:25:34 -0700 (PDT) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=iHgo0dCG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728716AbgEAMXi (ORCPT + 99 others); Fri, 1 May 2020 08:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726131AbgEAMXh (ORCPT ); Fri, 1 May 2020 08:23:37 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81434C061A0C for ; Fri, 1 May 2020 05:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4mG4qBfAtTLoyMkOz50BSyv07PCU8ojhx0uykodQSgM=; b=iHgo0dCG9zjACxGyRlYaGP1dA5 4O39yMe2eUInaL5afhYr4mWY39TpopFdTjWZcoC6ZYx8H1A41fPHwQcNFkxqjr9PKeci77ioIYNiY m7mNxSd3Hr3yuNkHAl36bzZjeLy4ulThSLGdWqNSsDtAi0gAz29BNu4q400QoAXNL8hGu7jjvwjLZ EEXUa2sgjI5HeiqQ7oTsxz0OYcEVdny2RLnWFd0QB73uJX0djdBHpIHWoeCg4vZ/093z37iimO5IA ZsjueeEEzForPFCJhG9AolbSylo5Vzb+/xAjKLhHSCeQJa/FpYSCTI4fSSd6bw8bXdglbN1ggaHpp A0ZPfARw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUUhH-0004Hz-8A; Fri, 01 May 2020 12:23:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B133B3011E8; Fri, 1 May 2020 14:23:12 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9633129942A31; Fri, 1 May 2020 14:23:12 +0200 (CEST) Date: Fri, 1 May 2020 14:23:12 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Arnd Bergmann , the arch/x86 maintainers , Linux Kernel Mailing List , Kees Cook Subject: Re: Remaining randconfig objtool warnings, linux-next-20200428 Message-ID: <20200501122312.GA3762@hirez.programming.kicks-ass.net> References: <20200428161044.caamvx67t2z4t6vd@treble> <20200429191846.hcfc7t4zusdudtej@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429191846.hcfc7t4zusdudtej@treble> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 02:18:46PM -0500, Josh Poimboeuf wrote: > On Tue, Apr 28, 2020 at 11:10:44AM -0500, Josh Poimboeuf wrote: > > > ==> build/x86/0x2EA4CE4F_defconfig/log <== > > > kernel/kcov.o: warning: objtool: write_comp_data()+0x1b: call to check_kcov_mode() with UACCESS enabled > > > kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc()+0x15: call to check_kcov_mode() with UACCESS enabled > > From: Josh Poimboeuf > Subject: [PATCH] objtool: Add check_kcov_mode() to the uaccess safelist > > check_kcov_mode() is called by write_comp_data() and > __sanitizer_cov_trace_pc(), which are already on the uaccess safe list. > Might as well add check_kcov_mode() to the party. Hurmph, the actual reason it's ok is because it's notrace and doesn't call out to other stuff, that's the reason those other two functions got away without having user_access_save()/restore() on. The alternative fix would be to mark that check_kcov_mode() thing as __always_inline, it's puny anyway. > This fixes the following warnings: > > kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc()+0x15: call to check_kcov_mode() with UACCESS enabled > kernel/kcov.o: warning: objtool: write_comp_data()+0x1b: call to check_kcov_mode() with UACCESS enabled > > Reported-by: Arnd Bergmann > Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) > --- > tools/objtool/check.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/objtool/check.c b/tools/objtool/check.c > index 0c732d586924..fec890547e04 100644 > --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -516,6 +516,7 @@ static const char *uaccess_safe_builtin[] = { > "__tsan_write16", > /* KCOV */ > "write_comp_data", > + "check_kcov_mode", > "__sanitizer_cov_trace_pc", > "__sanitizer_cov_trace_const_cmp1", > "__sanitizer_cov_trace_const_cmp2", > -- > 2.21.1 >