Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757897AbbBEPOj (ORCPT ); Thu, 5 Feb 2015 10:14:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38621 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753480AbbBEPOi (ORCPT ); Thu, 5 Feb 2015 10:14:38 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20150205023423.8382.69433.stgit@pluto.fritz.box> References: <20150205023423.8382.69433.stgit@pluto.fritz.box> <20150205021553.8382.16297.stgit@pluto.fritz.box> To: Ian Kent Cc: dhowells@redhat.com, Kernel Mailing List , Oleg Nesterov , Trond Myklebust , "J. Bruce Fields" , Benjamin Coddington , Al Viro , Jeff Layton , "Eric W. Biederman" Subject: Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12364.1423149270.1@warthog.procyon.org.uk> Date: Thu, 05 Feb 2015 15:14:30 +0000 Message-ID: <12365.1423149270@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 752 Lines: 29 Ian Kent wrote: > +#include Is that actually needed? > + rki = kmalloc(sizeof(*rki), GFP_KERNEL); > + if (!rki) > + return -ENOMEM; > + > + if (use_ns) { > + tsk = umh_get_init_pid(); > + if (IS_ERR(tsk)) > + return PTR_ERR(tsk); Memory leak of rki. > + /* If running within a container use the container namespace */ > + if (current->nsproxy->net_ns != &init_net) Is that a viable check? Is it possible to have a container that shares networking details? David -- 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/