]> 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)
commit6d06bacb3dc11d52458f2b36718bb918b8aeb6a8
treeb0db0fff93d8baaf835296ba152084e3c72d6b17
parent923ceed0e3cdf6b744e4553608f85ce1e84f524e
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: 893ed6a282b3 ("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