From: David Miller <davem@davemloft.net>
To: dan.carpenter@oracle.com
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com,
linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2 net] sctp: potential read out of bounds in sctp_ulpevent_type_enabled()
Date: Wed, 13 Sep 2017 17:00:19 -0700 (PDT) [thread overview]
Message-ID: <20170913.170019.543516362575770735.davem@davemloft.net> (raw)
In-Reply-To: <20170913230054.fmtidvfi2swvy2mm@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 14 Sep 2017 02:00:54 +0300
> This code causes a static checker warning because Smatch doesn't trust
> anything that comes from skb->data. I've reviewed this code and I do
> think skb->data can be controlled by the user here.
>
> The sctp_event_subscribe struct has 13 __u8 fields and we want to see
> if ours is non-zero. sn_type can be any value in the 0-USHRT_MAX range.
> We're subtracting SCTP_SN_TYPE_BASE which is 1 << 15 so we could read
> either before the start of the struct or after the end.
>
> This is a very old bug and it's surprising that it would go undetected
> for so long but my theory is that it just doesn't have a big impact so
> it would be hard to notice.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: Use reverse-christmas-tree local variable ordering.
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2017-09-14 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-13 9:20 [PATCH net] sctp: potential read out of bounds in sctp_ulpevent_type_enabled() Dan Carpenter
2017-09-13 14:28 ` Neil Horman
2017-09-13 16:25 ` David Miller
2017-09-13 23:00 ` [PATCH v2 " Dan Carpenter
2017-09-14 0:00 ` 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=20170913.170019.543516362575770735.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vyasevich@gmail.com \
/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