Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030859Ab2HHVJW (ORCPT ); Wed, 8 Aug 2012 17:09:22 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:39117 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001Ab2HHVJV (ORCPT ); Wed, 8 Aug 2012 17:09:21 -0400 MIME-Version: 1.0 In-Reply-To: <1463614.KLCBsoWyCC@sifl> References: <50215A7E.8000701@linaro.org> <2294220.dmCbVvF3Tg@sifl> <1463614.KLCBsoWyCC@sifl> Date: Wed, 8 Aug 2012 17:09:20 -0400 Message-ID: Subject: Re: NULL pointer dereference in selinux_ip_postroute_compat From: Eric Paris To: Paul Moore Cc: Eric Dumazet , John Stultz , "Serge E. Hallyn" , lkml , James Morris , selinux@tycho.nsa.gov, Eric Dumazet , john.johansen@canonical.com Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1013 Lines: 21 On Wed, Aug 8, 2012 at 5:03 PM, Paul Moore wrote: > On Wednesday, August 08, 2012 04:51:56 PM Eric Paris wrote: >> Could we add a __init function which does the security_sk_alloc() in >> the same file where we declared them? > > Is it safe to call security_sk_alloc() from inside another __init function? I > think in both the case of SELinux and Smack it shouldn't be a problem, but I'm > concerned about the more general case of calling a LSM hook potentially before > the LSM has been initialized. > > If that isn't an issue we could probably do something in ip_init(). The security_initcall() functions should happen way before __init functions. If an LSM busts, it's the LSM initializing itself too late not the code here being wrong... -- 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/