linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Smith <dsmith@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Frank Ch. Eigler" <fche@redhat.com>
Subject: Re: [RFC][PATCH] x86: Verify access_ok() context
Date: Mon, 16 Jan 2017 14:27:55 -0600	[thread overview]
Message-ID: <f84a1055-f65b-fcd8-c914-46b328acd172@redhat.com> (raw)
In-Reply-To: <20161205102747.GT3092@twins.programming.kicks-ass.net>

If you call access_ok() with page faulting disabled, you'll still see this new warning. If you put that new access_ok() call in a module that gets loaded/unloaded, you see one warning for every module load, which gets a bit annoying.

How about modifying it like this:

---
From: David Smith <dsmith@redhat.com>
Date: Mon, 16 Jan 2017 14:07:31 -0600
Subject: [PATCH] Relax x86 new access_ok() warning a bit.

Signed-off-by: David Smith <dsmith@redhat.com>
---
 arch/x86/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index ea148313570f..0cbd3cca5e7b 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -69,7 +69,7 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
 })
 
 #ifdef CONFIG_DEBUG_ATOMIC_SLEEP
-# define WARN_ON_IN_IRQ()	WARN_ON_ONCE(!in_task())
+# define WARN_ON_IN_IRQ()	WARN_ON_ONCE(!in_task() && !pagefault_disabled())
 #else
 # define WARN_ON_IN_IRQ()
 #endif
-- 


-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

  reply	other threads:[~2017-01-16 20:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22  9:57 [RFC][PATCH] x86: Verify access_ok() context Peter Zijlstra
2016-11-22 17:28 ` Andy Lutomirski
2016-11-22 19:37   ` Peter Zijlstra
2016-11-22 19:42     ` Linus Torvalds
2016-12-05 10:27       ` Peter Zijlstra
2017-01-16 20:27         ` David Smith [this message]
2017-01-16 21:14           ` Thomas Gleixner
2017-01-18 22:16             ` David Smith
2017-01-19  0:19               ` Andy Lutomirski
2017-01-19 15:37                 ` David Smith
2017-01-20  8:24                 ` Peter Zijlstra
2017-01-20  8:50                   ` Thomas Gleixner
2017-01-19 18:12               ` Thomas Gleixner
2017-01-19 20:22                 ` Frank Ch. Eigler
2017-01-19 20:50                   ` Thomas Gleixner
2017-01-19 21:27                     ` Frank Ch. Eigler
2017-01-19 22:20                       ` Peter Zijlstra
2017-01-19 23:04                       ` Thomas Gleixner

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=f84a1055-f65b-fcd8-c914-46b328acd172@redhat.com \
    --to=dsmith@redhat.com \
    --cc=fche@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).