linux/security/keys
Eric Biggers 57b0e31453 KEYS: fix parsing invalid pkey info string
We need to check the return value of match_token() for Opt_err before
doing anything with it.

[ Not only did the old "-1" value for Opt_err cause problems for the
  __test_and_set_bit(), as fixed in commit 94c13f66e1 ("security:
  don't use a negative Opt_err token index"), but accessing
  "args[0].from" is invalid for the Opt_err case, as pointed out by Eric
  later.  - Linus ]

Reported-by: syzbot+a22e0dc07567662c50bc@syzkaller.appspotmail.com
Fixes: 00d60fd3b9 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Cc: stable@kernel.org # 4.20
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-01-01 13:13:19 -08:00
..
encrypted-keys libnvdimm for 4.21 2018-12-28 15:05:13 -08:00
Kconfig
Makefile KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2] 2018-10-26 09:30:46 +01:00
big_key.c
compat.c KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2] 2018-10-26 09:30:46 +01:00
compat_dh.c
dh.c
gc.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
internal.h keys: Export lookup_user_key to external users 2018-12-13 17:54:12 -08:00
key.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
keyctl.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
keyctl_pkey.c KEYS: fix parsing invalid pkey info string 2019-01-01 13:13:19 -08:00
keyring.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
permission.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
persistent.c
proc.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
process_keys.c libnvdimm for 4.21 2018-12-28 15:05:13 -08:00
request_key.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
request_key_auth.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00
sysctl.c
trusted.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-12-27 13:53:32 -08:00
user_defined.c security: audit and remove any unnecessary uses of module.h 2018-12-12 14:58:51 -08:00