Recently, Paolo fixed a bug where a TCP-specific helper was used with an
MPTCP socket [1]. The bug was not detected by fuzzer or static analysis.
Following this, it has been suggested to add a check, only in debug
mode. This is what this series is doing.
The series has been split to be upstreamed: a preparation patch for
MPTCP, the modification for TCP, then for MPTCP. It is not clear if it
would be OK to add that upstream. If not, we can squash these three
patches in "DO-NOT-MERGE: mptcp: improve code coverage for CI" commit we
have in our export tree.
Note that the MPTCP Token kUnit test needs to be adapted for this new
check. This is what is done in patch 1/3.
Currently, 'WARN_ON()' helper is used. Maybe we want to use the '_ONCE'
version? I didn't use it because this is a DEBUG check, but I can if we
prefer. Or something similar.
Link: https://lore.kernel.org/mptcp/35875ef9cb7194563b580e14c71cc8cb065f846c.1706043786.git.pabeni@redhat.com/ [1]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (3):
mptcp: token kunit: set protocol
tcp: check the protocol with DEBUG_NET
mptcp: check the protocol with DEBUG_NET
include/linux/tcp.h | 9 +++++++++
net/mptcp/protocol.h | 9 +++++++++
net/mptcp/token_test.c | 7 ++++++-
3 files changed, 24 insertions(+), 1 deletion(-)
---
base-commit: 12837771007b672717901b90aa9eb97a0a8c31fa
change-id: 20240131-mptcp-check-protocol-e32e53d04a75
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>