sctp: fix a potential overflow in sctp_ifwdtsn_skip
CVE-2023-53372
What is CVE-2023-53372?
In the Linux kernel, the following vulnerability has been resolved:
sctp: fix a potential overflow in sctp_ifwdtsn_skip
Currently, when traversing ifwdtsn skips with _sctp_walk_ifwdtsn, it only checks the pos against the end of the chunk. However, the data left for the last pos may be < sizeof(struct sctp_ifwdtsn_skip), and dereference it as struct sctp_ifwdtsn_skip may cause coverflow.
This patch fixes it by checking the pos against "the end of the chunk - sizeof(struct sctp_ifwdtsn_skip)" in sctp_ifwdtsn_skip, similar to sctp_fwdtsn_skip.
Affected Version(s)
Linux 0fc2ea922c8ad5520c80f03facbf396c81dce802 < 4fbd094d4131a10d06a45d64158567052a35b3f4
Linux 0fc2ea922c8ad5520c80f03facbf396c81dce802
Linux 0fc2ea922c8ad5520c80f03facbf396c81dce802 < 79b28f42214a3d0d6a8c514db3602260bd5d6cb5