]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Mar 2022 06:18:42 +0000 (22:18 -0800)
commit8baec4adc13408fc3ea08fd951172b1d99a96bed
treeb0db0fff93d8baaf835296ba152084e3c72d6b17
parent32017ffd70fcc2c14e47801ca59f4b06d2815fcb
tipc: fix incorrect order of state message data sanity check

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: 72711fbd146a ("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>
net/tipc/link.c