From: David Miller <davem@davemloft.net>
To: viro@ZenIV.linux.org.uk
Cc: pmoore@redhat.com, netdev@vger.kernel.org, selinux@tycho.nsa.gov,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH] ipv6: avoid copy_from_user() via ipv6_renew_options_kern()
Date: Sun, 24 Jun 2018 16:48:37 +0900 (KST) [thread overview]
Message-ID: <20180624.164837.37612664745856114.davem@davemloft.net> (raw)
In-Reply-To: <20180623222106.GE30522@ZenIV.linux.org.uk>
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Sat, 23 Jun 2018 23:21:07 +0100
> BTW, I wonder if the life would be simpler with do_ipv6_setsockopt() doing
> the copy-in and verifying ipv6_optlen(*hdr) <= newoptlen; that would've
> simplified ipv6_renew_option{,s}() quite a bit and completely eliminated
> ipv6_renew_options_kern()...
I agree that this makes things a lot simpler.
One thing that drives me crazy though is this inherit stuff:
> + ipv6_renew_option(newtype == IPV6_HOPOPTS ? newopt :
> + opt ? opt->hopopt : NULL,
Why don't we pass the type into ipv6_renew_option() and have it
do this pointer dance instead?
That's going to definitely be easier to read.
I don't know enough about this code to give feedback about the
option length handling wrt. copies, sorry.
next prev parent reply other threads:[~2018-06-24 7:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 21:18 [PATCH] ipv6: avoid copy_from_user() via ipv6_renew_options_kern() Paul Moore
2018-06-23 1:57 ` David Miller
2018-06-23 21:26 ` Al Viro
2018-06-23 22:21 ` Al Viro
2018-06-24 7:48 ` David Miller [this message]
2018-06-25 14:49 ` Paul Moore
2018-06-23 12:16 ` David Miller
2018-06-23 16:15 ` Paul Moore
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=20180624.164837.37612664745856114.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-security-module@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pmoore@redhat.com \
--cc=selinux@tycho.nsa.gov \
--cc=viro@ZenIV.linux.org.uk \
/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