+1
−2
+15
−25
Loading
stable inclusion from stable-v6.6.33 commit 39da6f09e110d60423a75ea1d0a8c6f5c63e2d9e category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA6S8I CVE: CVE-2024-38602 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=39da6f09e110d60423a75ea1d0a8c6f5c63e2d9e --------------------------- [ Upstream commit a7d6e36b9ad052926ba2ecba3a59d8bb67dabcb4 ] The origin ax25_dev_list implements its own single linked list, which is complicated and error-prone. For example, when deleting the node of ax25_dev_list in ax25_dev_device_down(), we have to operate on the head node and other nodes separately. This patch uses kernel universal linked list to replace original ax25_dev_list, which make the operation of ax25_dev_list easier. We should do "dev->ax25_ptr = ax25_dev;" and "dev->ax25_ptr = NULL;" while holding the spinlock, otherwise the ax25_dev_device_up() and ax25_dev_device_down() could race. Suggested-by:Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by:
Duoming Zhou <duoming@zju.edu.cn> Reviewed-by:
Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/85bba3af651ca0e1a519da8d0d715b949891171c.1715247018.git.duoming@zju.edu.cn Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Stable-dep-of: b505e0319852 ("ax25: Fix reference count leak issues of ax25_dev") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Liu Jian <liujian56@huawei.com>