]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms
authorPetr Malat <oss@malat.biz>
Fri, 30 Oct 2020 13:26:33 +0000 (14:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 11:38:58 +0000 (12:38 +0100)
commit9870842a72a12d89eb017920808e81d925e474b0
tree2c5c48b5b8adb7d5d9e2539874ecd54e95691a43
parentb909175783b0a91a6e3d02a3903cef7e9a7ae354
sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms

[ Upstream commit b6df8c81412190fbd5eaa3cec7f642142d9c16cd ]

Commit 978aa0474115 ("sctp: fix some type cast warnings introduced since
very beginning")' broke err reading from sctp_arg, because it reads the
value as 32-bit integer, although the value is stored as 16-bit integer.
Later this value is passed to the userspace in 16-bit variable, thus the
user always gets 0 on big-endian platforms. Fix it by reading the __u16
field of sctp_arg union, as reading err field would produce a sparse
warning.

Fixes: 978aa0474115 ("sctp: fix some type cast warnings introduced since very beginning")
Signed-off-by: Petr Malat <oss@malat.biz>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Link: https://lore.kernel.org/r/20201030132633.7045-1-oss@malat.biz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sctp/sm_sideeffect.c