From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: use-after-free in sctp_do_sm Date: Fri, 04 Dec 2015 09:03:09 -0800 Message-ID: <1449248589.8611.10.camel@perches.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Aaron Conole , Andrew Morton , LKML , Eric Dumazet , syzkaller , Vladislav Yasevich , linux-sctp@vger.kernel.org, netdev , Kostya Serebryany , Alexander Potapenko , Sasha Levin To: Jason Baron , Dmitry Vyukov Return-path: In-Reply-To: <5661C3B8.2030902@akamai.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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.