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] [day] [month] [year] [list]
Message-ID: <20170213075422.GB20361@infradead.org>
Date:   Sun, 12 Feb 2017 23:54:22 -0800
From:   Christoph Hellwig <hch@...radead.org>
To:     Scott Bauer <scott.bauer@...el.com>
Cc:     linux-nvme@...ts.infradead.org, David.Laight@...LAB.COM,
        arnd@...db.de, axboe@...com, keith.busch@...el.com,
        jonathan.derrick@...el.com, hch@...radead.org,
        linux-kernel@...r.kernel.org, linux-block@...r.kernel.org
Subject: Re: [PATCH V4 2/2] Move stack parameters for sed_ioctl to prevent
 oversized stack with CONFIG_KASAN

>  int sed_ioctl(struct opal_dev *dev, unsigned int cmd, unsigned long ptr)
>  {
> +	void *ioctl_ptr;
> +	int ret = -ENOTTY;
>  	void __user *arg = (void __user *)ptr;

Can we use this opportunity to clean up the usual ioctl argument mess.
Id say pass the "void __user *argp" argument already (nvme_ioctl should
have a local variable for it anyway), and then just rename ioctl_ptr
variable to the usual short p.

> +	unsigned int cmd_size = _IOC_SIZE(cmd);
>  

> +	ioctl_ptr = memdup_user(arg, cmd_size);

cmd_size is only used once, so why not opencode the expression in the
argument to memdup_user.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ