From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 7/15] sanitize AUDIT_MQ_SENDRECV Date: Tue, 16 Dec 2008 23:56:56 -0800 Message-ID: <20081216235656.d7985f1d.akpm@linux-foundation.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mBH7vEmF004066 for ; Wed, 17 Dec 2008 02:57:14 -0500 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id mBH7v0m1011387 for ; Wed, 17 Dec 2008 02:57:00 -0500 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Al Viro Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org List-Id: linux-audit@redhat.com On Wed, 17 Dec 2008 05:12:10 +0000 Al Viro wrote: > > * logging the original value of *msg_prio in mq_timedreceive(2) > is insane - the argument is write-only (i.e. syscall always > ignores the original value and only overwrites it). > * merge __audit_mq_timed{send,receive} > * don't do copy_from_user() twice > * don't mess with allocations in auditsc part > * ... and don't bother checking !audit_enabled and !context in there - > we'd already checked for audit_dummy_context(). > > ... > > + if (copy_from_user(&ts, u_abs_timeout, > + sizeof(struct timespec))) Well that's odd. afacit timespec has different sizes on 32-bit and 64-bit userspace. But the old audit code did this copy too, and it presumably worked.