LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: akpm@linux-foundation.org, broonie@kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-next@vger.kernel.org, mhocko@suse.cz,
	mm-commits@vger.kernel.org, sfr@canb.auug.org.au,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	walter-zh.wu@mediatek.com, dvyukov@google.com
Subject: Re: mmotm 2020-03-03-22-28 uploaded (warning: objtool:)
Date: Thu, 5 Mar 2020 09:18:42 +0100	[thread overview]
Message-ID: <20200305081842.GB2619@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200305081717.GT2596@hirez.programming.kicks-ass.net>

On Thu, Mar 05, 2020 at 09:17:17AM +0100, Peter Zijlstra wrote:
> On Wed, Mar 04, 2020 at 09:34:49AM -0800, Randy Dunlap wrote:

> > mm/kasan/common.o: warning: objtool: kasan_report()+0x13: call to report_enabled() with UACCESS enabled
> 
> I used next/master instead, and found the below broken commit
> responsible for this.

> @@ -634,12 +637,20 @@ void kasan_free_shadow(const struct vm_struct *vm)
>  #endif
>  
>  extern void __kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip);
> +extern bool report_enabled(void);
>  
> -void kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip)
> +bool kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip)
>  {
> -	unsigned long flags = user_access_save();
> +	unsigned long flags;
> +
> +	if (likely(!report_enabled()))
> +		return false;

This adds an explicit call before the user_access_save() and that is a
straight on bug.

> +
> +	flags = user_access_save();
>  	__kasan_report(addr, size, is_write, ip);
>  	user_access_restore(flags);
> +
> +	return true;
>  }

  reply	other threads:[~2020-03-05  8:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  6:28 mmotm 2020-03-03-22-28 uploaded akpm
2020-03-04 17:10 ` mmotm 2020-03-03-22-28 uploaded (objtool warnings) Randy Dunlap
2020-03-04 17:34 ` mmotm 2020-03-03-22-28 uploaded (warning: objtool:) Randy Dunlap
2020-03-05  8:17   ` Peter Zijlstra
2020-03-05  8:18     ` Peter Zijlstra [this message]
2020-03-05  9:16       ` Walter Wu
2020-03-05  9:54         ` Peter Zijlstra
2020-03-05 17:04           ` Randy Dunlap
2020-03-11  1:30           ` Walter Wu
2020-03-11  1:33           ` Walter Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200305081842.GB2619@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=dvyukov@google.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=mm-commits@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=walter-zh.wu@mediatek.com \
    --subject='Re: mmotm 2020-03-03-22-28 uploaded (warning: objtool:)' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).