From: Ying Xue <ying.xue@windriver.com>
To: David Miller <davem@davemloft.net>
Cc: <jon.maloy@ericsson.com>, <netdev@vger.kernel.org>,
<paul.gortmaker@windriver.com>, <erik.hugne@ericsson.com>,
<maloy@donjonn.com>, <tipc-discussion@lists.sourceforge.net>,
<andreas.bofjall@ericsson.com>
Subject: Re: [PATCH net-next 1/5] tipc: silence sparse warnings
Date: Fri, 27 Sep 2013 16:01:21 +0800 [thread overview]
Message-ID: <52453B51.5070702@windriver.com> (raw)
In-Reply-To: <20130927.015908.1293107524454870319.davem@davemloft.net>
On 09/27/2013 01:59 PM, David Miller wrote:
> From: Jon Maloy <jon.maloy@ericsson.com>
> Date: Tue, 24 Sep 2013 04:27:44 -0500
>
>> From: Ying Xue <ying.xue@windriver.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@windriver.com>
>> Signed-off-by: Andreas Bofjäll <andreas.bofjall@ericsson.com>
>> Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> Signed-off-by: Jon Maloy <jon.maloy@ericsson.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.
>
>
next prev parent reply other threads:[~2013-09-27 8:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 9:27 [PATCH net-next 0/5] tipc: some small patches Jon Maloy
2013-09-24 9:27 ` [PATCH net-next 1/5] tipc: silence sparse warnings Jon Maloy
2013-09-27 5:59 ` David Miller
2013-09-27 8:01 ` Ying Xue [this message]
2013-09-27 8:15 ` Andreas Bofjäll
2013-09-27 9:48 ` Ying Xue
2013-09-27 10:25 ` Jon Maloy
2013-09-24 9:27 ` [PATCH net-next 2/5] tipc: make bearer and media naming consistent Jon Maloy
2013-09-24 9:27 ` [PATCH net-next 3/5] tipc: avoid unnecessary lookup for tipc bearer instance Jon Maloy
2013-09-24 9:27 ` [PATCH net-next 4/5] tipc: correct return value of recv_msg routine Jon Maloy
2013-09-24 9:27 ` [PATCH net-next 5/5] tipc: correct return value of link_cmd_set_value routine Jon Maloy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52453B51.5070702@windriver.com \
--to=ying.xue@windriver.com \
--cc=andreas.bofjall@ericsson.com \
--cc=davem@davemloft.net \
--cc=erik.hugne@ericsson.com \
--cc=jon.maloy@ericsson.com \
--cc=maloy@donjonn.com \
--cc=netdev@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=tipc-discussion@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).