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:	Fri, 27 Sep 2013 16:01:21 +0800
From:	Ying Xue <ying.xue@...driver.com>
To:	David Miller <davem@...emloft.net>
CC:	<jon.maloy@...csson.com>, <netdev@...r.kernel.org>,
	<paul.gortmaker@...driver.com>, <erik.hugne@...csson.com>,
	<maloy@...jonn.com>, <tipc-discussion@...ts.sourceforge.net>,
	<andreas.bofjall@...csson.com>
Subject: Re: [PATCH net-next 1/5] tipc: silence sparse warnings

On 09/27/2013 01:59 PM, David Miller wrote:
> From: Jon Maloy <jon.maloy@...csson.com>
> Date: Tue, 24 Sep 2013 04:27:44 -0500
> 
>> From: Ying Xue <ying.xue@...driver.com>
>>
>> Eliminate below sparse warnings:
>>
>> net/tipc/link.c:1210:37: warning: cast removes address space of expression
>> net/tipc/link.c:1218:59: warning: incorrect type in argument 2 (different address spaces)
>> net/tipc/link.c:1218:59:    expected void const [noderef] <asn:1>*from
>> net/tipc/link.c:1218:59:    got unsigned char const [usertype] *[assigned] sect_crs
>> net/tipc/msg.c:96:61: warning: incorrect type in argument 3 (different address spaces)
>> net/tipc/msg.c:96:61:    expected void const *from
>> net/tipc/msg.c:96:61:    got void [noderef] <asn:1>*const iov_base
>> net/tipc/socket.c:341:49: warning: Using plain integer as NULL pointer
>> net/tipc/socket.c:1371:36: warning: Using plain integer as NULL pointer
>> net/tipc/socket.c:1694:57: warning: Using plain integer as NULL pointer
>>
>> Signed-off-by: Ying Xue <ying.xue@...driver.com>
>> Signed-off-by: Andreas Bofjäll <andreas.bofjall@...csson.com>
>> Reviewed-by: Paul Gortmaker <paul.gortmaker@...driver.com>
>> Signed-off-by: Jon Maloy <jon.maloy@...csson.com>
> 
> These warnings are not just for fun, and they are certainly not an
> invitation to stick casts all over the place to make them go away.
> 
> They indicate real problems in the TIPC code.
> 
> There really are user pointers in the iovecs here, and that's why the
> iov_base member is annotated with "__user".
> 
> These iovecs carry pointers that come from userspace via socket calls.
> 
> And you absolutely cannot pass user pointers to skb_copy_to_linear_data()
> and friends as they access the source pointer using memcpy().
> 

Good point!
It's better for us to use memcpy_fromiovecend() instead of
skb_copy_to_linear_data() and its friends.

We will submit another version to correct this error soon.

Regards,
Ying

> You have to use the proper interfaces for accessing userspace memory,
> ones that have their arguments annotated with __user.
> 
> I'm not applying this series, sorry.
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists