* [PATCH net] net: mctp: Consistent peer address handling in ioctl tag allocation
@ 2024-07-30 3:40 John Wang
2024-07-30 19:05 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: John Wang @ 2024-07-30 3:40 UTC (permalink / raw)
To: Jeremy Kerr, Matt Johnston, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel
When executing ioctl to allocate tags, if the peer address is 0,
mctp_alloc_local_tag now replaces it with 0xff. However, during tag
dropping, this replacement is not performed, potentially causing the key
not to be dropped as expected.
Signed-off-by: John Wang <wangzhiqiang02@ieisystem.com>
Change-Id: I9c75aa8aff4bc048dd3be563f7f50a6fb14dc028
---
net/mctp/af_mctp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index de52a9191da0..43288b408fde 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -486,6 +486,9 @@ static int mctp_ioctl_droptag(struct mctp_sock *msk, bool tagv2,
tag = ctl.tag & MCTP_TAG_MASK;
rc = -EINVAL;
+ if (ctl.peer_addr == MCTP_ADDR_NULL)
+ ctl.peer_addr = MCTP_ADDR_ANY;
+
spin_lock_irqsave(&net->mctp.keys_lock, flags);
hlist_for_each_entry_safe(key, tmp, &msk->keys, sklist) {
/* we do an irqsave here, even though we know the irq state,
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net] net: mctp: Consistent peer address handling in ioctl tag allocation
2024-07-30 3:40 [PATCH net] net: mctp: Consistent peer address handling in ioctl tag allocation John Wang
@ 2024-07-30 19:05 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-07-30 19:05 UTC (permalink / raw)
To: John Wang
Cc: Jeremy Kerr, Matt Johnston, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
On Tue, Jul 30, 2024 at 11:40:31AM +0800, John Wang wrote:
> When executing ioctl to allocate tags, if the peer address is 0,
> mctp_alloc_local_tag now replaces it with 0xff. However, during tag
> dropping, this replacement is not performed, potentially causing the key
> not to be dropped as expected.
>
> Signed-off-by: John Wang <wangzhiqiang02@ieisystem.com>
> Change-Id: I9c75aa8aff4bc048dd3be563f7f50a6fb14dc028
Hi John,
This is not a full review, so I would recommend waiting for feedback
from others, but please:
1. Do not include the Change-Id as it is not obvious what public
resource it references
2. As this is a fix targeted at net, please do include a Fixes tag,
indicating the commit where this user-visible problem first
manifested.
Also, as an aside, please wait 24h between posting updated patches.
Link: https://docs.kernel.org/process/maintainer-netdev.html
...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-30 19:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 3:40 [PATCH net] net: mctp: Consistent peer address handling in ioctl tag allocation John Wang
2024-07-30 19:05 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).