Marcelo Ricardo Leitner fb9bbf90f2 sctp: validate from_addr_param return
[ Upstream commit 0c5dc070ff3d6246d22ddd931f23a6266249e3db ]

Ilja reported that, simply putting it, nothing was validating that
from_addr_param functions were operating on initialized memory. That is,
the parameter itself was being validated by sctp_walk_params, but it
doesn't check for types and their specific sizes and it could be a 0-length
one, causing from_addr_param to potentially work over the next parameter or
even uninitialized memory.

The fix here is to, in all calls to from_addr_param, check if enough space
is there for the wanted IP address type.

Change-Id: Ia9b0ce49cb95dc200bddf88596fb3f996feb8309
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Git-commit: f01bfaea62d14938ff2fbeaf67f0afec2ec64ab9
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: PavanKumar S.R <quic_pavasr@quicinc.com>
2022-03-10 23:00:56 +05:30
..
2020-05-20 08:17:12 +02:00
2019-12-05 15:38:15 +01:00
2020-07-01 12:51:55 +02:00
2020-01-17 19:45:49 +01:00
2020-06-03 13:37:46 +02:00