Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758904AbbGHQ3r (ORCPT ); Wed, 8 Jul 2015 12:29:47 -0400 Received: from smtprelay0154.hostedemail.com ([216.40.44.154]:33243 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758809AbbGHQ3p (ORCPT ); Wed, 8 Jul 2015 12:29:45 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3871:3872:3873:3874:4321:4362:4385:5007:6261:7875:7903:8527:9040:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12050:12296:12438:12517:12519:12555:12663:12740:13069:13311:13357:13618: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: mask13_8f3227159a829 X-Filterd-Recvd-Size: 2354 Date: Wed, 8 Jul 2015 12:29:43 -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: <20150708122943.4716f7c3@gandalf.local.home> In-Reply-To: <20150708120249.2ca05313@gandalf.local.home> References: <20150708112607.03df9c2a@gandalf.local.home> <20150708115939.60cd659c@gandalf.local.home> <20150708120249.2ca05313@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 Content-Length: 1479 Lines: 39 On Wed, 8 Jul 2015 12:02:49 -0400 Steven Rostedt wrote: > > Well, any testing will have to wait. The reason I found this is because > it caused my own tests to fail for a bug fix I'm testing (unrelated to > this) that I'm getting ready to send to you. My box to run this on is > back to running those tests, which can take several hours. Oh well, my tests just stumbled over another unrelated 4.2-rc1 bug (I need to dig into this one now :-( ). But that freed up my machine to test this. I tested the following patch. Feel free to author it yourself and just add my reported/tested-by tags, or give it to me. Either way, I don't care. I just want it fixed so that it doesn't make my own tests fail. Thanks! -- Steve 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(struct audit_context *context, * 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/