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]
Date:	Mon, 22 Jun 2015 17:08:00 +0100
From:	Ian Abbott <abbotti@....co.uk>
To:	Geliang Tang <geliangtang@....com>
CC:	sudipm.mukherjee@...il.com, hsweeten@...ionengravers.com,
	gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] staging: comedi: fix cast warning in comedi_compat32.c

On 22/06/15 16:33, Geliang Tang wrote:
> This patch fixes the following sparse warning:
>
> drivers/staging/comedi/comedi_compat32.c:205:16: warning: cast removes
> address space of expression
>
> Signed-off-by: Geliang Tang <geliangtang@....com>
> ---
> Changes in v3:
>    - fix the 80 character line limit.
>
> Changes in v2:
>    - compat_ptr() is substituted by 'unsigned long'.
> ---
>   drivers/staging/comedi/comedi_compat32.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c
> index 2584824..f356386 100644
> --- a/drivers/staging/comedi/comedi_compat32.c
> +++ b/drivers/staging/comedi/comedi_compat32.c
> @@ -202,7 +202,8 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
>   	err |= __get_user(temp.uint, &cmd32->stop_arg);
>   	err |= __put_user(temp.uint, &cmd->stop_arg);
>   	err |= __get_user(temp.uptr, &cmd32->chanlist);
> -	err |= __put_user(compat_ptr(temp.uptr), &cmd->chanlist);
> +	err |= __put_user((unsigned int __force *)compat_ptr(temp.uptr),
> +			&cmd->chanlist);
>   	err |= __get_user(temp.uint, &cmd32->chanlist_len);
>   	err |= __put_user(temp.uint, &cmd->chanlist_len);
>   	err |= __get_user(temp.uptr, &cmd32->data);
>

Looks okay now apart from it being ugly, but that can't be helped since 
comedi uses that chanlist member for both user and kernel addresses!

Reviewed-by: Ian Abbott <abbotti@....co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@....co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ