From: Joe Perches Date: Fri, 04 Dec 2015 17:03:09 +0000 Subject: Re: use-after-free in sctp_do_sm Message-Id: <1449248589.8611.10.camel@perches.com> List-Id: References: <20151203130525.GB4164@mrl.redhat.com> <566098BD.6010803@akamai.com> <1449172984.12092.0.camel@perches.com> <5660A1A7.3080301@akamai.com> <1449174246.12092.8.camel@perches.com> <5660A951.4000808@akamai.com> <1449175884.17296.2.camel@perches.com> <5661C3B8.2030902@akamai.com> In-Reply-To: <5661C3B8.2030902@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Jason Baron , Dmitry Vyukov Cc: Aaron Conole , Andrew Morton , LKML , Eric Dumazet , syzkaller , Vladislav Yasevich , linux-sctp@vger.kernel.org, netdev , Kostya Serebryany , Alexander Potapenko , Sasha Levin On Fri, 2015-12-04 at 11:47 -0500, Jason Baron wrote: > When DYNAMIC_DEBUG is enabled we have this wrapper from > include/linux/dynamic_debug.h: >=20 > if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) > >=20 > So the compiler is not emitting the side-effects in this > case. Huh? =A0Do I misunderstand what you are writing? You are testing a variable that is not generally set so the call is not being performed in the general case, but the compiler can not elide the code. If the variable was enabled via the control file, the __dynamic_pr_debug would be performed with the use-after-free.