linux-stable/kernel/module
Harshit Mogalapalli d36f6efbe0 module: Fix use-after-free bug in read_file_mod_stats()
Smatch warns:
	kernel/module/stats.c:394 read_file_mod_stats()
	warn: passing freed memory 'buf'

We are passing 'buf' to simple_read_from_buffer() after freeing it.

Fix this by changing the order of 'simple_read_from_buffer' and 'kfree'.

Fixes: df3e764d8e ("module: add debug stats to help identify memory pressure")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2023-05-22 14:13:13 -07:00
..
debug_kmemleak.c
decompress.c module: add debug stats to help identify memory pressure 2023-04-18 11:15:24 -07:00
dups.c module: include internal.h in module/dups.c 2023-05-02 20:33:36 -07:00
internal.h modules-6.4-rc1 2023-04-27 16:36:55 -07:00
kallsyms.c modules-6.4-rc1 2023-04-27 16:36:55 -07:00
Kconfig module: add debugging auto-load duplicate module support 2023-04-19 17:26:01 -07:00
kdb.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
kmod.c module: add debugging auto-load duplicate module support 2023-04-19 17:26:01 -07:00
livepatch.c livepatch: fix ELF typos 2023-03-09 11:08:24 +01:00
main.c module: avoid allocation if module is already present and ready 2023-04-18 11:15:24 -07:00
Makefile module: add debugging auto-load duplicate module support 2023-04-19 17:26:01 -07:00
procfs.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
signing.c
stats.c module: Fix use-after-free bug in read_file_mod_stats() 2023-05-22 14:13:13 -07:00
strict_rwx.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
sysfs.c module: remove redundant module_sysfs_initialized variable 2022-11-11 10:19:52 -08:00
tracking.c module: add debug stats to help identify memory pressure 2023-04-18 11:15:24 -07:00
tree_lookup.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
version.c