RE: [PATCH net] tipc: reject bundles too short for an inner header
From: Tung Quang Nguyen
Date: Sun Nov 29 2026 - 23:08:37 EST
>Subject: [PATCH net] tipc: reject bundles too short for an inner header
>
>From: Andrew Stellman <astellman@xxxxxxxxxxxxxxxxxxx>
>
>tipc_msg_extract() checks *pos against msg_data_sz(hdr) - MIN_H_SIZE.
>msg_data_sz() is unsigned, so for a header-only MSG_BUNDLER, which
There is no such "header-only MSG_BUNDLER" sent by a correctly-configured TIPC node.
>tipc_msg_validate() accepts, the subtraction wraps and the check passes. The
>following msg_size(ihdr) then reads four bytes past the end of the bundle.
>Check that the data can hold an inner header before subtracting.
>
>Tested on mainline (7cd8495c0f16) in arm64 QEMU with KASAN. A test-only
>debugfs hook, not part of this patch, built a header-only bundle in the kernel,
>passed it to tipc_msg_validate() and tipc_msg_extract(), and poisoned 8 bytes
>of tailroom after it as a redzone so KASAN would flag the read. No live TIPC link
>was used, and the bundle didn't come from a peer
This is a wrong usage of TIPC because TIPC does not accept "Man-in-the-middle tampering" messages.
Those kind of messages must be prevented from entering TIPC stack (by using IPsec or TIPC encryption feature).
It is obvious that checking/validating a tampered message cannot return a reliable result.
---
pw-bot: rejected