RE: [PATCHES] uaccess simple access_ok() removals

2020-05-10 Thread David Laight
From: Al Viro
> Sent: 10 May 2020 00:41
> 
>   One of the uaccess-related branches; this one is just the
> cases when access_ok() calls are trivially pointless - the address
> in question gets fed only to primitives that do access_ok() checks
> themselves.

There is also the check in rw_copy_check_uvector() that should
always be replicated by the copy_to/from_user() in _copy_to/from_iter().

And the strange call to rw_copy_check_uvector() in mm/process_vm_access.c
which carefully avoids the access_ok() check for the target process.
I did a quick look, but failed to see an obvious check further
down the call path.
The code is doing a read/write from another process, not sure when it
is used - not by gdb.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, 
UK
Registration No: 1397386 (Wales)



Re: [PATCHES] uaccess simple access_ok() removals

2020-05-09 Thread Al Viro
On Sat, May 09, 2020 at 05:34:58PM -0700, Linus Torvalds wrote:
> On Sat, May 9, 2020 at 4:41 PM Al Viro  wrote:
> >
> > Individual patches in followups; if nobody screams - into #for-next
> > it goes...
> 
> Looks fine to me, although I only read your commit logs, I didn't
> verify that what you stated was actually true (ie the whole "only used
> for xyz" parts).
> 
> But I'll take your word for it. Particularly the double-underscore
> versions are getting rare (and presumably some of the other branches
> you have make it rarer still).

I have - FWIW, right now I'm going through the patch series for netdev;
once I'm done with turning commit messages into something printable
(and finish rereading the patches themselves), there it goes, hopefully
tonight.  Then a bunch of small branches + repost of csum one + some
of the weird shit (comedi compat ioctls - the largest pile of
__get_user() and __put_user() outside of arch/* is festering there).
Then regset stuff + (probably) resurrection of i915 stuff.

I've got a bunch of stuff around execve(), but that'll have to wait
until I get through the recently posted execve-related patchsets...

Then there's e.g. mempolicy compat stuff, etc., but I'd rather wait
for several days before posting that, reviewers' bandwidth being
finite...


Re: [PATCHES] uaccess simple access_ok() removals

2020-05-09 Thread Linus Torvalds
On Sat, May 9, 2020 at 4:41 PM Al Viro  wrote:
>
> Individual patches in followups; if nobody screams - into #for-next
> it goes...

Looks fine to me, although I only read your commit logs, I didn't
verify that what you stated was actually true (ie the whole "only used
for xyz" parts).

But I'll take your word for it. Particularly the double-underscore
versions are getting rare (and presumably some of the other branches
you have make it rarer still).

   Linus


[PATCHES] uaccess simple access_ok() removals

2020-05-09 Thread Al Viro
One of the uaccess-related branches; this one is just the
cases when access_ok() calls are trivially pointless - the address
in question gets fed only to primitives that do access_ok() checks
themselves.  This stuff sits in
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git #uaccess.access_ok
and it's on top of #fixes (which is already merged into mainline on
Apr 28).
Individual patches in followups; if nobody screams - into #for-next
it goes...

There are other uaccess-related branches; I'll be posting them
for review over the next few days.  My apologies if this one comes with
a buggered Cc - this is the first time I have to deal with a series with
Cc lists varying that much; I hope I manage to get git-send-email do
the right thing, but...

Shortlog:
Al Viro (20):
  dlmfs_file_write(): get rid of pointless access_ok()
  fat_dir_ioctl(): hadn't needed that access_ok() for more than a decade...
  btrfs_ioctl_send(): don't bother with access_ok()
  FIEMAP: don't bother with access_ok()
  tomoyo_write_control(): get rid of pointless access_ok()
  n_hdlc_tty_read(): remove pointless access_ok()
  nvram: drop useless access_ok()
  cm4000_cs.c cmm_ioctl(): get rid of pointless access_ok()
  drivers/fpga/dfl-fme-pr.c: get rid of pointless access_ok()
  drivers/fpga/dfl-afu-dma-region.c: get rid of pointless access_ok()
  amifb: get rid of pointless access_ok() calls
  omapfb: get rid of pointless access_ok() calls
  drivers/crypto/ccp/sev-dev.c: get rid of pointless access_ok()
  via-pmu: don't bother with access_ok()
  drm_read(): get rid of pointless access_ok()
  efi_test: get rid of pointless access_ok()
  lpfc_debugfs: get rid of pointless access_ok()
  usb: get rid of pointless access_ok() calls
  hfi1: get rid of pointless access_ok()
  vmci_host: get rid of pointless access_ok()
Diffstat:
 drivers/char/nvram.c|  4 
 drivers/char/pcmcia/cm4000_cs.c | 14 --
 drivers/crypto/ccp/sev-dev.c| 15 +++
 drivers/firmware/efi/test/efi_test.c| 12 
 drivers/fpga/dfl-afu-dma-region.c   |  4 
 drivers/fpga/dfl-fme-pr.c   |  4 
 drivers/gpu/drm/drm_file.c  |  3 ---
 drivers/infiniband/hw/hfi1/user_exp_rcv.c   |  7 ---
 drivers/macintosh/via-pmu.c |  2 --
 drivers/misc/vmw_vmci/vmci_host.c   |  2 --
 drivers/scsi/lpfc/lpfc_debugfs.c| 12 
 drivers/tty/n_hdlc.c|  7 ---
 drivers/usb/core/devices.c  |  2 --
 drivers/usb/core/devio.c|  9 -
 drivers/usb/gadget/function/f_hid.c |  6 --
 drivers/video/fbdev/amifb.c |  4 
 drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c |  3 ---
 fs/btrfs/send.c |  7 ---
 fs/ext4/ioctl.c |  5 -
 fs/fat/dir.c|  4 
 fs/ioctl.c  |  5 -
 fs/ocfs2/dlmfs/dlmfs.c  |  3 ---
 security/tomoyo/common.c|  2 --
 23 files changed, 3 insertions(+), 133 deletions(-)