From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756031AbbLDRDQ (ORCPT ); Fri, 4 Dec 2015 12:03:16 -0500 Received: from smtprelay0048.hostedemail.com ([216.40.44.48]:57863 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754123AbbLDRDO (ORCPT ); Fri, 4 Dec 2015 12:03:14 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:965:966:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1714:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3351:3622:3865:3870:3871:3873:3874:4321:4385:4390:4395:5007:6261:6742:8660:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12438:12517:12519:12740:13069:13148:13230:13311:13357:13894:14659:21080:30012:30054:30056:30064:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: front06_55f8deadaf44f X-Filterd-Recvd-Size: 2556 Message-ID: <1449248589.8611.10.camel@perches.com> Subject: Re: use-after-free in sctp_do_sm From: Joe Perches 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 Date: Fri, 04 Dec 2015 09:03:09 -0800 In-Reply-To: <5661C3B8.2030902@akamai.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> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.2-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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: > > if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) > > > So the compiler is not emitting the side-effects in this > case. Huh?  Do 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.