Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <wangzhiqiang02@ieisystem.com>
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://patch.msgid.link/20240730084636.184140-1-wangzhiqiang02@ieisystem.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

John Wang and committed by
Jakub Kicinski
5fcf0801 5fa35bd3

+3
+3
net/mctp/af_mctp.c
··· 486 486 tag = ctl.tag & MCTP_TAG_MASK; 487 487 rc = -EINVAL; 488 488 489 + if (ctl.peer_addr == MCTP_ADDR_NULL) 490 + ctl.peer_addr = MCTP_ADDR_ANY; 491 + 489 492 spin_lock_irqsave(&net->mctp.keys_lock, flags); 490 493 hlist_for_each_entry_safe(key, tmp, &msk->keys, sklist) { 491 494 /* we do an irqsave here, even though we know the irq state,