forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/net/core/bpf_sk_storage.c
....@@ -446,8 +446,11 @@
446446 return ERR_PTR(-EPERM);
447447
448448 nla_for_each_nested(nla, nla_stgs, rem) {
449
- if (nla_type(nla) == SK_DIAG_BPF_STORAGE_REQ_MAP_FD)
449
+ if (nla_type(nla) == SK_DIAG_BPF_STORAGE_REQ_MAP_FD) {
450
+ if (nla_len(nla) != sizeof(u32))
451
+ return ERR_PTR(-EINVAL);
450452 nr_maps++;
453
+ }
451454 }
452455
453456 diag = kzalloc(sizeof(*diag) + sizeof(diag->maps[0]) * nr_maps,