bpf: Remove inclusions of crypto/sha1.h
PATCH v2 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.
---
v2: also update include/linux/filter.h
include/linux/filter.h | 1 - kernel/bpf/core.c | 1 - 2 files changed, 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>
base-commit: 1c9982b4961334c1edb0745a04cabd34bc2de675
Signature · 1 line
2.53.0
syzbot ci has tested the following series
syzbot ci has tested the following series
[v2] bpf: Remove inclusions of crypto/sha1.h
https://lore.kernel.org/all/[email protected]
* [PATCH bpf-next v2] bpf: Remove inclusions of crypto/sha1.h
and found the following issue:
kernel build error
Full report is available here:
https://ci.syzbot.org/series/38f41420-5e88-492b-9239-7c260178aa25
***
kernel build error
tree: torvalds URL: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux base: 1c9982b4961334c1edb0745a04cabd34bc2de675 arch: amd64 compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8 config: https://ci.syzbot.org/builds/b5327796-0a46-46fc-a192-f0dbd20d9047/config
net/ipv6/addrconf.c:3341:25: error: variable has incomplete type 'struct sha1_ctx'net/ipv6/addrconf.c:3344:13: error: use of undeclared identifier 'SHA1_BLOCK_SIZE'net/ipv6/addrconf.c:3369:2: error: call to undeclared function 'sha1_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] net/ipv6/addrconf.c:3378:2: error: call to undeclared function 'sha1_update'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
***
If these findings have caused you to resend the series or submit a separate fix, please add the following tag to your commit message:
---
This report is generated by a bot. It may contain errors. syzbot ci engineers can be reached at [email protected].
Quoted 4 lines · syzbot ci
net/ipv6/addrconf.c:3341:25: error: variable has incomplete type 'structsha1_ctx'net/ipv6/addrconf.c:3344:13: error: use of undeclared identifier 'SHA1_BLOCK_SIZE'net/ipv6/addrconf.c:3369:2: error: call to undeclared function 'sha1_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]net/ipv6/addrconf.c:3378:2: error: call to undeclared function 'sha1_update'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
Thanks. The BPF CI caught this first, and this was already fixed in v3.
- Eric