]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - net/tipc/link.c
tipc: fix incorrect order of state message data sanity check
authorTung Nguyen <tung.q.nguyen@dektech.com.au>
Tue, 8 Mar 2022 02:11:59 +0000 (02:11 +0000)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 23 Mar 2022 10:49:01 +0000 (11:49 +0100)
commit9f95bd1473ef69269ea67422f723450987997956
tree0e846fb2fcbda74ad4b85add11853920e58f1942
parentdae22625f4a2bb64d924008fd33ce47d39f224bb
tipc: fix incorrect order of state message data sanity check

BugLink: https://bugs.launchpad.net/bugs/1966056
[ Upstream commit c79fcc27be90b308b3fa90811aefafdd4078668c ]

When receiving a state message, function tipc_link_validate_msg()
is called to validate its header portion. Then, its data portion
is validated before it can be accessed correctly. However, current
data sanity  check is done after the message header is accessed to
update some link variables.

This commit fixes this issue by moving the data sanity check to
the beginning of state message handling and right after the header
sanity check.

Fixes: 9aa422ad3266 ("tipc: improve size validations for received domain records")
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Link: https://lore.kernel.org/r/20220308021200.9245-1-tung.q.nguyen@dektech.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/tipc/link.c