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: <a2eabb99-82b6-247f-4806-4e564bb0eac3@mev.co.uk>
Date:   Thu, 16 Jul 2020 12:15:21 +0100
From:   Ian Abbott <abbotti@....co.uk>
To:     B K Karthik <bkkarthik@...u.pes.edu>,
        H Hartley Sweeten <hsweeten@...ionengravers.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Xin Tan <tanxin.ctf@...il.com>,
        Daniel Jordan <daniel.m.jordan@...cle.com>,
        Divyansh Kamboj <kambojdivyansh2000@...il.com>,
        Michel Lespinasse <walken@...gle.com>,
        Xiyu Yang <xiyuyang19@...an.edu.cn>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: comedi: comedi_fops.c: added casts to get rid
 of sparse warnings

On 15/07/2020 12:48, B K Karthik wrote:
> fixed sparse warnings by adding a cast in assignment from
> void [noderef] __user * to unsigned int __force *
> and a reverse cast in argument from
> void [noderef] __user * to  unsigned int __user * .

Minor quibble: the reverse cast is actually from unsigned int * to 
unsigned int __user * .

> 
> Signed-off-by: B K Karthik <karthik.bk2000@...e.com>
> ---
>   drivers/staging/comedi/comedi_fops.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> index 3f70e5dfac39..9cdc1e8a022d 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
>   	cmd->scan_end_arg = v32.scan_end_arg;
>   	cmd->stop_src = v32.stop_src;
>   	cmd->stop_arg = v32.stop_arg;
> -	cmd->chanlist = compat_ptr(v32.chanlist);
> +	cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist);
>   	cmd->chanlist_len = v32.chanlist_len;
>   	cmd->data = compat_ptr(v32.data);
>   	cmd->data_len = v32.data_len;
> @@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32,
>   	v32.stop_src = cmd->stop_src;
>   	v32.stop_arg = cmd->stop_arg;
>   	/* Assume chanlist pointer is unchanged. */
> -	v32.chanlist = ptr_to_compat(cmd->chanlist);
> +	v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist);
>   	v32.chanlist_len = cmd->chanlist_len;
>   	v32.data = ptr_to_compat(cmd->data);
>   	v32.data_len = cmd->data_len;
> 

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

-- 
-=( Ian Abbott <abbotti@....co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:    )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ