From patchwork Mon Nov 14 11:12:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 9427263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55C1060476 for ; Mon, 14 Nov 2016 11:45:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 499F5287A2 for ; Mon, 14 Nov 2016 11:45:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EAB3287BB; Mon, 14 Nov 2016 11:45:47 +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=-6.9 required=2.0 tests=BAYES_00,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 C4B13287AE for ; Mon, 14 Nov 2016 11:45:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933668AbcKNLpp (ORCPT ); Mon, 14 Nov 2016 06:45:45 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:23410 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932196AbcKNLpn (ORCPT ); Mon, 14 Nov 2016 06:45:43 -0500 Received: from fsav407.sakura.ne.jp (fsav407.sakura.ne.jp [133.242.250.106]) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id uAEBDLGC021673; Mon, 14 Nov 2016 20:13:21 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav407.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav407.sakura.ne.jp); Mon, 14 Nov 2016 20:13:21 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav407.sakura.ne.jp) Received: from ccsecurity.localdomain (softbank126227147111.bbtec.net [126.227.147.111]) (authenticated bits=0) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id uAEBDDmH021641 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 14 Nov 2016 20:13:21 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) From: Tetsuo Handa To: casey@schaufler-ca.com Cc: linux-security-module@vger.kernel.org, Tetsuo Handa Subject: [PATCH] Smack: Use GFP_KERNEL for smk_netlbl_mls(). Date: Mon, 14 Nov 2016 20:12:56 +0900 Message-Id: <1479121976-13429-2-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1479121976-13429-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> References: <1479121976-13429-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Since all callers of smk_netlbl_mls() are GFP_KERNEL context (smk_set_cipso() calls memdup_user_nul(), init_smk_fs() calls __kernfs_new_node(), smk_import_entry() calls kzalloc(GFP_KERNEL)), it is safe to use GFP_KERNEL from netlbl_catmap_setbit(). Signed-off-by: Tetsuo Handa --- security/smack/smack_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index 23e5808..1f1ac3d 100644 --- a/security/smack/smack_access.c +++ b/security/smack/smack_access.c @@ -509,7 +509,7 @@ int smk_netlbl_mls(int level, char *catset, struct netlbl_lsm_secattr *sap, if ((m & *cp) == 0) continue; rc = netlbl_catmap_setbit(&sap->attr.mls.cat, - cat, GFP_ATOMIC); + cat, GFP_KERNEL); if (rc < 0) { netlbl_catmap_free(sap->attr.mls.cat); return rc;