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]
Date:   Wed, 12 Aug 2020 13:29:41 +0800
From:   Kent Gibson <warthog618@...il.com>
To:     linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
        bgolaszewski@...libre.com, linus.walleij@...aro.org
Subject: Re: [PATCH v3 06/18] gpiolib: cdev: support
 GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL

On Sun, Aug 09, 2020 at 09:25:17PM +0800, Kent Gibson wrote:
> Add support for GPIO_V2_GET_LINEINFO_IOCTL and
> GPIO_V2_GET_LINEINFO_WATCH_IOCTL.
> 
> Signed-off-by: Kent Gibson <warthog618@...il.com>
> ---
> 
[snip]

>  
>  		if (copy_from_user(&lineinfo, ip, sizeof(lineinfo)))
>  			return -EFAULT;
> @@ -1251,7 +1353,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>  		if (IS_ERR(desc))
>  			return PTR_ERR(desc);
>  
> -		gpio_desc_to_lineinfo(desc, &lineinfo);
> +		gpio_desc_to_lineinfo(desc, &lineinfo_v2);
> +		lineinfo_v2.offset = lineinfo.line_offset;
> +		gpio_v2_line_info_to_v1(&lineinfo_v2, &lineinfo);
>  

This is broken as gpio_desc_to_lineinfo() requires the offset to be
already set in the info.  I could move the setting of offset before the
call, but would rather change gpio_desc_to_lineinfo() to treat info
strictly as output (it can determine the offset from the desc) so as
not to trap anyone else in the future.

I also intend to replace the use of strncpy, from this patch and
elsewhere, to placate the build-bot.

Cheers,
Kent.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ