Skip to content

Commit 5fcf080

Browse files
wangzqbjkuba-moo
authored andcommitted
net: mctp: Consistent peer address handling in ioctl tag allocation
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 <[email protected]> Reviewed-by: Jeremy Kerr <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5fa35bd commit 5fcf080

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/mctp/af_mctp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ static int mctp_ioctl_droptag(struct mctp_sock *msk, bool tagv2,
486486
tag = ctl.tag & MCTP_TAG_MASK;
487487
rc = -EINVAL;
488488

489+
if (ctl.peer_addr == MCTP_ADDR_NULL)
490+
ctl.peer_addr = MCTP_ADDR_ANY;
491+
489492
spin_lock_irqsave(&net->mctp.keys_lock, flags);
490493
hlist_for_each_entry_safe(key, tmp, &msk->keys, sklist) {
491494
/* we do an irqsave here, even though we know the irq state,

0 commit comments

Comments
 (0)