lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180317170650.GB3351@light.dominikbrodowski.net>
Date:   Sat, 17 Mar 2018 18:06:50 +0100
From:   Dominik Brodowski <linux@...inikbrodowski.net>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
        viro@...iv.linux.org.uk, luto@...nel.org, mingo@...nel.org,
        akpm@...ux-foundation.org, arnd@...db.de,
        linux-s390@...r.kernel.org
Subject: Re: [PATCH v2 18/36] fs: add ksys_write() helper; remove in-kernel
 calls to sys_write()

On Fri, Mar 16, 2018 at 01:52:40AM -0700, Christoph Hellwig wrote:
> I really don't like this, as this is the wrong level of abstraction.
> 
> > diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
> > index 79b7a3438d54..5a9cfde5fc28 100644
> > --- a/arch/s390/kernel/compat_linux.c
> > +++ b/arch/s390/kernel/compat_linux.c
> > @@ -468,7 +468,7 @@ COMPAT_SYSCALL_DEFINE3(s390_write, unsigned int, fd, const char __user *, buf, c
> >  	if ((compat_ssize_t) count < 0)
> >  		return -EINVAL; 
> >  
> > -	return sys_write(fd, buf, count);
> > +	return ksys_write(fd, buf, count);
> >  }
> 
> This looks bogus to me.  Why does s390 have its own compat version of
> write but not any of the other read and write familty calls?
> 
> > diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
> > index 99e0b649fc0e..2d365c398ccc 100644
> > --- a/init/do_mounts_rd.c
> > +++ b/init/do_mounts_rd.c
> > @@ -270,7 +270,7 @@ int __init rd_load_image(char *from)
> >  			printk("Loading disk #%d... ", disk);
> >  		}
> >  		sys_read(in_fd, buf, BLOCK_SIZE);
> > -		sys_write(out_fd, buf, BLOCK_SIZE);
> > +		ksys_write(out_fd, buf, BLOCK_SIZE);
> >  #if !defined(CONFIG_S390)
> >  		if (!(i % 16)) {
> >  			pr_cont("%c\b", rotator[rotate & 0x3]);
> 
> All the do_mounts / initramfs code should be rewritten to use filp_open
> and vfs_read/vfs_write instead of adding hacks like this.

In line with the other patches, I have added the following paragraph to the
commit message:

	In the near future, the do_mounts / initramfs callers of ksys_write()
	should be converted to use filp_open() and vfs_write() instead.

Thanks,
	Dominik

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ