Chris Wilson
7dfbf8a07c
drm/i915: Skip stale object handle for debugfs per-file-stats
As we close a handle GEM object, we update the drm_file's idr with an
error^W NULL pointer to indicate the in-progress closure, and finally
removing it. If we read the idr directly, we may then see an invalid
object pointer, and in our debugfs per_file_stats() we therefore need
to protect against the entry being invalid.
[ 1016.651637] RIP: 0010:per_file_stats+0xe/0x16e
[ 1016.651646] Code: d2 41 0f b6 8e 69 8c 00 00 48 89 df 48 c7 c6 7b 74 8c be 31 c0 e8 0c 89 cf ff eb d2 0f 1f 44 00 00 55 48 89 e5 41
57 41 56 53 <8b> 06 85 c0 0f 84 4d 01 00 00 49 89 d6 48 89 f3 3d ff ff ff 7f 73
[ 1016.651651] RSP: 0018:ffffad3a01337ba0 EFLAGS: 00010293
[ 1016.651656] RAX: 0000000000000018 RBX: ffff96fe040d65e0 RCX: 0000000000000002
[ 1016.651660] RDX: ffffad3a01337c50 RSI: 0000000000000000 RDI: 00000000000001e8
[ 1016.651663] RBP: ffffad3a01337bb8 R08: 0000000000000000 R09: 00000000000001c0
[ 1016.651667] R10: 0000000000000000 R11: ffffffffbdbe5fce R12: 0000000000000000
[ 1016.651671] R13: ffffffffbdbe5fce R14: ffffad3a01337c50 R15: 0000000000000001
[ 1016.651676] FS: 00007a597e2d7480(0000) GS:ffff96ff3bb00000(0000) knlGS:0000000000000000
[ 1016.651680] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1016.651683] CR2: 0000000000000000 CR3: 0000000171fc2001 CR4: 00000000003606e0
[ 1016.651687] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1016.651690] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 1016.651693] Call Trace:
[ 1016.651693] Call Trace:
[ 1016.651703] idr_for_each+0x8a/0xe8
[ 1016.651711] i915_gem_object_info+0x2a3/0x3eb
[ 1016.651720] seq_read+0x162/0x3ca
[ 1016.651727] full_proxy_read+0x5b/0x8d
[ 1016.651733] __vfs_read+0x45/0x1bb
[ 1016.651741] vfs_read+0xc9/0x15e
[ 1016.651746] ksys_read+0x7e/0xde
[ 1016.651752] do_syscall_64+0x54/0x68
[ 1016.651758] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: a8c15954d6
("drm/i915: Protect debugfs per_file_stats with RCU lock")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200630152724.3734-1-chris@chris-wilson.co.uk
(cherry picked from commit c1b9fd3d31
)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2020-07-06 17:15:55 -07:00
..
2020-06-16 11:34:24 +03:00
2020-06-11 12:27:06 -07:00
2020-06-29 11:29:12 +03:00
2020-06-17 12:36:19 +08:00
2020-06-16 11:34:23 +03:00
2020-03-25 11:50:48 +01:00
2020-04-06 19:48:06 +01:00
2020-04-06 19:48:06 +01:00
2020-03-06 14:33:08 +00:00
2020-06-02 16:35:29 +03:00
2020-05-09 12:57:57 +01:00
2020-07-06 17:15:55 -07:00
2020-03-18 16:27:22 +01:00
2020-05-14 11:33:10 +10:00
2020-05-20 13:36:45 +10:00
2020-05-13 14:39:41 -07:00
2020-04-02 01:17:39 +01:00
2020-05-14 19:59:53 +03:00
2020-05-04 10:35:47 -07:00
2020-05-09 12:59:23 +01:00
2020-05-01 20:35:26 -04:00
2020-06-16 11:34:24 +03:00
2020-04-09 00:01:59 +09:00
2020-06-09 09:39:13 -07:00
2020-06-08 12:58:13 +03:00
2020-06-02 16:35:33 +03:00
2020-05-20 13:36:45 +10:00
2020-03-30 18:20:34 +01:00
2020-06-10 16:04:27 -07:00
2020-06-15 12:36:02 +03:00
2020-06-16 11:34:23 +03:00
2020-05-01 20:35:07 -04:00
2020-06-16 11:34:24 +03:00
2020-06-01 15:23:01 +03:00
2020-05-14 06:14:33 +01:00
2020-05-14 06:14:33 +01:00
2020-05-25 15:40:26 +03:00
2020-05-11 10:54:04 -07:00
2020-05-04 15:15:04 +01:00
2020-03-25 13:05:04 +00:00
2020-03-25 13:05:04 +00:00
2020-05-11 12:56:45 +01:00
2020-04-08 13:49:35 +03:00
2020-04-03 16:33:09 +01:00
2020-03-11 23:12:39 +02:00
2020-03-03 17:46:54 +02:00
2020-03-03 17:46:54 +02:00
2020-03-03 21:52:51 +00:00
2020-05-06 15:36:54 -07:00
2020-04-01 23:34:17 +01:00
2020-05-14 20:04:02 +03:00
2020-05-14 19:59:53 +03:00
2020-04-08 13:49:35 +03:00
2020-03-03 17:47:03 +02:00
2020-06-16 11:34:24 +03:00
2020-05-13 16:21:20 +03:00
2020-04-24 21:33:09 +02:00
2020-05-05 13:59:55 +03:00
2020-05-11 16:57:36 +01:00
2020-03-25 11:33:05 +00:00
2020-03-23 12:51:05 +00:00
2020-03-23 12:51:05 +00:00
2020-05-04 18:44:52 +03:00
2020-05-09 12:57:57 +01:00
2020-05-09 12:57:57 +01:00