sctp: sctp_sock_filter(): avoid list_entry() on possibly empty list
stable inclusion from stable-v5.10.169 commit 747a17e25aecb4ea8a66427058e0d2d2a25046ad category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7V9QX Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=747a17e25aecb4ea8a66427058e0d2d2a25046ad ---------------------------------------------------- commit a1221703 upstream. Use list_is_first() to check whether tsp->asoc matches the first element of ep->asocs, as the list is not guaranteed to have an entry. Fixes: 8f840e47 ("sctp: add the sctp_diag.c file") Signed-off-by:Pietro Borrello <borrello@diag.uniroma1.it> Acked-by:
Xin Long <lucien.xin@gmail.com> Link: https://lore.kernel.org/r/20230208-sctp-filter-v2-1-6e1f4017f326@diag.uniroma1.it Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
Loading
Please sign in to comment