<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/mctp, branch v7.1-rc5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-04-30T20:36:47+00:00</updated>
<entry>
<title>net: mctp: test: Use dev_direct_xmit for TX to our test device</title>
<updated>2026-04-30T20:36:47+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-04-29T08:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=76872971064133474d9b891da05db8f7586fcc11'/>
<id>urn:sha1:76872971064133474d9b891da05db8f7586fcc11</id>
<content type='text'>
In our test cases, we typically feed a packet sequence into the routing
code, then inspect the device's TXed skbs to assert specific behaviours.

Using dev_queue_xmit() for our TX path introduces a fair bit of
complexity between the test packet sequence and the test device's
ndo_start_xmit callback; which may mean that the skbs have not hit the
device at the point we're inspecting the TXed skb list.

Use dev_direct_xmit instead, as we want a direct a path as possible
here, and the test dev does not need any queueing, scheduling or flow
control.

Fixes: 6ab578739a4c ("net: mctp: test: move TX packetqueue from dst to dev")
Reported-by: kernel test robot &lt;oliver.sang@intel.com&gt;
Closes: https://lore.kernel.org/oe-lkp/202604281320.525eee17-lkp@intel.com
Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://patch.msgid.link/20260429-dev-mctp-test-fixes-v1-2-1127b7425809@codeconstruct.com.au
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mctp: test: use a zeroed struct sockaddr_mctp</title>
<updated>2026-04-30T20:36:47+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-04-29T08:21:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18ed60e33e6c77d62409c1343dec1c61bae3d2e7'/>
<id>urn:sha1:18ed60e33e6c77d62409c1343dec1c61bae3d2e7</id>
<content type='text'>
Invalid sockaddr padding will cause bind() to fail; ensure we have a
zeroed address in the testcase.

Fixes: 0d8647bc74cb ("net: mctp: don't require a route for null-EID ingress")
Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://patch.msgid.link/20260429-dev-mctp-test-fixes-v1-1-1127b7425809@codeconstruct.com.au
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mctp: fix don't require received header reserved bits to be zero</title>
<updated>2026-04-20T18:46:57+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=a663bac71a2f0b3ac6c373168ca57b2a6e6381aa'/>
<id>urn:sha1:a663bac71a2f0b3ac6c373168ca57b2a6e6381aa</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>net: mctp: defer creation of dst after source-address check</title>
<updated>2026-04-07T01:06:47+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-04-03T02:24:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f32ba0963119b2520127077d72ebe7f6f8cb847f'/>
<id>urn:sha1:f32ba0963119b2520127077d72ebe7f6f8cb847f</id>
<content type='text'>
Sashiko reports:

&gt; mctp_dst_from_route() increments the device reference count by calling
&gt; mctp_dev_hold(). When a valid route is found and dst is NULL, the
&gt; structure copy is bypassed and rc is set to 0.

Instead of optimistically creating a dst from the final route (then
releasing it if the saddr is invalid), perform the saddr check first.

This means we don't have an unuecessary hold/release on the dev, which
could leak if the dst pointer is NULL. No caller passes a NULL dst at
present though (so the leak is not possible), but this is an intended
use of mctp_dst_from_route().

Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://patch.msgid.link/20260403-dev-mctp-dst-defer-v1-1-9c2c55faf9e9@codeconstruct.com.au
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mctp: tests: use actual address when creating dev with addr</title>
<updated>2026-04-07T01:04:02+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-04-03T02:21:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=70e32aadb5cab9ef706962e1293582ec03f89625'/>
<id>urn:sha1:70e32aadb5cab9ef706962e1293582ec03f89625</id>
<content type='text'>
Sashiko reports:

&gt; This isn't a bug in the core networking code, but the addr parameter
&gt; appears to be ignored here.

In mctp_test_create_dev_with_addr(), we are ignoring the addr argument
and just using `8`. Use the passed address instead.

All invocations use 8 anyway, so no effective change at present.

Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Reviewed-by: Simon Horman &lt;horms@verge.net.au&gt;
Link: https://patch.msgid.link/20260403-dev-mctp-fix-test-addr-v1-1-b7fa789cdd9b@codeconstruct.com.au
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mctp: don't require a route for null-EID ingress</title>
<updated>2026-04-02T11:31:37+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-03-31T07:41:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d8647bc74cb50edf02e8c88977657596f20fb17'/>
<id>urn:sha1:0d8647bc74cb50edf02e8c88977657596f20fb17</id>
<content type='text'>
Currently, if we receive a physically-addressed packet for the local
stack, we perform a route_lookup_null to find a matching device-based
route. If a route is present, it will always have the -&gt;output fn set to
mctp_dst_input, which provides our delivery mechanism.

However, if we don't yet have any local addresses assigned, we won't
have any local routes to lookup, so this will fail. One of the use-cases
for physical addressing is initial address assignment on endpoint nodes,
where we would have no addresses, and therefore no local routes.

Instead of iterating routes (looking for one matching the dev), just
create a suitable mctp_dst for the device directly.

Add a testcase for the no-route case too.

Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20260331-dev-mctp-null-eids-v1-3-b4d047372eaf@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: mctp: allow local TX with no address assigned</title>
<updated>2026-04-02T11:31:36+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-03-31T07:41:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8af20defc4edb9e5ded39d36e1c7541569cd84d2'/>
<id>urn:sha1:8af20defc4edb9e5ded39d36e1c7541569cd84d2</id>
<content type='text'>
If we're operating as a non-bus-owner endpoint, we may want to perform
MCTP communication to get an address assigned. In this case, we'll have
no local addresses, but can TX just fine either with extended routing,
or where a direct route exists.

Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20260331-dev-mctp-null-eids-v1-2-b4d047372eaf@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: mctp: perform source address lookups when we populate our dst</title>
<updated>2026-04-02T11:31:36+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-03-31T07:41:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=22cb45afd221b9e4f2a1dcc74a8ff645b7293aa1'/>
<id>urn:sha1:22cb45afd221b9e4f2a1dcc74a8ff645b7293aa1</id>
<content type='text'>
Rather than querying the output device for its address in
mctp_local_output, set up the source address when we're populating the
dst structure. If no address is assigned, use MCTP_ADDR_NULL.

This will allow us more flexibility when routing for NULL-source-eid
cases. For now though, we still reject a NULL source address in the
output path.

We need to update the tests a little, so that addresses are assigned
before we do the dst lookups.

Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Link: https://patch.msgid.link/20260331-dev-mctp-null-eids-v1-1-b4d047372eaf@codeconstruct.com.au
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: mctp: avoid copy in fragmentation loop for near-MTU messages</title>
<updated>2026-03-27T01:47:29+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@codeconstruct.com.au</email>
</author>
<published>2026-03-24T07:19:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1877cf6231152ff4686bd9900a6a88ffdd90f84'/>
<id>urn:sha1:e1877cf6231152ff4686bd9900a6a88ffdd90f84</id>
<content type='text'>
Currently, we incorrectly send messages that are within 4 bytes (a
struct mctp_hdr) smaller than the MTU through mctp_do_fragment_route().
This has no effect on the actual fragmentation, as we will still send as
one packet, but unnecessarily copies the original skb into a new
single-fragment skb.

Instead of having the MTU comparisons in both mctp_local_output() and
mctp_do_fragment_route(), feed all local messages through the latter,
and add the single-packet optimisation there.

This means we can coalesce the routing path of mctp_local_output, so our
out_release path is now solely for errors, so rename the label
accordingly.

Include a check in the route tests for the single-packet case too.

Reported-by: yuanzhaoming &lt;yuanzm2@lenovo.com&gt;
Closes: https://github.com/openbmc/linux/commit/269936db5eb3962fe290b1dc4dbf1859cd5a04dd#r175836230
Signed-off-by: Jeremy Kerr &lt;jk@codeconstruct.com.au&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://patch.msgid.link/20260324-dev-mtu-copy-v1-1-7af6bd7027d3@codeconstruct.com.au
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>mctp: route: hold key-&gt;lock in mctp_flow_prepare_output()</title>
<updated>2026-03-10T10:38:36+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=7d86aa41c073c4e7eb75fd2e674f1fd8f289728a'/>
<id>urn:sha1:7d86aa41c073c4e7eb75fd2e674f1fd8f289728a</id>
<content type='text'>
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;
</content>
</entry>
</feed>
