From: Marcelo Date: Thu, 03 Dec 2015 18:06:11 +0000 Subject: Re: use-after-free in sctp_do_sm Message-Id: <74ED362E-9B4D-48CB-85BE-04DEDF1BFC97@gmail.com> List-Id: References: <20151124204553.GB3364@hmsreliant.think-freely.org> <5655CFDC.4050206@gmail.com> <20151203165133.GD4164@mrl.redhat.com> <20151203174356.GE4164@mrl.redhat.com> <1449165550.25029.4.camel@edumazet-glaptop2.roam.corp.google.com> In-Reply-To: <1449165550.25029.4.camel@edumazet-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Eric Dumazet Cc: Vlad Yasevich , syzkaller , Neil Horman , linux-sctp@vger.kernel.org, netdev , Kostya Serebryany , Alexander Potapenko , Sasha Levin , Eric Dumazet , =?UTF-8?Q?Maciej_=C5=BBenczykowski?= , Dmitry Vyukov Em 3 de dezembro de 2015 15:59:10 BRST, Eric Dumazet escreveu: >On Thu, 2015-12-03 at 15:43 -0200, Marcelo Ricardo Leitner wrote: > >> Vlad, others, >> >> It's been a long time but this was introduced by commit 914e1c8b6980 >> ("sctp: Inherit all socket options from parent correctly."). This is >not >> very consistent with how other protocols work and it will be hard to >> keep tracking a negative mask of flags that we can't copy. >> >> I reviewed the list of options and I'm thinking that only >> SO_BINDTODEVICE is worth copying, leaving the others for the >application >> to re-set, as it is for other protocols. So I'm thinking on simply: >> >> - newsk->sk_flags = sk->sk_flags; >> + newsk->sk_flags = sk->sk_flags & SO_BINDTODEVICE; >> >> in the above. >> >> What do you think? > >I think SO_BINDTODEVICE is not a flag ;) > >#define SO_BINDTODEVICE 25 Oops, indeed! Idea persists. Thx! -- Sent from mobile. Please excuse my brevity.