From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 7/15] sanitize AUDIT_MQ_SENDRECV Date: Wed, 17 Dec 2008 08:03:15 +0000 Message-ID: <20081217080315.GZ28946@ZenIV.linux.org.uk> References: <20081216235656.d7985f1d.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20081216235656.d7985f1d.akpm@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org To: Andrew Morton Cc: Al Viro , linux-audit@redhat.com, linux-kernel@vger.kernel.org List-Id: linux-audit@redhat.com On Tue, Dec 16, 2008 at 11:56:56PM -0800, Andrew Morton wrote: > > + 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. compat_mq_timedsend() et.al. essentially do copy_in_user() converting to 64bit and theh call sys_mq_...(). So you get kernel-native layout in the log. Similar for notification in compat_mq_notify(), etc.