bpf: Remove inclusions of crypto/sha1.h
Subsystems (4)
PATCH v3 1/1 bpf: Remove inclusions of crypto/sha1.h
Since commit 603b44162325 ("bpf: Update the bpf_prog_calc_tag to use SHA256") made BPF program tags use SHA-256 instead of SHA-1, the header <crypto/sha1.h> no longer needs to be included. Remove the relevant inclusions so that they no longer unnecessarily come up in searches for which kernel code is still using the obsolete SHA-1 algorithm.
Since net/ipv6/addrconf.c was relying on the transitive inclusion of <crypto/sha1.h> (for an unrelated purpose) via <linux/filter.h>, make it include <crypto/sha1.h> explicitly in order to keep that file building.
---
v3: update net/ipv6/addrconf.c to fix transitive inclusion
v2: update include/linux/filter.h too
include/linux/filter.h | 1 - kernel/bpf/core.c | 1 - net/ipv6/addrconf.c | 1 + 3 files changed, 1 insertion(+), 2 deletions(-)
include/linux/filter.h +0 -1
@@ -19,11 +19,10 @@#include <linux/set_memory.h> #include <linux/kallsyms.h> #include <linux/if_vlan.h> #include <linux/vmalloc.h> #include <linux/sockptr.h> -#include <crypto/sha1.h> #include <linux/u64_stats_sync.h> #include <net/sch_generic.h> #include <asm/byteorder.h>
kernel/bpf/core.c +0 -1
@@ -16,11 +16,10 @@* Andi Kleen - Fix a few bad bugs and races. * Kris Katterjohn - Added many additional checks in bpf_check_classic() */ #include <uapi/linux/btf.h> -#include <crypto/sha1.h> #include <linux/filter.h> #include <linux/skbuff.h> #include <linux/vmalloc.h> #include <linux/prandom.h> #include <linux/bpf.h>
net/ipv6/addrconf.c +1 -0
@@ -34,10 +34,11 @@* status etc. */ #define pr_fmt (fmt) "IPv6: " fmt +#include <crypto/sha1.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched/signal.h> #include <linux/socket.h>
base-commit: 1c9982b4961334c1edb0745a04cabd34bc2de675
Signature · 1 line
2.53.0
Quoted 6 lines · Eric Biggers
Since commit
603b44162325("bpf: Update thebpf_prog_calc_tagto use SHA256") made BPF program tags use SHA-256 instead of SHA-1, the header <crypto/sha1.h> no longer needs to be included. Remove the relevant inclusions so that they no longer unnecessarily come up in searches for which kernel code is still using the obsolete SHA-1 algorithm.
Quoted 6 lines
Since
net/ipv6/addrconf.cwas relying on the transitive inclusion of <crypto/sha1.h> (for an unrelated purpose) via <linux/filter.h>, make it include <crypto/sha1.h> explicitly in order to keep that file building.Signed-off-by Eric Biggers <[email protected]>---
Quoted 63 lines
v3: update
net/ipv6/addrconf.cto fix transitive inclusion
v2: updateinclude/linux/filter.htooinclude/linux/filter.h | 1 - kernel/bpf/core.c | 1 - net/ipv6/addrconf.c | 1 + 3 files changed, 1 insertion(+), 2 deletions(-)include/linux/filter.h +0
-1@@ -19,11 +19,10 @@#include <linux/set_memory.h> #include <linux/kallsyms.h> #include <linux/if_vlan.h> #include <linux/vmalloc.h> #include <linux/sockptr.h> -#include <crypto/sha1.h> #include <linux/u64_stats_sync.h> #include <net/sch_generic.h> #include <asm/byteorder.h> kernel/bpf/core.c +0
-1@@ -16,11 +16,10 @@* Andi Kleen - Fix a few bad bugs and races. * Kris Katterjohn - Added many additional checks in bpf_check_classic() */ #include <uapi/linux/btf.h> -#include <crypto/sha1.h> #include <linux/filter.h> #include <linux/skbuff.h> #include <linux/vmalloc.h> #include <linux/prandom.h> #include <linux/bpf.h> net/ipv6/addrconf.c +1
-0@@ -34,10 +34,11 @@* status etc. */ #define pr_fmt (fmt) "IPv6: " fmt +#include <crypto/sha1.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched/signal.h> #include <linux/socket.h> base-commit:
1c9982b4961334c1edb0745a04cabd34bc2de675Signature · 1 line
2.53.0