[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAVpQUACaRY3gW1W1rBEFkYJxeJfVpL=BfuSv_99D7cqr-G6nQ@mail.gmail.com>
Date: Fri, 15 Aug 2025 23:54:50 -0700
From: Kuniyuki Iwashima <kuniyu@...gle.com>
To: Minhong He <heminhong@...inos.cn>
Cc: idosch@...sch.org, dsahern@...nel.org, edumazet@...gle.com,
kuba@...nel.org, netdev@...r.kernel.org, pabeni@...hat.com
Subject: Re: [PATCH net v4] ipv6: sr: validate HMAC algorithm ID in seg6_hmac_info_add
On Thu, Aug 14, 2025 at 11:39 PM Minhong He <heminhong@...inos.cn> wrote:
>
> The seg6_genl_sethmac() directly uses the algorithm ID provided by the
> userspace without verifying whether it is an HMAC algorithm supported
> by the system.
> If an unsupported HMAC algorithm ID is configured, packets using SRv6 HMAC
> will be dropped during encapsulation or decapsulation.
>
> Fixes: 4f4853dc1c9c ("ipv6: sr: implement API to control SR HMAC structure")
> Signed-off-by: Minhong He <heminhong@...inos.cn>
Reviewed-by: Kuniyuki Iwashima <kuniyu@...gle.com>
> ---
> net/ipv6/seg6_hmac.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c
> index f78ecb6ad838..d77b52523b6a 100644
> --- a/net/ipv6/seg6_hmac.c
> +++ b/net/ipv6/seg6_hmac.c
> @@ -304,6 +304,9 @@ int seg6_hmac_info_add(struct net *net, u32 key, struct seg6_hmac_info *hinfo)
> struct seg6_pernet_data *sdata = seg6_pernet(net);
> int err;
>
> + if (!__hmac_get_algo(hinfo->alg_id))
> + return -EINVAL;
> +
> err = rhashtable_lookup_insert_fast(&sdata->hmac_infos, &hinfo->node,
> rht_params);
>
> --
> 2.25.1
>
Powered by blists - more mailing lists