<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/mctp, branch v6.18.33</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.33</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.33'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-05-07T04:11:45+00:00</updated>
<entry>
<title>net: mctp: fix don't require received header reserved bits to be zero</title>
<updated>2026-05-07T04:11:45+00:00</updated>
<author>
<name>Yuan Zhaoming</name>
<email>yuanzm2@lenovo.com</email>
</author>
<published>2026-04-17T14:13:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f826f0000100511707f85eb74c01fb2973f6d27a'/>
<id>urn:sha1:f826f0000100511707f85eb74c01fb2973f6d27a</id>
<content type='text'>
commit a663bac71a2f0b3ac6c373168ca57b2a6e6381aa upstream.

From the MCTP Base specification (DSP0236 v1.2.1), the first byte of
the MCTP header contains a 4 bit reserved field, and 4 bit version.

On our current receive path, we require those 4 reserved bits to be
zero, but the 9500-8i card is non-conformant, and may set these
reserved bits.

DSP0236 states that the reserved bits must be written as zero, and
ignored when read. While the device might not conform to the former,
we should accept these message to conform to the latter.

Relax our check on the MCTP version byte to allow non-zero bits in the
reserved field.

Fixes: 889b7da23abf ("mctp: Add initial routing framework")
Signed-off-by: Yuan Zhaoming &lt;yuanzm2@lenovo.com&gt;
Cc: stable@vger.kernel.org
Acked-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20260417141340.5306-1-yuanzhaoming901030@126.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mctp: route: hold key-&gt;lock in mctp_flow_prepare_output()</title>
<updated>2026-03-19T15:08:16+00:00</updated>
<author>
<name>Chengfeng Ye</name>
<email>dg573847474@gmail.com</email>
</author>
<published>2026-03-06T03:14:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=925a5ffd99cddd7a7e41d5ad120c7a2c6d50260f'/>
<id>urn:sha1:925a5ffd99cddd7a7e41d5ad120c7a2c6d50260f</id>
<content type='text'>
[ Upstream commit 7d86aa41c073c4e7eb75fd2e674f1fd8f289728a ]

mctp_flow_prepare_output() checks key-&gt;dev and may call
mctp_dev_set_key(), but it does not hold key-&gt;lock while doing so.

mctp_dev_set_key() and mctp_dev_release_key() are annotated with
__must_hold(&amp;key-&gt;lock), so key-&gt;dev access is intended to be
serialized by key-&gt;lock. The mctp_sendmsg() transmit path reaches
mctp_flow_prepare_output() via mctp_local_output() -&gt; mctp_dst_output()
without holding key-&gt;lock, so the check-and-set sequence is racy.

Example interleaving:

  CPU0                                  CPU1
  ----                                  ----
  mctp_flow_prepare_output(key, devA)
    if (!key-&gt;dev)  // sees NULL
                                        mctp_flow_prepare_output(
                                            key, devB)
                                          if (!key-&gt;dev)  // still NULL
                                          mctp_dev_set_key(devB, key)
                                            mctp_dev_hold(devB)
                                            key-&gt;dev = devB
    mctp_dev_set_key(devA, key)
      mctp_dev_hold(devA)
      key-&gt;dev = devA   // overwrites devB

Now both devA and devB references were acquired, but only the final
key-&gt;dev value is tracked for release. One reference can be lost,
causing a resource leak as mctp_dev_release_key() would only decrease
the reference on one dev.

Fix by taking key-&gt;lock around the key-&gt;dev check and
mctp_dev_set_key() call.

Fixes: 67737c457281 ("mctp: Pass flow data &amp; flow release events to drivers")
Signed-off-by: Chengfeng Ye &lt;dg573847474@gmail.com&gt;
Link: https://patch.msgid.link/20260306031402.857224-1-dg573847474@gmail.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mctp: unconditionally set skb-&gt;dev on dst output</title>
<updated>2025-11-27T10:39:12+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2025-11-25T06:48:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b3e528a5811bbc8246dbdb962f0812dc9b721681'/>
<id>urn:sha1:b3e528a5811bbc8246dbdb962f0812dc9b721681</id>
<content type='text'>
On transmit, we are currently relying on skb-&gt;dev being set by
mctp_local_output() when we first set up the skb destination fields.
However, forwarded skbs do not use the local_output path, so will retain
their incoming netdev as their -&gt;dev on tx. This does not work when
we're forwarding between interfaces.

Set skb-&gt;dev unconditionally in the transmit path, to allow for proper
forwarding.

We keep the skb-&gt;dev initialisation in mctp_local_output(), as we use it
for fragmentation.

Fixes: 269936db5eb3 ("net: mctp: separate routing database from routing operations")
Suggested-by: Vince Chang &lt;vince_chang@aspeedtech.com&gt;
Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20251125-dev-forward-v1-1-54ecffcd0616@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
<entry>
<title>net: mctp: fix typo in comment</title>
<updated>2025-09-09T00:47:57+00:00</updated>
<author>
<name>Alok Tiwari</name>
<email>alok.a.tiwari@oracle.com</email>
</author>
<published>2025-09-05T16:50:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bd64723327e33758803f3b6105f4ef0a1e6cebe0'/>
<id>urn:sha1:bd64723327e33758803f3b6105f4ef0a1e6cebe0</id>
<content type='text'>
Correct a typo in af_mctp.c: "fist" -&gt; "first".

Signed-off-by: Alok Tiwari &lt;alok.a.tiwari@oracle.com&gt;
Acked-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20250905165006.3032472-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>mctp: return -ENOPROTOOPT for unknown getsockopt options</title>
<updated>2025-09-04T00:01:52+00:00</updated>
<author>
<name>Alok Tiwari</name>
<email>alok.a.tiwari@oracle.com</email>
</author>
<published>2025-09-02T10:20:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a125c8fb9ddbcb0602103a50727a476fd30dec01'/>
<id>urn:sha1:a125c8fb9ddbcb0602103a50727a476fd30dec01</id>
<content type='text'>
In mctp_getsockopt(), unrecognized options currently return -EINVAL.
In contrast, mctp_setsockopt() returns -ENOPROTOOPT for unknown
options.

Update mctp_getsockopt() to also return -ENOPROTOOPT for unknown
options. This aligns the behavior of getsockopt() and setsockopt(),
and matches the standard kernel socket API convention for handling
unsupported options.

Fixes: 99ce45d5e7db ("mctp: Implement extended addressing")
Signed-off-by: Alok Tiwari &lt;alok.a.tiwari@oracle.com&gt;
Link: https://patch.msgid.link/20250902102059.1370008-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mctp: mctp_fraq_queue should take ownership of passed skb</title>
<updated>2025-09-02T12:45:51+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2025-08-29T07:28:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=773b27a8a2f00ce3134e92e50ea4794a98ba2b76'/>
<id>urn:sha1:773b27a8a2f00ce3134e92e50ea4794a98ba2b76</id>
<content type='text'>
As of commit f5d83cf0eeb9 ("net: mctp: unshare packets when
reassembling"), we skb_unshare() in mctp_frag_queue(). The unshare may
invalidate the original skb pointer, so we need to treat the skb as
entirely owned by the fraq queue, even on failure.

Fixes: f5d83cf0eeb9 ("net: mctp: unshare packets when reassembling")
Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20250829-mctp-skb-unshare-v1-1-1c28fe10235a@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
<entry>
<title>net: mctp: Fix bad kfree_skb in bind lookup test</title>
<updated>2025-08-14T00:07:34+00:00</updated>
<author>
<name>Matt Johnston</name>
<email>matt@codeconstruct.com.au</email>
</author>
<published>2025-08-12T05:08:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a58893aa173923fdc49c2d35d638d8133065e952'/>
<id>urn:sha1:a58893aa173923fdc49c2d35d638d8133065e952</id>
<content type='text'>
The kunit test's skb_pkt is consumed by mctp_dst_input() so shouldn't be
freed separately.

Fixes: e6d8e7dbc5a3 ("net: mctp: Add bind lookup test")
Reported-by: Alexandre Ghiti &lt;alex@ghiti.fr&gt;
Closes: https://lore.kernel.org/all/734b02a3-1941-49df-a0da-ec14310d41e4@ghiti.fr/
Signed-off-by: Matt Johnston &lt;matt@codeconstruct.com.au&gt;
Tested-by: Alexandre Ghiti &lt;alexghiti@rivosinc.com&gt;
Link: https://patch.msgid.link/20250812-fix-mctp-bind-test-v1-1-5e2128664eb3@codeconstruct.com.au
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mctp: Add bind lookup test</title>
<updated>2025-07-15T10:08:39+00:00</updated>
<author>
<name>Matt Johnston</name>
<email>matt@codeconstruct.com.au</email>
</author>
<published>2025-07-10T08:56:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6d8e7dbc5a363a8e55a65f3bbe7f9f44f0aeb4f'/>
<id>urn:sha1:e6d8e7dbc5a363a8e55a65f3bbe7f9f44f0aeb4f</id>
<content type='text'>
Test the preference order of bound socket matches with a series of test
packets.

Signed-off-by: Matt Johnston &lt;matt@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20250710-mctp-bind-v4-8-8ec2f6460c56@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
<entry>
<title>net: mctp: Test conflicts of connect() with bind()</title>
<updated>2025-07-15T10:08:39+00:00</updated>
<author>
<name>Matt Johnston</name>
<email>matt@codeconstruct.com.au</email>
</author>
<published>2025-07-10T08:56:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b7e28129b667dede890bc7bd340a77e325df156a'/>
<id>urn:sha1:b7e28129b667dede890bc7bd340a77e325df156a</id>
<content type='text'>
The addition of connect() adds new conflict cases to test.

Signed-off-by: Matt Johnston &lt;matt@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20250710-mctp-bind-v4-7-8ec2f6460c56@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
<entry>
<title>net: mctp: Allow limiting binds to a peer address</title>
<updated>2025-07-15T10:08:39+00:00</updated>
<author>
<name>Matt Johnston</name>
<email>matt@codeconstruct.com.au</email>
</author>
<published>2025-07-10T08:55:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3549eb08e5505823857838b5cf5f08567702d054'/>
<id>urn:sha1:3549eb08e5505823857838b5cf5f08567702d054</id>
<content type='text'>
Prior to calling bind() a program may call connect() on a socket to
restrict to a remote peer address.

Using connect() is the normal mechanism to specify a remote network
peer, so we use that here. In MCTP connect() is only used for bound
sockets - send() is not available for MCTP since a tag must be provided
for each message.

The smctp_type must match between connect() and bind() calls.

Signed-off-by: Matt Johnston &lt;matt@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20250710-mctp-bind-v4-6-8ec2f6460c56@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
</feed>
