Will Shiu
74f6f59126
locks: fix KASAN: use-after-free in trace_event_raw_event_filelock_lock
...
As following backtrace, the struct file_lock request , in posix_lock_inode
is free before ftrace function using.
Replace the ftrace function ahead free flow could fix the use-after-free
issue.
[name:report&]===============================================
BUG:KASAN: use-after-free in trace_event_raw_event_filelock_lock+0x80/0x12c
[name:report&]Read at addr f6ffff8025622620 by task NativeThread/16753
[name:report_hw_tags&]Pointer tag: [f6], memory tag: [fe]
[name:report&]
BT:
Hardware name: MT6897 (DT)
Call trace:
dump_backtrace+0xf8/0x148
show_stack+0x18/0x24
dump_stack_lvl+0x60/0x7c
print_report+0x2c8/0xa08
kasan_report+0xb0/0x120
__do_kernel_fault+0xc8/0x248
do_bad_area+0x30/0xdc
do_tag_check_fault+0x1c/0x30
do_mem_abort+0x58/0xbc
el1_abort+0x3c/0x5c
el1h_64_sync_handler+0x54/0x90
el1h_64_sync+0x68/0x6c
trace_event_raw_event_filelock_lock+0x80/0x12c
posix_lock_inode+0xd0c/0xd60
do_lock_file_wait+0xb8/0x190
fcntl_setlk+0x2d8/0x440
...
[name:report&]
[name:report&]Allocated by task 16752:
...
slab_post_alloc_hook+0x74/0x340
kmem_cache_alloc+0x1b0/0x2f0
posix_lock_inode+0xb0/0xd60
...
[name:report&]
[name:report&]Freed by task 16752:
...
kmem_cache_free+0x274/0x5b0
locks_dispose_list+0x3c/0x148
posix_lock_inode+0xc40/0xd60
do_lock_file_wait+0xb8/0x190
fcntl_setlk+0x2d8/0x440
do_fcntl+0x150/0xc18
...
Signed-off-by: Will Shiu <Will.Shiu@mediatek.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
2023-08-24 10:42:19 -04:00
..
2023-05-24 08:42:16 -06:00
2023-05-24 08:42:17 -06:00
2023-05-24 08:42:17 -06:00
2023-06-26 11:52:12 -07:00
2023-06-15 09:22:24 +02:00
2023-05-24 08:42:17 -06:00
2023-06-26 12:47:20 -07:00
2023-06-26 10:14:36 -07:00
2023-06-26 11:52:12 -07:00
2023-05-24 08:42:16 -06:00
2023-04-03 09:23:54 +02:00
2023-05-24 08:42:17 -06:00
2023-05-23 19:46:09 -07:00
2023-02-27 10:04:49 -08:00
2023-03-13 12:36:34 +01:00
2023-04-26 16:07:23 -07:00
2023-05-24 08:42:17 -06:00
2023-02-23 14:41:48 -08:00
2023-06-26 12:47:20 -07:00
2023-05-24 08:42:17 -06:00
2023-05-24 08:42:17 -06:00
2023-06-26 12:47:20 -07:00
2023-06-26 12:47:20 -07:00
2023-05-24 08:42:17 -06:00
2023-02-23 17:55:40 -08:00
2023-05-24 08:42:17 -06:00
2023-06-26 12:47:20 -07:00
2023-05-24 08:42:17 -06:00
2023-05-24 08:42:17 -06:00
2023-05-24 08:42:17 -06:00
2023-05-24 08:42:17 -06:00
2023-04-21 14:52:05 -07:00
2023-06-01 09:13:31 -06:00
2023-04-14 19:38:50 -04:00
2023-06-26 11:52:12 -07:00
2023-06-26 12:47:20 -07:00
2023-05-24 08:42:16 -06:00
2023-06-12 12:16:34 -04:00
2023-05-24 08:42:17 -06:00
2023-04-27 19:42:02 -07:00
2023-06-26 12:47:20 -07:00
2023-04-13 13:13:52 -07:00
2023-06-21 15:05:32 -04:00
2023-06-26 12:47:20 -07:00
2023-04-25 12:36:55 +02:00
2023-06-26 11:52:12 -07:00
2023-05-24 08:42:17 -06:00
2023-06-26 12:47:20 -07:00
2023-05-24 08:42:17 -06:00
2023-05-24 08:42:16 -06:00
2023-06-26 11:52:12 -07:00
2023-06-26 15:32:39 -07:00
2023-06-05 10:56:46 -06:00
2023-03-14 12:56:30 -06:00
2023-03-14 12:56:30 -06:00
2023-04-14 13:06:50 +02:00
2023-05-24 08:42:17 -06:00
2023-06-20 07:19:15 -06:00
2023-05-24 08:42:17 -06:00
2023-06-26 11:52:12 -07:00
2023-06-26 11:52:12 -07:00
2023-05-24 08:42:17 -06:00
2023-06-26 11:52:12 -07:00
2023-05-24 08:42:17 -06:00
2023-04-13 13:13:54 -07:00
2023-05-24 08:42:17 -06:00
2023-06-20 22:47:55 -07:00
2023-06-26 12:47:20 -07:00
2023-06-26 12:47:20 -07:00
2023-06-15 09:22:23 +02:00
2023-03-30 08:51:48 +02:00
2023-04-08 13:45:37 -07:00
2023-04-27 19:57:00 -07:00
2023-06-26 12:47:20 -07:00
2023-05-15 09:42:01 +02:00
2023-06-26 09:50:21 -07:00
2023-05-17 09:16:59 +02:00
2023-04-05 18:06:23 -07:00
2023-06-14 06:58:18 -06:00
2023-06-15 09:22:23 +02:00
2023-06-26 09:50:21 -07:00
2023-04-28 15:57:53 -07:00
2023-02-20 11:53:11 -08:00
2023-06-19 18:16:38 +02:00
2023-03-09 22:46:21 -05:00
2023-06-07 21:49:55 +02:00
2023-05-06 08:28:58 -07:00
2023-06-26 12:47:20 -07:00
2023-06-26 10:14:36 -07:00
2023-05-24 16:29:21 -05:00
2023-04-03 09:23:54 +02:00
2023-08-24 10:42:19 -04:00
2023-06-26 12:47:20 -07:00
2023-04-18 16:30:02 -07:00
2023-06-26 10:14:36 -07:00
2023-06-26 10:27:04 -07:00
2023-04-20 22:55:35 -04:00
2023-06-26 10:14:36 -07:00
2023-05-12 17:17:27 +02:00
2023-05-19 04:30:22 +02:00
2023-05-19 04:30:22 +02:00
2023-03-06 09:59:20 +01:00
2023-05-24 08:42:16 -06:00
2023-05-24 08:42:17 -06:00
2023-06-21 09:06:59 +02:00
2023-05-24 11:03:59 +02:00
2023-06-16 10:08:08 -06:00
2023-02-20 11:53:11 -08:00
2023-05-17 15:20:17 +02:00
2023-06-26 12:47:20 -07:00
2023-06-12 11:31:50 -07:00
2023-02-20 11:53:11 -08:00
2023-05-17 15:25:20 +02:00