From patchwork Tue Apr 9 21:39:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10892641 Return-Path: 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 2FEA91805 for ; Tue, 9 Apr 2019 21:41:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21792285C6 for ; Tue, 9 Apr 2019 21:41:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1549B28885; Tue, 9 Apr 2019 21:41:43 +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 BD58928857 for ; Tue, 9 Apr 2019 21:41:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727129AbfDIVlm (ORCPT ); Tue, 9 Apr 2019 17:41:42 -0400 Received: from sonic304-28.consmr.mail.ne1.yahoo.com ([66.163.191.154]:42093 "EHLO sonic304-28.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbfDIVll (ORCPT ); Tue, 9 Apr 2019 17:41:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1554846093; bh=VEDYIM3R1NMqedNbn6scDMcxUUfpt0y9Ccbwl5mHx6o=; h=From:To:Cc:Subject:Date:In-Reply-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m83K6B1rk4gPjPJ4Qhvvhk5VSjjggLYFRRKVCziojqwPcbBcGwHJQDPnHLWaOY STKRXRdaIs.apCR2D3oZyx_bMX7wDpX8efm50kFnUCVfoEMsQefPZfXl0JEB8hBqRSDi0DbfUW.U 5xnC5T2G8LEQ0skECC16vpCm2p9u3Byuybj5NjHxDOtPZt.SKNzMmFVyPOd7UbyeedEjHgQLYxpz KQ8YZjzx6kdSCMmWJGha0kIrJtTdACiHuSXtoZP7YnNam0d3.FwfVzHCgBk0BrqPQCmnMHuVZejm jcpJHJcuOOeId.IqNNMKI3PD6bBhbQfWD.yIxnRetGyK37Co22iVc3jcFtS_lpvnptMtFiBHxaJ4 LPYbQ7L7VaoigKV7PALWViH9jxRQHQRUDz7A2YO8RJbCldDyrKjswnK5DZjFknOkVngfA.a15aZz TYSagZEXos.dE52kxNodi470o8tsENFyoN2143RwADNtaNuCpOlgSk6TSbhaxjg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Apr 2019 21:41:33 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp408.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6a737b6f7572f7259a29fc213d8f0ed1; Tue, 09 Apr 2019 21:40:51 +0000 (UTC) From: Casey Schaufler 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 35/59] AppArmor: Remove unnecessary hook stub Date: Tue, 9 Apr 2019 14:39:22 -0700 Message-Id: <20190409213946.1667-36-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: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove the getpeersec_dgram hook stub. It's unnecessary and disrupts stacking. Signed-off-by: Casey Schaufler --- security/apparmor/lsm.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 24b638bd4305..76c409737370 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1094,15 +1094,9 @@ static int apparmor_socket_getpeersec_stream(struct socket *sock, * @secid: pointer to where to put the secid of the packet * * Sets the netlabel socket state on sk from parent + * + * The TODO stub interfered with stacking and was removed - Casey */ -static int apparmor_socket_getpeersec_dgram(struct socket *sock, - struct sk_buff *skb, - struct lsm_export *l) - -{ - /* TODO: requires secid support */ - return -ENOPROTOOPT; -} /** * apparmor_sock_graft - Initialize newly created socket @@ -1202,8 +1196,6 @@ static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = { #endif LSM_HOOK_INIT(socket_getpeersec_stream, apparmor_socket_getpeersec_stream), - LSM_HOOK_INIT(socket_getpeersec_dgram, - apparmor_socket_getpeersec_dgram), LSM_HOOK_INIT(sock_graft, apparmor_sock_graft), #ifdef CONFIG_NETWORK_SECMARK LSM_HOOK_INIT(inet_conn_request, apparmor_inet_conn_request),