Commit 13d201b
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 dfe950d commit 13d201b
2 files changed
Lines changed: 5 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | 699 | | |
727 | 700 | | |
728 | 701 | | |
729 | 702 | | |
730 | 703 | | |
731 | | - | |
732 | 704 | | |
733 | 705 | | |
734 | 706 | | |
| |||
797 | 769 | | |
798 | 770 | | |
799 | 771 | | |
800 | | - | |
801 | 772 | | |
802 | 773 | | |
803 | 774 | | |
| |||
806 | 777 | | |
807 | 778 | | |
808 | 779 | | |
| 780 | + | |
809 | 781 | | |
810 | 782 | | |
811 | | - | |
812 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
813 | 786 | | |
814 | 787 | | |
815 | 788 | | |
| |||
891 | 864 | | |
892 | 865 | | |
893 | 866 | | |
| 867 | + | |
894 | 868 | | |
895 | 869 | | |
896 | 870 | | |
| |||
| 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