diff mbox series

mptcp: correct MPTCP_SUBFLOW_ATTR_SSN_OFFSET reserved size

Message ID 20240809094321.GA8122@asgard.redhat.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series mptcp: correct MPTCP_SUBFLOW_ATTR_SSN_OFFSET reserved size | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 29 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 29 this patch: 29
netdev/checkpatch warning WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: 5147dfb50832 ("mptcp: allow dumping subflow context to userspace")'
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-09--15-00 (tests: 705)

Commit Message

Eugene Syromiatnikov Aug. 9, 2024, 9:43 a.m. UTC
ssn_offset field is u32 and is placed into the netlink response with
nla_put_u32(), but only 2 bytes are reserved for the attribute payload
in subflow_get_info_size() (even though it makes no difference in the end,
as it is aligned up to 4 bytes).  Supply the correct argument to the relevant
nla_total_size() call to make it less confusing.

Fixes: 5147dfb5083204d6 ("mptcp: allow dumping subflow context to userspace")
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
---
 net/mptcp/diag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthieu Baerts (NGI0) Aug. 9, 2024, 10:42 a.m. UTC | #1
Hi Eugene,

On 09/08/2024 11:43, Eugene Syromiatnikov wrote:
> ssn_offset field is u32 and is placed into the netlink response with
> nla_put_u32(), but only 2 bytes are reserved for the attribute payload
> in subflow_get_info_size() (even though it makes no difference in the end,
> as it is aligned up to 4 bytes).  Supply the correct argument to the relevant
> nla_total_size() call to make it less confusing.

Good catch, thank you for sharing this patch!

The modification in the code and the description look good to me!


Please note that when you submit a patch to the Netdev mailing list, the
subject should have the 'PATCH net' prefix (or net-next) as mentioned in
the Netdev doc:

  https://docs.kernel.org/process/maintainer-netdev.html

> Fixes: 5147dfb5083204d6 ("mptcp: allow dumping subflow context to userspace")

Checkpatch is complaining about this line, because the commit ID should
have 12 chars:


https://docs.kernel.org/process/submitting-patches.html#describe-your-changes

Note that checkpatch.pl also points out the fact that the lines in the
commit description should have max 75 chars -- ideally 72 -- which is
not the case above with the line ending with 'relevant'.

Do you mind sending a v2 with these small fixes, so your patch can be
directly applied in the net tree, please?

(Do not forget to wait 24h between two versions as mentioned in the doc)

Cheers,
Matt
Eugene Syromiatnikov Aug. 9, 2024, 11:05 a.m. UTC | #2
On Fri, Aug 09, 2024 at 12:42:19PM +0200, Matthieu Baerts wrote:
> Do you mind sending a v2 with these small fixes, so your patch can be
> directly applied in the net tree, please?

Sure, will do.
diff mbox series

Patch

diff --git a/net/mptcp/diag.c b/net/mptcp/diag.c
index 3ae46b545d2c..2d3efb405437 100644
--- a/net/mptcp/diag.c
+++ b/net/mptcp/diag.c
@@ -94,7 +94,7 @@  static size_t subflow_get_info_size(const struct sock *sk)
 		nla_total_size(4) +	/* MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ */
 		nla_total_size_64bit(8) +	/* MPTCP_SUBFLOW_ATTR_MAP_SEQ */
 		nla_total_size(4) +	/* MPTCP_SUBFLOW_ATTR_MAP_SFSEQ */
-		nla_total_size(2) +	/* MPTCP_SUBFLOW_ATTR_SSN_OFFSET */
+		nla_total_size(4) +	/* MPTCP_SUBFLOW_ATTR_SSN_OFFSET */
 		nla_total_size(2) +	/* MPTCP_SUBFLOW_ATTR_MAP_DATALEN */
 		nla_total_size(4) +	/* MPTCP_SUBFLOW_ATTR_FLAGS */
 		nla_total_size(1) +	/* MPTCP_SUBFLOW_ATTR_ID_REM */