lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue,  4 Oct 2022 11:09:41 +0200
From:   "Jason A. Donenfeld" <Jason@...c4.com>
To:     ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
        bpf@...r.kernel.org, netdev@...r.kernel.org, kuba@...nel.org
Cc:     "Jason A. Donenfeld" <Jason@...c4.com>
Subject: [PATCH] bpf: unify function pointer type of dispatcher

The __bpf_prog_run() function takes a bpf_dispatcher_fn as its last
argument, which are usually generated by use of the
DEFINE_BPF_DISPATCHER() macro. The last argument of a bpf_dispatcher_fn
is an open coded function pointer. The DEFINE_BPF_DISPATCHER() macro, on the
other hand, has as its last argument a bpf_func_t, rather than an open
coded function pointer. Unify these two signatures by using bpf_func_t
in both places, since it's the same as the open coded function pointer.

Signed-off-by: Jason A. Donenfeld <Jason@...c4.com>
---
 include/linux/filter.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/filter.h b/include/linux/filter.h
index 527ae1d64e27..25e85cfc28b8 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -569,8 +569,7 @@ DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key);
 
 typedef unsigned int (*bpf_dispatcher_fn)(const void *ctx,
 					  const struct bpf_insn *insnsi,
-					  unsigned int (*bpf_func)(const void *,
-								   const struct bpf_insn *));
+					  bpf_func_t bpf_func);
 
 static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog,
 					  const void *ctx,
-- 
2.37.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ