Commit 2c55070
platform/wmi: use generic driver_override infrastructure
[ Upstream commit 8a700b1 ]
When a driver is probed through __driver_attach(), the bus' match()
callback is called without the device lock held, thus accessing the
driver_override field without a lock, which can cause a UAF.
Fix this by using the driver-core driver_override infrastructure taking
care of proper locking internally.
Note that calling match() from __driver_attach() without the device lock
held is intentional. [1]
Link: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/ [1]
Reported-by: Gui-Dong Han <hanguidong02@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220789
Fixes: 12046f8 ("platform/x86: wmi: Add driver_override support")
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20260324005919.2408620-7-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 58a42be commit 2c55070
2 files changed
Lines changed: 5 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | 705 | | |
733 | 706 | | |
734 | 707 | | |
735 | 708 | | |
736 | 709 | | |
737 | | - | |
738 | 710 | | |
739 | 711 | | |
740 | 712 | | |
| |||
803 | 775 | | |
804 | 776 | | |
805 | 777 | | |
806 | | - | |
807 | 778 | | |
808 | 779 | | |
809 | 780 | | |
| |||
812 | 783 | | |
813 | 784 | | |
814 | 785 | | |
| 786 | + | |
815 | 787 | | |
816 | 788 | | |
817 | | - | |
818 | | - | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
819 | 792 | | |
820 | 793 | | |
821 | 794 | | |
| |||
936 | 909 | | |
937 | 910 | | |
938 | 911 | | |
| 912 | + | |
939 | 913 | | |
940 | 914 | | |
941 | 915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
| |||
0 commit comments