Files
kernel_arpi/kernel
Kees Cook 898e9be82a UPSTREAM: module: Correctly truncate sysfs sections output
commit 11990a5bd7 upstream.

The only-root-readable /sys/module/$module/sections/$section files
did not truncate their output to the available buffer size. While most
paths into the kernfs read handlers end up using PAGE_SIZE buffers,
it's possible to get there through other paths (e.g. splice, sendfile).
Actually limit the output to the "count" passed into the read function,
and report it back correctly. *sigh*

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/20200805002015.GE23458@shao2-debian
Fixes: ed66f991bb ("module: Refactor section attr into bin attribute")
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 163100336
Cc: Saravana Kannan <saravanak@google.com
(cherry picked from commit 11990a5bd7)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I61cd70ce32bf06a6ec1be971a60101729606cd32
2020-09-03 14:26:03 +02:00
..
2020-08-07 10:07:58 +02:00
2020-07-23 12:36:54 +02:00
2020-04-29 17:24:24 +02:00
2020-08-26 11:11:38 +02:00
2019-05-28 17:46:43 -04:00
2020-04-29 19:12:47 +02:00
2020-06-22 11:43:59 +02:00
2020-01-17 19:48:42 +01:00
2020-05-20 12:49:59 +02:00
2020-07-16 09:48:45 +02:00
2020-01-13 18:54:56 +00:00
2019-05-24 20:16:01 +02:00
2020-03-25 08:25:58 +01:00
2019-11-25 11:46:31 -08:00
2020-01-04 19:40:03 +01:00
2020-01-09 10:19:54 +01:00
2020-05-20 08:20:13 +02:00