Commit 21989cb
md: fix rcu protection in md_wakeup_thread
[ Upstream commit 0dc7620 ]
We attempted to use RCU to protect the pointer 'thread', but directly
passed the value when calling md_wakeup_thread(). This means that the
RCU pointer has been acquired before rcu_read_lock(), which renders
rcu_read_lock() ineffective and could lead to a use-after-free.
Link: https://lore.kernel.org/linux-raid/20251015083227.1079009-1-yun.zhou@windriver.com
Fixes: 4469315 ("md: protect md_thread with rcu")
Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
Reviewed-by: Li Nan <linan122@huawei.com>
Reviewed-by: Yu Kuai <yukuai@fnnas.com>
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent b991eda commit 21989cb
2 files changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
4899 | 4899 | | |
4900 | 4900 | | |
4901 | 4901 | | |
4902 | | - | |
| 4902 | + | |
4903 | 4903 | | |
4904 | 4904 | | |
4905 | 4905 | | |
| |||
8051 | 8051 | | |
8052 | 8052 | | |
8053 | 8053 | | |
8054 | | - | |
| 8054 | + | |
8055 | 8055 | | |
8056 | 8056 | | |
8057 | 8057 | | |
8058 | 8058 | | |
8059 | | - | |
| 8059 | + | |
8060 | 8060 | | |
8061 | 8061 | | |
8062 | 8062 | | |
8063 | 8063 | | |
8064 | 8064 | | |
8065 | | - | |
| 8065 | + | |
8066 | 8066 | | |
8067 | 8067 | | |
8068 | 8068 | | |
8069 | | - | |
8070 | 8069 | | |
8071 | 8070 | | |
8072 | 8071 | | |
8073 | 8072 | | |
8074 | 8073 | | |
8075 | 8074 | | |
8076 | 8075 | | |
8077 | | - | |
8078 | 8076 | | |
8079 | | - | |
| 8077 | + | |
8080 | 8078 | | |
8081 | 8079 | | |
8082 | 8080 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
841 | 847 | | |
842 | 848 | | |
843 | 849 | | |
| |||
855 | 861 | | |
856 | 862 | | |
857 | 863 | | |
858 | | - | |
| 864 | + | |
859 | 865 | | |
860 | 866 | | |
861 | 867 | | |
| |||
0 commit comments