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: <20140508103028.GD26890@mwanda>
Date:	Thu, 8 May 2014 13:30:28 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Tuomas Tynkkynen <tuomas.tynkkynen@....fi>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	linux-media@...r.kernel.org
Subject: Re: [PATCH] staging: lirc: Fix sparse warnings

On Thu, May 08, 2014 at 01:11:48PM +0300, Tuomas Tynkkynen wrote:
> Fix sparse warnings by adding __user and __iomem annotations where
> necessary and removing certain unnecessary casts.
> 
> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@....fi>

This patch adds spaces between the cast and the variable.  There
shouldn't be a cast.  That rule is so people remember that casting is a
high precedence operation.

Joe recently added a check for cast spacing to ./scripts/checkpatch.pl
--strict.  Run your patch through ./scripts/checkpatch.pl --strict and
fix the warnings.

> @@ -470,36 +471,36 @@ static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
>  
>  	switch (cmd) {
>  	case LIRC_GET_FEATURES:
> -		result = put_user(features, (__u32 *) arg);
> +		result = put_user(features, (__u32 __user *) arg);

arg is alway a u32 __user pointer.  Do this at the start of the
function.

	u32 __user *uptr = (u32 __user *)arg;

Then replace all the "arg" references with "uptr".  Btw, the difference
between __u32 and u32 is that __u32 is for code which is shared with
user space and u32 is only allowed in kernel code.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ