From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758839AbbGHP7p (ORCPT ); Wed, 8 Jul 2015 11:59:45 -0400 Received: from smtprelay0166.hostedemail.com ([216.40.44.166]:43659 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758684AbbGHP7m (ORCPT ); Wed, 8 Jul 2015 11:59:42 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3872:3873:3874:4321:4605:5007:6261:7875:10004:10400:10848:10967:11026:11232:11233:11473:11658:11914:12043:12295:12438:12517:12519:12555:12740:13069:13311:13357:14096:14097:21080,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 X-HE-Tag: beds68_1a3fe69267c43 X-Filterd-Recvd-Size: 2132 Date: Wed, 8 Jul 2015 11:59:39 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Jan Kara , Paul Moore , Andrew Morton Subject: Re: [PATCH] Revert: audit: Fix check of return value of strnlen_user() Message-ID: <20150708115939.60cd659c@gandalf.local.home> In-Reply-To: References: <20150708112607.03df9c2a@gandalf.local.home> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Jul 2015 08:53:34 -0700 Linus Torvalds wrote: > Anyway, to make a long rant more on-point, does this alternative > version work for you? I'll test it again, even though I already did (see below). > > diff --git a/kernel/auditsc.c b/kernel/auditsc.c > index 09c65640cad6..e85bdfd15fed 100644 > --- a/kernel/auditsc.c > +++ b/kernel/auditsc.c > @@ -1021,8 +1021,7 @@ static int audit_log_single_execve_arg( > * for strings that are too long, we should not have created > * any. > */ > - if (unlikely((len == 0) || len > MAX_ARG_STRLEN - 1)) { > - WARN_ON(1); > + if (WARN_ON_ONCE(len < 0 || len > MAX_ARG_STRLEN - 1)) { > send_sig(SIGKILL, current, 0); > return -1; > } > > because that really looks better to me. > That was what I originally did ;-) But then I figured I would just revert the patch with a simple: git show 0b08c5e59441d | patch -p1 -R and submit that. -- Steve