Skip to content

Commit

Permalink
KEYS: remove CONFIG_KEYS_COMPAT
Browse files Browse the repository at this point in the history
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.)

Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
  • Loading branch information
Eric Biggers authored and Jarkko Sakkinen committed Dec 12, 2019
1 parent 37d4e84 commit 601f009
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions security/keys/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,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 KEYS_REQUEST_CACHE
bool "Enable temporary caching of the last request_key() result"
depends on KEYS
Expand Down
2 changes: 1 addition & 1 deletion security/keys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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
Expand Down
5 changes: 0 additions & 5 deletions security/keys/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,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)
Expand Down
4 changes: 2 additions & 2 deletions security/keys/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,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);
Expand All @@ -279,7 +279,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,
Expand Down

0 comments on commit 601f009

Please sign in to comment.