From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-f66.google.com ([209.85.161.66]:40494 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbeJBE2G (ORCPT ); Tue, 2 Oct 2018 00:28:06 -0400 Received: by mail-yw1-f66.google.com with SMTP id l79-v6so2067144ywc.7 for ; Mon, 01 Oct 2018 14:48:15 -0700 (PDT) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com. [209.85.219.180]) by smtp.gmail.com with ESMTPSA id q1-v6sm915295ywa.92.2018.10.01.14.48.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 14:48:12 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id h1-v6so4166406ybm.4 for ; Mon, 01 Oct 2018 14:48:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <8010a7d0-c6a0-b327-d5dd-6857d6d42561@schaufler-ca.com> References: <8010a7d0-c6a0-b327-d5dd-6857d6d42561@schaufler-ca.com> From: Kees Cook Date: Mon, 1 Oct 2018 14:48:10 -0700 Message-ID: Subject: Re: [PATCH 21/19] LSM: Cleanup and fixes from Tetsuo Handa To: Casey Schaufler Cc: LSM , James Morris , SE Linux , LKLM , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "linux-fsdevel@vger.kernel.org" , Alexey Dobriyan , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , Salvatore Mesoraca Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Sep 26, 2018 at 2:57 PM, Casey Schaufler wrote: > lsm_early_cred()/lsm_early_task() are called from only __init functions. > > lsm_cred_alloc()/lsm_file_alloc() are called from only security/security.c . > > lsm_early_inode() should be avoided because it is not appropriate to > call panic() when lsm_early_inode() is called after __init phase. > > Since all free hooks are called when one of init hooks failed, each > free hook needs to check whether init hook was called. > > The original changes are from Tetsuo Handa. I have made minor > changes in some places, but this is mostly his code. > > Signed-off-by: Casey Schaufler > --- > include/linux/lsm_hooks.h | 6 ++---- > security/security.c | 27 ++++----------------------- > security/selinux/hooks.c | 5 ++++- > security/selinux/include/objsec.h | 2 ++ > security/smack/smack_lsm.c | 8 +++++++- > 5 files changed, 19 insertions(+), 29 deletions(-) I've split this across the various commits they touch: Infrastructure management of the cred security blob LSM: Infrastructure management of the file security LSM: Infrastructure management of the inode security LSM: Infrastructure management of the task security LSM: Blob sharing support for S.A.R.A and LandLock Based on these changes, I've uploaded the "v4.1", or "Casey is on vacation", tree here: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/log/?h=lsm/blob-sharing-v4.1 I'm going to work on a merged series for the "arbitrary ordering" and "blob-sharing" trees next... -Kees -- Kees Cook Pixel Security