From patchwork Tue Jun 13 06:09:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9783203 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 EE7A8602DC for ; Tue, 13 Jun 2017 06:10:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE56328696 for ; Tue, 13 Jun 2017 06:10:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF852286D1; Tue, 13 Jun 2017 06:10:40 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 8699028696 for ; Tue, 13 Jun 2017 06:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752129AbdFMGKi (ORCPT ); Tue, 13 Jun 2017 02:10:38 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34691 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752100AbdFMGKh (ORCPT ); Tue, 13 Jun 2017 02:10:37 -0400 Received: by mail-pf0-f194.google.com with SMTP id d5so6755927pfe.1; Mon, 12 Jun 2017 23:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=pix2U4KKJLFlWkaR+6790jdDA2eQ6WrFL7N+etq43wg=; b=OuKCAsyWSAWKsQdM4N19JaQSrdprPn6uTTVy6kGAtq9ljoMH6XOB89xwZztgLTcyVF arwsX7tdD9M/Q3wOPNrldE0RTiZRd2DKLb9wH/fdbg5TTstfzVxpLmD+eSC8iDTGmZg2 /nTsI4Ca5EA1AHLNxpBVNbGDO9yjamMD6lQDbDWibhcyHMrz7+N87b8/jzb0YiQopcv8 zKo8Q2udBEvqS2SnKZvGG6ZnBunRICTC7ZdwnLwUwZPJRQlxXvdo1oXet6Tmv/x5HnJM BE1M/HA/zf1h/9UBZd/Bo5FCI7kQYwUAuZcdiHTX8nrxMTJW9roG5Dsu5BMZZtwvJbkQ Eiyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pix2U4KKJLFlWkaR+6790jdDA2eQ6WrFL7N+etq43wg=; b=R90TvJnFqJ9c3sZuLArnOKo3x6iN4pQcuT30MYU2aiTQeNQxJySXzNqhRrCuiU+rlh RnXdEOgJqUWUog6Aml80JH8B/vM6dqVhxdMlja9qz5AP0DVk4hPV3xjy05HqJMcCB9qN dBIm7Mq+96TcEANBULv7XP4Vinz8ImHGmKZeZHRN+S9XuaMlo32OzIjjTniAvfzjdWId cfRv65Xur/nCTVkzSxA1rf8WlZHjeHr+cDcmH9khCXZYwrV26SrlUvnofdD3XoY87BNa Bcu4xRGVGeeXQLlYjJkHvpkGg2ueUm1jonxsb0dvNH0WScR/n2iLvWOaG3IzyLdIJkr9 oWGw== X-Gm-Message-State: AODbwcDu/PgUJspu8RmcV7NuNczYeMXSAq2j0sqXpqKQyWps/IQc8L01 SkaU0GUCZ+ZmHhA55Hg= X-Received: by 10.99.119.2 with SMTP id s2mr17285646pgc.197.1497334237019; Mon, 12 Jun 2017 23:10:37 -0700 (PDT) Received: from zzz.hsd1.wa.comcast.net (c-73-239-167-150.hsd1.wa.comcast.net. [73.239.167.150]) by smtp.gmail.com with ESMTPSA id d19sm22217911pfd.35.2017.06.12.23.10.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 23:10:36 -0700 (PDT) From: Eric Biggers To: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org, David Howells , Eric Biggers Subject: [PATCH] KEYS: remove CONFIG_KEYS_COMPAT Date: Mon, 12 Jun 2017 23:09:25 -0700 Message-Id: <20170613060925.17121-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.13.1 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers KEYS_COMPAT now always takes the value of COMPAT && KEYS. But the security/keys/ directory is only compiled if KEYS is enabled, so in practice KEYS_COMPAT is the same as COMPAT. Therefore, remove the unnecessary KEYS_COMPAT and just use COMPAT directly. (Also remove an outdated comment from compat.c.) Signed-off-by: Eric Biggers --- security/keys/Kconfig | 4 ---- security/keys/Makefile | 2 +- security/keys/compat.c | 5 ----- security/keys/internal.h | 4 ++-- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/security/keys/Kconfig b/security/keys/Kconfig index a7a23b5541f8..f5d96996baa6 100644 --- a/security/keys/Kconfig +++ b/security/keys/Kconfig @@ -20,10 +20,6 @@ config KEYS If you are unsure as to whether this is required, answer N. -config KEYS_COMPAT - def_bool y - depends on COMPAT && KEYS - config PERSISTENT_KEYRINGS bool "Enable register of persistent per-UID keyrings" depends on KEYS diff --git a/security/keys/Makefile b/security/keys/Makefile index 57dff0c15809..6d31eca7c602 100644 --- a/security/keys/Makefile +++ b/security/keys/Makefile @@ -16,7 +16,7 @@ obj-y := \ request_key_auth.o \ user_defined.o compat-obj-$(CONFIG_KEY_DH_OPERATIONS) += compat_dh.o -obj-$(CONFIG_KEYS_COMPAT) += compat.o $(compat-obj-y) +obj-$(CONFIG_COMPAT) += compat.o $(compat-obj-y) obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_SYSCTL) += sysctl.o obj-$(CONFIG_PERSISTENT_KEYRINGS) += persistent.o diff --git a/security/keys/compat.c b/security/keys/compat.c index e87c89c0177c..d7445946b701 100644 --- a/security/keys/compat.c +++ b/security/keys/compat.c @@ -50,11 +50,6 @@ static long compat_keyctl_instantiate_key_iov( /* * The key control system call, 32-bit compatibility version for 64-bit archs - * - * This should only be called if the 64-bit arch uses weird pointers in 32-bit - * mode or doesn't guarantee that the top 32-bits of the argument registers on - * taking a 32-bit syscall are zero. If you can, you should call sys_keyctl() - * directly. */ COMPAT_SYSCALL_DEFINE5(keyctl, u32, option, u32, arg2, u32, arg3, u32, arg4, u32, arg5) diff --git a/security/keys/internal.h b/security/keys/internal.h index c0f8682eba69..0cc7333408d0 100644 --- a/security/keys/internal.h +++ b/security/keys/internal.h @@ -271,7 +271,7 @@ extern long keyctl_dh_compute(struct keyctl_dh_params __user *, char __user *, size_t, struct keyctl_kdf_params __user *); extern long __keyctl_dh_compute(struct keyctl_dh_params __user *, char __user *, size_t, struct keyctl_kdf_params *); -#ifdef CONFIG_KEYS_COMPAT +#ifdef CONFIG_COMPAT extern long compat_keyctl_dh_compute(struct keyctl_dh_params __user *params, char __user *buffer, size_t buflen, struct compat_keyctl_kdf_params __user *kdf); @@ -286,7 +286,7 @@ static inline long keyctl_dh_compute(struct keyctl_dh_params __user *params, return -EOPNOTSUPP; } -#ifdef CONFIG_KEYS_COMPAT +#ifdef CONFIG_COMPAT static inline long compat_keyctl_dh_compute( struct keyctl_dh_params __user *params, char __user *buffer, size_t buflen,