Rohith Surabattula
9687c85dfb
Fix KASAN identified use-after-free issue.
...
[ 612.157429] ==================================================================
[ 612.158275] BUG: KASAN: use-after-free in process_one_work+0x90/0x9b0
[ 612.158801] Read of size 8 at addr ffff88810a31ca60 by task kworker/2:9/2382
[ 612.159611] CPU: 2 PID: 2382 Comm: kworker/2:9 Tainted: G
OE 5.13.0-rc2+ #98
[ 612.159623] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.14.0-1.fc33 04/01/2014
[ 612.159640] Workqueue: 0x0 (deferredclose)
[ 612.159669] Call Trace:
[ 612.159685] dump_stack+0xbb/0x107
[ 612.159711] print_address_description.constprop.0+0x18/0x140
[ 612.159733] ? process_one_work+0x90/0x9b0
[ 612.159743] ? process_one_work+0x90/0x9b0
[ 612.159754] kasan_report.cold+0x7c/0xd8
[ 612.159778] ? lock_is_held_type+0x80/0x130
[ 612.159789] ? process_one_work+0x90/0x9b0
[ 612.159812] kasan_check_range+0x145/0x1a0
[ 612.159834] process_one_work+0x90/0x9b0
[ 612.159877] ? pwq_dec_nr_in_flight+0x110/0x110
[ 612.159914] ? spin_bug+0x90/0x90
[ 612.159967] worker_thread+0x3b6/0x6c0
[ 612.160023] ? process_one_work+0x9b0/0x9b0
[ 612.160038] kthread+0x1dc/0x200
[ 612.160051] ? kthread_create_worker_on_cpu+0xd0/0xd0
[ 612.160092] ret_from_fork+0x1f/0x30
[ 612.160399] Allocated by task 2358:
[ 612.160757] kasan_save_stack+0x1b/0x40
[ 612.160768] __kasan_kmalloc+0x9b/0xd0
[ 612.160778] cifs_new_fileinfo+0xb0/0x960 [cifs]
[ 612.161170] cifs_open+0xadf/0xf20 [cifs]
[ 612.161421] do_dentry_open+0x2aa/0x6b0
[ 612.161432] path_openat+0xbd9/0xfa0
[ 612.161441] do_filp_open+0x11d/0x230
[ 612.161450] do_sys_openat2+0x115/0x240
[ 612.161460] __x64_sys_openat+0xce/0x140
When mod_delayed_work is called to modify the delay of pending work,
it might return false and queue a new work when pending work is
already scheduled or when try to grab pending work failed.
So, Increase the reference count when new work is scheduled to
avoid use-after-free.
Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-05-20 12:20:42 -05:00
..
2021-05-07 11:18:52 -07:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-05-01 11:55:36 -07:00
2021-03-24 14:14:27 -04:00
2021-03-30 16:54:49 -07:00
2021-01-24 14:27:20 +01:00
2021-05-11 09:43:16 -07:00
2021-04-23 10:14:32 +01:00
2021-05-06 10:27:02 -07:00
2021-05-20 12:20:42 -05:00
2021-04-23 14:42:39 -07:00
2021-05-07 00:26:34 -07:00
2021-01-05 23:02:47 -05:00
2021-04-26 08:51:23 -07:00
2021-04-28 13:33:57 -07:00
2021-03-29 13:28:18 -05:00
2021-05-06 10:06:39 -07:00
2021-04-12 15:04:29 +02:00
2021-05-13 15:58:46 +08:00
2021-04-27 20:45:07 +09:00
2020-12-09 09:39:38 -05:00
2021-05-02 09:14:01 -07:00
2021-05-02 09:14:01 -07:00
2021-05-12 07:38:00 -07:00
2021-05-07 00:26:34 -07:00
2021-04-23 10:14:32 +01:00
2021-05-02 09:14:01 -07:00
2021-05-05 11:27:19 -07:00
2021-01-24 14:27:20 +01:00
2021-05-14 19:41:32 -07:00
2021-05-02 09:14:01 -07:00
2021-05-06 19:24:13 -07:00
2021-05-14 19:41:32 -07:00
2021-05-14 19:41:32 -07:00
2021-05-06 19:24:13 -07:00
2021-04-09 23:32:16 -04:00
2021-05-04 18:08:40 -07:00
2021-04-12 15:04:29 +02:00
2021-02-23 13:39:45 -08:00
2021-01-25 09:36:23 -05:00
2021-01-24 14:27:20 +01:00
2021-04-26 23:23:41 +01:00
2021-05-07 11:23:41 -07:00
2021-03-22 10:19:00 -04:00
2021-05-07 11:23:41 -07:00
2021-05-07 00:34:51 -07:00
2021-03-25 15:33:45 +01:00
2021-02-24 13:38:26 -08:00
2021-05-07 00:26:34 -07:00
2021-01-24 14:27:20 +01:00
2021-03-12 22:15:22 -05:00
2021-04-29 08:06:05 -04:00
2021-04-30 15:17:08 -07:00
2021-05-06 19:24:11 -07:00
2021-04-27 18:09:44 -07:00
2021-03-18 17:03:54 +01:00
2021-02-24 13:38:26 -08:00
2021-05-07 00:26:34 -07:00
2020-10-24 12:26:05 -07:00
2021-05-14 19:41:32 -07:00
2021-01-12 14:26:31 +01:00
2021-01-24 14:27:20 +01:00
2021-03-23 14:08:18 -04:00
2021-05-04 18:08:40 -07:00
2021-04-15 22:36:45 -04:00
2021-04-15 22:36:45 -04:00
2021-05-02 00:43:35 +09:00
2021-03-12 22:15:00 -05:00
2021-04-22 17:31:32 +10:00
2021-05-06 23:54:12 -07:00
2021-04-29 11:06:13 -07:00
2021-04-30 11:20:39 -07:00
2021-01-15 12:17:25 -05:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:27:20 +01:00
2021-03-08 10:21:11 -05:00
2021-03-08 10:21:11 -05:00
2021-04-19 09:56:37 +10:00
2021-03-13 11:27:30 -08:00
2021-05-07 11:35:12 -07:00
2021-05-05 13:50:15 -07:00
2021-01-06 08:42:51 -05:00
2021-03-08 10:21:11 -05:00
2021-03-21 11:43:58 -04:00
2021-05-15 08:28:08 -07:00
2021-04-15 22:36:45 -04:00
2021-04-09 14:54:23 -07:00
2020-11-15 09:49:10 -05:00
2021-05-06 19:24:13 -07:00
2021-02-24 13:38:26 -08:00
2021-02-23 13:39:45 -08:00
2021-02-24 13:38:26 -08:00
2020-10-25 20:02:08 -04:00
2021-05-03 11:05:28 -07:00
2021-04-30 11:20:35 -07:00
2021-01-13 17:26:50 +01:00
2021-01-24 14:27:19 +01:00
2021-05-05 11:27:20 -07:00
2021-02-23 13:39:45 -08:00
2021-05-14 06:06:34 -06:00
2021-04-20 11:24:22 -06:00
2021-04-11 17:42:00 -06:00
2021-04-12 15:04:23 +02:00
2021-05-07 11:23:41 -07:00
2021-04-19 09:56:37 +10:00
2020-10-05 13:37:04 +02:00
2021-03-23 11:20:25 +01:00
2021-05-05 13:44:19 -07:00
2021-04-23 10:14:32 +01:00
2021-01-24 14:29:34 +01:00
2021-03-11 07:47:48 -07:00
2021-04-27 12:49:42 -07:00
2021-03-31 14:22:55 -06:00
2021-02-23 13:39:45 -08:00
2021-02-24 13:38:26 -08:00
2021-03-08 15:18:43 +01:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:43:45 +01:00
2021-01-25 23:29:36 -05:00
2021-04-17 11:39:49 -07:00
2021-01-24 14:27:19 +01:00
2021-03-16 22:13:10 +01:00
2021-04-27 15:50:15 -07:00
2021-04-16 16:32:41 +02:00
2021-02-21 11:02:48 -08:00
2021-04-17 23:03:50 -04:00
2021-02-13 17:17:53 +01:00
2021-04-22 12:22:11 -07:00
2021-05-05 11:27:22 -07:00
2021-01-24 14:27:18 +01:00
2021-03-23 11:20:26 +01:00