Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 16 Aug 2002 03:05:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 16 Aug 2002 03:05:43 -0400 Received: from cerebus.wirex.com ([65.102.14.138]:28403 "EHLO figure1.int.wirex.com") by vger.kernel.org with ESMTP id ; Fri, 16 Aug 2002 03:05:42 -0400 Date: Fri, 16 Aug 2002 00:06:29 -0700 From: Chris Wright To: James Morris Cc: "David S. Miller" , kuznet@ms2.inr.ac.ru, Andi Kleen , linux-kernel@vger.kernel.org, Matthew Wilcox Subject: Re: [PATCH][RFC] sigurg/sigio cleanup for 2.5.31 Message-ID: <20020816000629.A15216@figure1.int.wirex.com> Mail-Followup-To: James Morris , "David S. Miller" , kuznet@ms2.inr.ac.ru, Andi Kleen , linux-kernel@vger.kernel.org, Matthew Wilcox References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jmorris@intercode.com.au on Fri, Aug 16, 2002 at 03:16:57AM +1000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 866 Lines: 27 * James Morris (jmorris@intercode.com.au) wrote: > @@ -95,15 +96,14 @@ > prev = &odn->dn_next; > } > > - error = security_ops->file_set_fowner(filp); > + lock_kernel(); > + error = f_setown(filp, current->pid); > + unlock_kernel(); > if (error) { > write_unlock(&dn_lock); > return error; > } This propagates a leak which John Levon found in current mainline. Needs a kmem_cache_free(dn_cache, dn) before returning. You may consider goto for common unlock/return path. Is BKL best way to protect f_owner? cheers, -chris -- Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net - 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/