From patchwork Sat Sep 20 10:40:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 4940981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72A46BEEA5 for ; Sat, 20 Sep 2014 10:44:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 801242016C for ; Sat, 20 Sep 2014 10:44:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B132220138 for ; Sat, 20 Sep 2014 10:44:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XVI7m-00061Y-QR; Sat, 20 Sep 2014 10:42:42 +0000 Received: from www262.sakura.ne.jp ([2001:e42:101:1:202:181:97:72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XVI7j-0005uQ-1b for linux-arm-kernel@lists.infradead.org; Sat, 20 Sep 2014 10:42:39 +0000 Received: from fsav403.sakura.ne.jp (fsav403.sakura.ne.jp [133.242.250.102]) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id s8KAeDEP001705; Sat, 20 Sep 2014 19:40:13 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav403.sakura.ne.jp (F-Secure/virusgw_smtp/412/fsav403.sakura.ne.jp); Sat, 20 Sep 2014 19:40:13 +0900 (JST) X-Virus-Status: clean(F-Secure/virusgw_smtp/412/fsav403.sakura.ne.jp) Received: from CLAMP (KD175108057186.ppp-bb.dion.ne.jp [175.108.57.186]) (authenticated bits=0) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id s8KAeCZn001699; Sat, 20 Sep 2014 19:40:12 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) To: keescook@chromium.org, linux-kernel@vger.kernel.org Subject: [PATCH 3.17-rc5] Fix confusing PFA_NO_NEW_PRIVS constant. From: Tetsuo Handa References: <201409192053.IHJ35462.JLOMOSOFFVtQFH@I-love.SAKURA.ne.jp> <541D16EA.70407@huawei.com> In-Reply-To: <541D16EA.70407@huawei.com> Message-Id: <201409201940.AHG21834.LJOFFHSFQOtVMO@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Sat, 20 Sep 2014 19:40:30 +0900 Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140920_034239_310037_CDAA86B1 X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: 0.0 (/) Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, wad@chromium.org, linux-api@vger.kernel.org, x86@kernel.org, oleg@redhat.com, luto@amacapital.net, linux-security-module@vger.kernel.org, jln@chromium.org, mtk.manpages@gmail.com, james.l.morris@oracle.com, drysdale@google.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Can you apply below patch before new PFA_* are defined? Cgroups code might want to define PFA_SPREAD_PAGE as 1 and PFA_SPREAD_SLAB as 2. ---------------------------------------- >From 8543e68adb210142fa347d8bc9d83df0bb2c5291 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Sat, 20 Sep 2014 19:24:23 +0900 Subject: [PATCH 3.17-rc5] Fix confusing PFA_NO_NEW_PRIVS constant. Commit 1d4457f99928 ("sched: move no_new_privs into new atomic flags") defined PFA_NO_NEW_PRIVS as hexadecimal value, but it is confusing because it is used as bit number. Redefine it as decimal bit number. Signed-off-by: Tetsuo Handa Acked-by: Kees Cook --- include/linux/sched.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 5c2c885..4557765 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1957,7 +1957,7 @@ static inline void memalloc_noio_restore(unsigned int flags) } /* Per-process atomic flags. */ -#define PFA_NO_NEW_PRIVS 0x00000001 /* May not gain new privileges. */ +#define PFA_NO_NEW_PRIVS 0 /* May not gain new privileges. */ static inline bool task_no_new_privs(struct task_struct *p) {