Skip to content

Commit e477275

Browse files
rastislavsgregkh
authored andcommitted
net/tcp: fix TCP-AO key deletion in VRFs
commit 94ad9e1 upstream. TCP-AO keys with TCP_AO_KEYF_IFINDEX store the VRF L3 interface index in l3index. tcp_ao_del_cmd() validates the supplied ifindex, but does not assign it to its local l3index before matching keys. As a result, deleting a key scoped to a non-default VRF always fails with ENOENT because it is matched against l3index 0. Fixes: 248411b ("net/tcp: Wire up l3index to TCP-AO") Cc: stable@vger.kernel.org Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com> Reviewed-by: David Ahern <dsahern@kernel.org> Acked-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://patch.msgid.link/20260822201119.272269-1-rastislav.szabo@isovalent.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent efb867f commit e477275

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/ipv4/tcp_ao.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,6 +1854,9 @@ static int tcp_ao_del_cmd(struct sock *sk, unsigned short int family,
18541854
if (cmd.ifindex && !(cmd.keyflags & TCP_AO_KEYF_IFINDEX))
18551855
return -EINVAL;
18561856

1857+
if (cmd.keyflags & TCP_AO_KEYF_IFINDEX)
1858+
l3index = cmd.ifindex;
1859+
18571860
ao_info = setsockopt_ao_info(sk);
18581861
if (IS_ERR(ao_info))
18591862
return PTR_ERR(ao_info);

0 commit comments

Comments
 (0)