Skip to content

Commit ef3df0c

Browse files
committed
Merge: srv6: stable backport for 10.2 phase 1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1450 JIRA: https://issues.redhat.com/browse/RHEL-115599 * 7632fed seg6: Fix validation of nexthop addresses * 84967de ipv6: sr: validate HMAC algorithm ID in seg6_hmac_info_add * a458b29 ipv6: sr: Fix MAC comparison to be constant-time Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-09-18 05:44 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small> Approved-by: Sabrina Dubroca <sdubroca@redhat.com> Approved-by: Antoine Tenart <atenart@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Scott Weaver <scweaver@redhat.com>
2 parents e35fb6b + 40756bb commit ef3df0c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

net/ipv6/seg6_hmac.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <net/xfrm.h>
3636

3737
#include <crypto/hash.h>
38+
#include <crypto/utils.h>
3839
#include <net/seg6.h>
3940
#include <net/genetlink.h>
4041
#include <net/seg6_hmac.h>
@@ -271,7 +272,7 @@ bool seg6_hmac_validate_skb(struct sk_buff *skb)
271272
if (seg6_hmac_compute(hinfo, srh, &ipv6_hdr(skb)->saddr, hmac_output))
272273
return false;
273274

274-
if (memcmp(hmac_output, tlv->hmac, SEG6_HMAC_FIELD_LEN) != 0)
275+
if (crypto_memneq(hmac_output, tlv->hmac, SEG6_HMAC_FIELD_LEN))
275276
return false;
276277

277278
return true;
@@ -295,6 +296,9 @@ int seg6_hmac_info_add(struct net *net, u32 key, struct seg6_hmac_info *hinfo)
295296
struct seg6_pernet_data *sdata = seg6_pernet(net);
296297
int err;
297298

299+
if (!__hmac_get_algo(hinfo->alg_id))
300+
return -EINVAL;
301+
298302
err = rhashtable_lookup_insert_fast(&sdata->hmac_infos, &hinfo->node,
299303
rht_params);
300304

net/ipv6/seg6_local.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,10 +1644,8 @@ static const struct nla_policy seg6_local_policy[SEG6_LOCAL_MAX + 1] = {
16441644
[SEG6_LOCAL_SRH] = { .type = NLA_BINARY },
16451645
[SEG6_LOCAL_TABLE] = { .type = NLA_U32 },
16461646
[SEG6_LOCAL_VRFTABLE] = { .type = NLA_U32 },
1647-
[SEG6_LOCAL_NH4] = { .type = NLA_BINARY,
1648-
.len = sizeof(struct in_addr) },
1649-
[SEG6_LOCAL_NH6] = { .type = NLA_BINARY,
1650-
.len = sizeof(struct in6_addr) },
1647+
[SEG6_LOCAL_NH4] = NLA_POLICY_EXACT_LEN(sizeof(struct in_addr)),
1648+
[SEG6_LOCAL_NH6] = NLA_POLICY_EXACT_LEN(sizeof(struct in6_addr)),
16511649
[SEG6_LOCAL_IIF] = { .type = NLA_U32 },
16521650
[SEG6_LOCAL_OIF] = { .type = NLA_U32 },
16531651
[SEG6_LOCAL_BPF] = { .type = NLA_NESTED },

0 commit comments

Comments
 (0)