]> git.ipfire.org Git - thirdparty/man-pages.git/commit
add_key.2: Empty payloads are not allowed in user-defined keys
authorMitch Walker <mitch@gearnine.com>
Wed, 8 Jun 2016 09:56:58 +0000 (11:56 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 8 Jun 2016 09:56:58 +0000 (11:56 +0200)
commit7f891e5db77b0547a40aa26c9339d487b7f77525
treef4aec91b0da955f355d9145870411ae84f4f399c
parent9787e2b681732b9a20f2ae67fbd0cbab8ec1538c
add_key.2: Empty payloads are not allowed in user-defined keys

iBoth add_key and the utility "keyctl add" return EINVAL when
attempting to add a user key with an empty or NULL payload.

The manpage implies that this should be valid.

From my reading of the kernel source, this has not been possible
since at least linux kernel commit 1da177e4 (2.6.12-rc2 on
2005-04-16).

Until kernel commit cf7f601c,
security/keys/user_defined.c:user_instantiate returned -EINVAL
if datalen <= 0.  That commit only moved this behavior to a new
user_preparse function, where it remains today in b562e44f
(4.5.0 on 2016-03-13).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/add_key.2