From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758562AbbGHTGn (ORCPT ); Wed, 8 Jul 2015 15:06:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51578 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754659AbbGHTGd (ORCPT ); Wed, 8 Jul 2015 15:06:33 -0400 From: Paul Moore To: Steven Rostedt Cc: Linus Torvalds , LKML , Jan Kara , Andrew Morton Subject: Re: [PATCH] Revert: audit: Fix check of return value of strnlen_user() Date: Wed, 08 Jul 2015 15:06:32 -0400 Message-ID: <1457123.W9SXFTB1AL@sifl> Organization: Red Hat User-Agent: KMail/4.14.8 (Linux/3.16.7-gentoo; KDE/4.14.9; x86_64; ; ) In-Reply-To: <20150708122943.4716f7c3@gandalf.local.home> References: <20150708112607.03df9c2a@gandalf.local.home> <20150708120249.2ca05313@gandalf.local.home> <20150708122943.4716f7c3@gandalf.local.home> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, July 08, 2015 12:29:43 PM Steven Rostedt wrote: > 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! Acked-by: Paul Moore Sorry to be late in replying, and I see that this is already in Linus' tree so the ack above it probably a bit pointless, but thanks for reporting this and providing a fix. > 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; > } -- paul moore security @ redhat