public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@kernel.org>, Jann Horn <jannh@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	"Tobin C. Harding" <tobin@kernel.org>
Subject: Re: [PATCH] x86/uaccess: Remove unused __addr_ok() macro
Date: Mon, 25 Feb 2019 13:08:00 -0800	[thread overview]
Message-ID: <4c48dea49377612eb85a699de8a52ee12eef3de3.camel@perches.com> (raw)
In-Reply-To: <20190225194203.GI26145@zn.tnic>

On Mon, 2019-02-25 at 20:42 +0100, Borislav Petkov wrote:
> On Mon, Feb 25, 2019 at 11:20:42AM -0800, Linus Torvalds wrote:
> > On Mon, Feb 25, 2019 at 11:11 AM Borislav Petkov <bp@alien8.de> wrote:
> > > This was caught while staring at the whole {set,get}_fs() machinery.
> > 
> > Heh.
> > 
> > You should probably have researched _when_ it became unused.
> > 
> > That seems to have happened in commit 5723aa993d83 ("x86: use the new
> > generic strnlen_user() function") which removed the single user from
> > the x86-32 version of strnlen_user(), which used to have
> > 
> >         unsigned long mask = -__addr_ok(s);
> 
> Yap, found it. I still have
> 
> $ git log -p -G__addr_ok --pickaxe-all
> 
> in one of the shells' history here.
> 
> I'll add that to the commit message.
> 
> Thx.

Looks like it's not used in several arches

$ git grep -w __addr_ok
arch/arm/include/asm/uaccess.h:#define __addr_ok(addr)          ((void)(addr), 1)
arch/csky/include/asm/uaccess.h:#define __addr_ok(addr) (access_ok(addr, 0))
arch/openrisc/include/asm/uaccess.h:#define __addr_ok(addr) ((unsigned long) addr < get_fs())
arch/sh/include/asm/uaccess.h:#define __addr_ok(addr) \
arch/sh/include/asm/uaccess.h:  __ao_end >= __ao_a && __addr_ok(__ao_end); })
arch/x86/include/asm/uaccess.h:#define __addr_ok(addr)  \



  reply	other threads:[~2019-02-25 21:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 19:11 [PATCH] x86/uaccess: Remove unused __addr_ok() macro Borislav Petkov
2019-02-25 19:20 ` Linus Torvalds
2019-02-25 19:42   ` Borislav Petkov
2019-02-25 21:08     ` Joe Perches [this message]
2019-03-04  6:47       ` Christian Kujau
2019-03-27 13:15         ` Borislav Petkov
2019-02-25 22:43 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov

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=4c48dea49377612eb85a699de8a52ee12eef3de3.camel@perches.com \
    --to=joe@perches.com \
    --cc=bp@alien8.de \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tobin@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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