Message ID | 20190409213946.1667-58-casey@schaufler-ca.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <selinux-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 471911805 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:41:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3473928857 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 291AD28885; Tue, 9 Apr 2019 21:41:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB9C928857 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbfDIVlw (ORCPT <rfc822;patchwork-selinux@patchwork.kernel.org>); Tue, 9 Apr 2019 17:41:52 -0400 Received: from sonic304-28.consmr.mail.ne1.yahoo.com ([66.163.191.154]:35820 "EHLO sonic304-28.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbfDIVlv (ORCPT <rfc822;selinux@vger.kernel.org>); Tue, 9 Apr 2019 17:41:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1554846104; bh=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qUTKFZ85pM4Wvz9.8ldNVIR48Efe X0DMn6nSfBYRG_bJMgfkIUXkw8kG1KUps0Djk5MVR1bh0q43zYP9PghMFN1qK4MF4qKYe43tLdqq gvOYGk8iAEBDj9LgiZVwmel8EeJCAAXkUz_OcHBT1mLstrnw0p3u_yGYn.H08K_huFPwaziLYQPT sz80qpsxgm.8eZqhossQ3t2Q8BcVopTRl33QSZ2KTX9DKYutpbKpm5bUGzndK30xE_HudgHIITG0 Jq4OGlF.fg8wEGyeli9FaxCSmdPZKY8pohRjFHk9IoIQGIXo_K_9QQqKEsSP8spMn9mmzei_7VUP hLWN5moXIqUKZ8rVHr4yblnlAM6hV_uN0zz1p1VYt2s6EtjpebfU4UTrWF_mkqYAUZWBaHoE0U23 FSupBOAcl1vYdVhBhCkhVkQZ9nI_CF3dQ_NRejyML5bMEICikHfF6yGEFY52F.0aGKvykbGEaHHo EiDdpw0Nc4YeJes3KeQpoiW5XDj93K5ptZRXXwvuEnjYqyIM_V6bHuUJ_22cupA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Apr 2019 21:41:44 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp416.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 3e563602cfa877b5908e791085320721; Tue, 09 Apr 2019 21:41:28 +0000 (UTC) From: Casey Schaufler <casey@schaufler-ca.com> To: casey.schaufler@intel.com, jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: casey@schaufler-ca.com Subject: [PATCH 57/59] SELinux: Use blob offset in current_sid Date: Tue, 9 Apr 2019 14:39:44 -0700 Message-Id: <20190409213946.1667-58-casey@schaufler-ca.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190409213946.1667-1-casey@schaufler-ca.com> References: <20190409213946.1667-1-casey@schaufler-ca.com> Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: <selinux.vger.kernel.org> X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
LSM: Module stacking for AppArmor
|
expand
|
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h index 59a3b1cd5ba9..c9a88b7a96a7 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h @@ -31,6 +31,8 @@ #include "flask.h" #include "avc.h" +extern struct lsm_blob_sizes selinux_blob_sizes; + struct task_security_struct { u32 osid; /* SID prior to last execve */ u32 sid; /* current SID */ @@ -45,7 +47,9 @@ struct task_security_struct { */ static inline u32 current_sid(void) { - const struct task_security_struct *tsec = current_security(); + const struct task_security_struct *tsec; + + tsec = current_cred()->security + selinux_blob_sizes.lbs_cred; return tsec->sid; } @@ -174,7 +178,6 @@ struct bpf_security_struct { u32 sid; /*SID of bpf obj creater*/ }; -extern struct lsm_blob_sizes selinux_blob_sizes; static inline struct task_security_struct *selinux_cred(const struct cred *cred) { return cred->security + selinux_blob_sizes.lbs_cred;
Replace the use of current_security() with a call to current_cred() so that the blob offset can be correctly applied. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> --- security/selinux/include/objsec.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)