Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100AbXE3SSS (ORCPT ); Wed, 30 May 2007 14:18:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753536AbXE3SSD (ORCPT ); Wed, 30 May 2007 14:18:03 -0400 Received: from smtp1.linux-foundation.org ([207.189.120.13]:58542 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408AbXE3SSB (ORCPT ); Wed, 30 May 2007 14:18:01 -0400 Date: Wed, 30 May 2007 11:17:43 -0700 From: Andrew Morton To: Jens Axboe Cc: James Morris , Ingo Molnar , linux-kernel@vger.kernel.org, Stephen Smalley Subject: Re: [PATCH][RFC] security: revalidate rw permissions for sys_splice and sys_vmsplice Message-Id: <20070530111743.e638c841.akpm@linux-foundation.org> In-Reply-To: <20070530071500.GU15559@kernel.dk> References: <20070530071500.GU15559@kernel.dk> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-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 X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1107 Lines: 37 On Wed, 30 May 2007 09:15:01 +0200 Jens Axboe wrote: > On Tue, May 29 2007, James Morris wrote: > > Revalidate read/write permissions for splice(2) and vmslice(2), in case > > security policy has changed since the files were opened. > > I guess it was inevitably going to happen :-) > > Signed-off-by: Jens Axboe > Probably acked-by was more appropriate. James, is this considered needed-for-2.6.22? > + ret = security_file_permission(out, MAY_WRITE); > + if (unlikely(ret < 0)) > + return ret; ot: all the unlikely()s are irksome. I wonder if there was some way of doing this in security_file_permission() instead. eg: static inline int security_file_permission (struct file *file, int mask) { int ret = security_ops->file_permission (file, mask); if (likely(ret == 0)) return 0; return ret; } - 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/