From: David Miller <davem@davemloft.net>
To: marcelo.leitner@gmail.com
Cc: netdev@vger.kernel.org, vyasevich@gmail.com
Subject: Re: [PATCH net] sctp: fix sockopt size check
Date: Wed, 29 Jul 2015 17:07:31 -0700 (PDT) [thread overview]
Message-ID: <20150729.170731.1725393558438186362.davem@davemloft.net> (raw)
In-Reply-To: <387de09215f2ad50481516932f213cccfa077e3e.1438092726.git.marcelo.leitner@gmail.com>
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Tue, 28 Jul 2015 11:16:23 -0300
> The problem is not on being bigger than what we want, but on being
> smaller, as it causes read of invalid memory.
>
> Note that the struct changes on commit 7e8616d8e773 didn't affect
> sctp_setsockopt_events one but that's where this check was flipped.
>
> Fixes: 7e8616d8e773 ("[SCTP]: Update AUTH structures to match
> declarations in draft-16.")
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
This makes things worse.
The copy_from_user() call is bounded by optlen, so if you allow it to
be any arbitrary large value the user can write past the end of the
structure, corrupting kernel memory.
No, the test is correct, or at least necessary, as-is.
next prev parent reply other threads:[~2015-07-30 0:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 14:16 [PATCH net] sctp: fix sockopt size check Marcelo Ricardo Leitner
2015-07-30 0:07 ` David Miller [this message]
2015-07-30 12:00 ` Marcelo Ricardo Leitner
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=20150729.170731.1725393558438186362.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--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