Commit 8a700b1
Danilo Krummrich
platform/wmi: use generic driver_override infrastructure
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>1 parent 10a4206 commit 8a700b1
2 files changed
Lines changed: 5 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | 845 | | |
873 | 846 | | |
874 | 847 | | |
875 | 848 | | |
876 | 849 | | |
877 | | - | |
878 | 850 | | |
879 | 851 | | |
880 | 852 | | |
| |||
943 | 915 | | |
944 | 916 | | |
945 | 917 | | |
946 | | - | |
947 | 918 | | |
948 | 919 | | |
949 | 920 | | |
| |||
952 | 923 | | |
953 | 924 | | |
954 | 925 | | |
| 926 | + | |
955 | 927 | | |
956 | 928 | | |
957 | | - | |
958 | | - | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
959 | 932 | | |
960 | 933 | | |
961 | 934 | | |
| |||
1076 | 1049 | | |
1077 | 1050 | | |
1078 | 1051 | | |
| 1052 | + | |
1079 | 1053 | | |
1080 | 1054 | | |
1081 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
30 | | - | |
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
| |||
0 commit comments