Re: [RFC] SPDM attestation E2E findings from Renode testing

Matt Johnston <[email protected]>
Newsgroups org.ozlabs.lists.openbmc
Message-ID <91704f59fe5c3ab763927f66b6582d32975a1764.camel@codeconstruct.com.au>
Hi Gary,

On Wed, 2026-04-01 at 21:35 +0000, Gary Beihl wrote:
> 
> 
> (c) Shared AF_MCTP socket (affects 80311: mctp_helper.hpp)
>  
> Only one socket can bind to (MCTP_ADDR_ANY, MCTP_TYPE_SPDM).  When spdmd
> attests multiple endpoints sequentially, the second
>   MctpIoClass::createSocket() fails with EADDRINUSE. The fix is a process-
> lifetime shared socket (singleton pattern), draining stale responses
> between endpoint attestations with recv(MSG_DONTWAIT).

Since Linux 6.17 it is possible to restrict a bind() to only receive from a
single remote endpoint [1]. Call connect() with the remote address before the
bind().

Is the SPDM implementation using asynchronous messages sent by the responder?
(KEY_UPDATE, HEARTBEAT, END_SESSION)
If not, I think the bind() could be removed altogether.
bind() isn't needed in the case where the Linux host is performing a plain
send() then receiving a response. A similar situation was fixed in pldmtool
[2].

[1] https://lore.kernel.org/all/[email protected]/
[2] https://gerrit.openbmc.org/c/openbmc/pldm/+/83626 

Cheers,
Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.