diff options
author | Eric Biggers <ebiggers@google.com> | 2019-02-14 19:20:01 +0300 |
---|---|---|
committer | James Morris <james.morris@microsoft.com> | 2019-02-16 01:12:08 +0300 |
commit | a08bf91ce28ed3ae7b6fef35d843fef8dc8c2cd9 (patch) | |
tree | 55aeebf54986fb1923cbee1d7f202e853b8f609b /lib | |
parent | 5ded5871030eb75017639148da0a58931dfbfc25 (diff) | |
download | linux-a08bf91ce28ed3ae7b6fef35d843fef8dc8c2cd9.tar.xz |
KEYS: allow reaching the keys quotas exactly
If the sysctl 'kernel.keys.maxkeys' is set to some number n, then
actually users can only add up to 'n - 1' keys. Likewise for
'kernel.keys.maxbytes' and the root_* versions of these sysctls. But
these sysctls are apparently supposed to be *maximums*, as per their
names and all documentation I could find -- the keyrings(7) man page,
Documentation/security/keys/core.rst, and all the mentions of EDQUOT
meaning that the key quota was *exceeded* (as opposed to reached).
Thus, fix the code to allow reaching the quotas exactly.
Fixes: 0b77f5bfb45c ("keys: make the keyring quotas controllable through /proc/sys")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions