From: David Miller <davem@davemloft.net>
To: hartleys@visionengravers.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@namei.org,
yoshfuji@linux-ipv6.org, kaber@trash.net
Subject: Re: [PATCH] ipv4/ip_sockglue.c: copy msg_control optval from user to kernel space
Date: Sat, 16 Jan 2010 00:50:23 -0800 (PST) [thread overview]
Message-ID: <20100116.005023.137878764.davem@davemloft.net> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE19091E790C@mi8nycmail19.Mi8.com>
From: "H Hartley Sweeten" <hartleys@visionengravers.com>
Date: Sat, 16 Jan 2010 01:22:21 -0500
> On Fri 1/15/2010 8:30 PM, David Miller wrote:
>> How did you test your change?
>
> Hmm... I saw the sparse warning and tried this to fix it. The code compiled
> fine and the warning was gone. When I booted the resulting kernel I didn't
> see any issues. I must not have went down this code path in my testing.
I'm going to ask you a second time.
What was your test case? How did you test the change?
I don't think you tested your change at all besides seeing that gcc
would accept the code and sparse stopped spitting out a warning. And
you're vagueness about your testing methodology will only work to
confirm my suspicions.
I find it unlikely, at best, for you to have tested that code path, as
'msg' is an uninitilized stack variable at this point in the code, so
'msg->msg_control' is going to be a garbage pointer, and therefore
copying to it would result in a crash.
I don't even think you read and understood the code you are editing.
I suspect you just wanted to kill the sparse warning somehow, you
found a way that made the compiler and sparse eat it, and you simply
ran with it.
And that really upsets me.
Fixing sparse warnings should not be a mindless exercise. You should
understand the code you are changing.
prev parent reply other threads:[~2010-01-16 8:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-15 17:24 [PATCH] ipv4/ip_sockglue.c: copy msg_control optval from user to kernel space H Hartley Sweeten
2010-01-16 1:30 ` David Miller
[not found] ` <BD79186B4FD85F4B8E60E381CAEE19091E790C@mi8nycmail19.Mi8.com>
2010-01-16 8:50 ` David Miller [this message]
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=20100116.005023.137878764.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=hartleys@visionengravers.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pekkas@netcore.fi \
--cc=yoshfuji@linux-ipv6.org \
/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).