]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
random: don't let 644 read-only sysctls be written to
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 28 Feb 2022 13:00:52 +0000 (14:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:36 +0000 (11:46 +0200)
commitd2c884e41bc5d72ba0bbdd4c5029f223614e616c
tree018c4aae2ea5d004bf8088a9b964dbc7a086e295
parentdd9970a9e068a0d44da347803c8eb6e4f9a91cb4
random: don't let 644 read-only sysctls be written to

commit 77553cf8f44863b31da242cf24671d76ddb61597 upstream.

We leave around these old sysctls for compatibility, and we keep them
"writable" for compatibility, but even after writing, we should keep
reporting the same value. This is consistent with how userspaces tend to
use sysctl_random_write_wakeup_bits, writing to it, and then later
reading from it and using the value.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c