Home
last modified time | relevance | path

Searched full:hook (Results 1 – 25 of 682) sorted by relevance

12345678910>>...28

/linux/tools/testing/selftests/bpf/prog_tests/
H A Dtc_bpf.c26 static int test_tc_bpf_basic(const struct bpf_tc_hook *hook, int fd) in test_tc_bpf_basic() argument
37 ret = bpf_tc_attach(hook, &opts); in test_tc_bpf_basic()
48 ret = bpf_tc_attach(hook, &opts); in test_tc_bpf_basic()
53 ret = bpf_tc_query(hook, &opts); in test_tc_bpf_basic()
64 ret = bpf_tc_detach(hook, &opts); in test_tc_bpf_basic()
69 static int test_tc_bpf_api(struct bpf_tc_hook *hook, int fd) in test_tc_bpf_api() argument
77 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_hook_create invalid hook = NULL")) in test_tc_bpf_api()
80 /* hook ifindex = 0 */ in test_tc_bpf_api()
82 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_hook_create invalid hook ifindex == 0")) in test_tc_bpf_api()
86 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_hook_destroy invalid hook ifindex == 0")) in test_tc_bpf_api()
[all …]
H A Dxfrm_info.c72 static int attach_tc_prog(struct bpf_tc_hook *hook, int igr_fd, int egr_fd) in attach_tc_prog() argument
80 ret = bpf_tc_hook_create(hook); in attach_tc_prog()
81 if (!ASSERT_OK(ret, "create tc hook")) in attach_tc_prog()
85 hook->attach_point = BPF_TC_INGRESS; in attach_tc_prog()
86 ret = bpf_tc_attach(hook, &opts1); in attach_tc_prog()
88 bpf_tc_hook_destroy(hook); in attach_tc_prog()
94 hook->attach_point = BPF_TC_EGRESS; in attach_tc_prog()
95 ret = bpf_tc_attach(hook, &opts2); in attach_tc_prog()
97 bpf_tc_hook_destroy(hook); in attach_tc_prog()
300 /* load and attach bpf progs to ipsec dev tc hook point */ in _test_xfrm_info()
H A Dtest_tunnel.c553 /* load and attach bpf prog to tunnel dev tc hook point */ in test_ip6vxlan_tunnel()
562 /* load and attach bpf prog to veth dev tc hook point */ in test_ipip_tunnel()
567 /* load and attach prog set_md to tunnel dev tc hook point at_ns0 */ in test_ipip_tunnel()
613 /* load and attach bpf prog to tunnel dev tc hook point */ in test_ipip_tunnel()
622 /* load and attach prog set_md to tunnel dev tc hook point at_ns0 */ in test_ipip_tunnel()
663 /* load and attach bpf prog to tunnel dev tc hook point */ in test_xfrm_tunnel()
367 attach_tc_prog(struct bpf_tc_hook * hook,int igr_fd,int egr_fd) attach_tc_prog() argument
/linux/net/netfilter/
H A Dnf_bpf_link.c38 const struct nf_defrag_hook *hook; in get_proto_defrag_hook() local
43 hook = rcu_dereference(*ptr_global_hook); in get_proto_defrag_hook()
44 if (!hook) { in get_proto_defrag_hook()
51 hook = rcu_dereference(*ptr_global_hook); in get_proto_defrag_hook()
54 if (hook && try_module_get(hook->owner)) { in get_proto_defrag_hook()
56 hook = rcu_pointer_handoff(hook); in get_proto_defrag_hook()
58 WARN_ONCE(!hook, "%s has bad registration", mod); in get_proto_defrag_hook()
59 hook = ERR_PTR(-ENOENT); in get_proto_defrag_hook()
63 if (!IS_ERR(hook)) { in get_proto_defrag_hook()
64 err = hook->enable(link->net); in get_proto_defrag_hook()
[all …]
H A Dnf_conntrack_pptp.c92 const struct nf_nat_pptp_hook *hook; in pptp_expectfn() local
103 hook = rcu_dereference(nf_nat_pptp_hook); in pptp_expectfn()
104 if (hook && ct->master->status & IPS_NAT_MASK) in pptp_expectfn()
105 hook->expectfn(ct, exp); in pptp_expectfn()
190 const struct nf_nat_pptp_hook *hook; in exp_gre() local
220 hook = rcu_dereference(nf_nat_pptp_hook); in exp_gre()
221 if (hook && ct->status & IPS_NAT_MASK) in exp_gre()
222 hook->exp_gre(exp_orig, exp_reply); in exp_gre()
256 const struct nf_nat_pptp_hook *hook; in pptp_inbound_pkt() local
360 hook = rcu_dereference(nf_nat_pptp_hook); in pptp_inbound_pkt()
[all …]
H A Dnf_tables_api.c322 struct nft_hook *hook; in nft_netdev_register_hooks() local
326 list_for_each_entry(hook, hook_list, list) { in nft_netdev_register_hooks()
327 list_for_each_entry(ops, &hook->ops_list, list) { in nft_netdev_register_hooks()
338 list_for_each_entry(hook, hook_list, list) { in nft_netdev_register_hooks()
339 list_for_each_entry(ops, &hook->ops_list, list) { in nft_netdev_register_hooks()
349 static void nft_netdev_hook_free_ops(struct nft_hook *hook) in nft_netdev_hook_free_ops() argument
353 list_for_each_entry_safe(ops, next, &hook->ops_list, list) { in nft_netdev_hook_free_ops()
359 static void nft_netdev_hook_free(struct nft_hook *hook) in nft_netdev_hook_free() argument
361 nft_netdev_hook_free_ops(hook); in nft_netdev_hook_free()
362 kfree(hook); in nft_netdev_hook_free()
[all …]
H A Dnft_chain_filter.c173 /* Original hook is NFPROTO_NETDEV and NF_NETDEV_INGRESS. */ in nft_do_chain_inet_ingress()
175 ingress_state.hook = NF_INET_INGRESS; in nft_do_chain_inet_ingress()
183 ingress_state.hook = NF_INET_INGRESS; in nft_do_chain_inet_ingress()
327 struct nft_hook *hook; in nft_netdev_event() local
330 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_netdev_event()
331 ops = nft_hook_find_ops(hook, dev); in nft_netdev_event()
332 match = !strncmp(hook->ifname, dev->name, hook->ifnamelen); in nft_netdev_event()
364 list_add_tail_rcu(&ops->list, &hook->ops_list); in nft_netdev_event()
H A Dnf_tables_offload.c225 struct nft_hook *hook; in nft_chain_offload_support() local
230 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_chain_offload_support()
231 list_for_each_entry(ops, &hook->ops_list, list) { in nft_chain_offload_support()
463 struct nft_hook *hook; in nft_flow_block_chain() local
466 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_flow_block_chain()
467 list_for_each_entry(ops, &hook->ops_list, list) { in nft_flow_block_chain()
485 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_flow_block_chain()
486 list_for_each_entry(ops, &hook->ops_list, list) { in nft_flow_block_chain()
632 struct nft_hook *hook, *found; in __nft_offload_get_chain() local
647 list_for_each_entry(hook, &basechain->hook_list, list) { in __nft_offload_get_chain()
[all …]
/linux/include/linux/
H A Dnetfilter.h79 u8 hook; member
103 nf_hookfn *hook; member
114 nf_hookfn *hook; member
128 /* trailer: pointers to original orig_ops of each hook,
133 * needed in slow path (hook register/unregister):
137 * only needed when a hook is deleted, not during
158 return entry->hook(entry->priv, skb, state); in nf_hook_entry_hookfn()
162 unsigned int hook, in nf_hook_state_init() argument
170 p->hook = hook; in nf_hook_state_init()
198 /* Function to register/unregister hook points. */
[all …]
/linux/tools/lib/bpf/
H A Dnetlink.c534 typedef int (*qdisc_config_t)(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook);
536 static int clsact_config(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook) in clsact_config() argument
544 static int qdisc_config(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook) in qdisc_config() argument
546 const char *qdisc = OPTS_GET(hook, qdisc, NULL); in qdisc_config()
548 req->tc.tcm_parent = OPTS_GET(hook, parent, TC_H_ROOT); in qdisc_config()
549 req->tc.tcm_handle = OPTS_GET(hook, handle, 0); in qdisc_config()
554 static int attach_point_to_config(struct bpf_tc_hook *hook, in attach_point_to_config() argument
557 switch (OPTS_GET(hook, attach_point, 0)) { in attach_point_to_config()
561 if (OPTS_GET(hook, parent, 0)) in attach_point_to_config()
597 static int tc_qdisc_modify(struct bpf_tc_hook *hook, int cmd, int flags) in tc_qdisc_modify() argument
[all …]
/linux/rust/proc-macro2/
H A Ddetection.rs34 // Swap in a null panic hook to avoid printing "thread panicked" to stderr,
41 // thread 1 calls take_hook, gets the user's original hook
42 // thread 1 calls set_hook with the null hook
43 // thread 2 calls take_hook, thinks null hook is the original hook
44 // thread 2 calls set_hook with the null hook
45 // thread 1 calls set_hook with the actual original hook
46 // thread 2 calls set_hook with what it thinks is the original hook
48 // in which the user's hook has been lost.
51 // happen during the interval that the user's original panic hook is
52 // unregistered such that their hook is incorrectly not called. This is
/linux/net/ipv4/netfilter/
H A Dipt_REJECT.c34 int hook = xt_hooknum(par); in reject_tg() local
38 nf_send_unreach(skb, ICMP_NET_UNREACH, hook); in reject_tg()
41 nf_send_unreach(skb, ICMP_HOST_UNREACH, hook); in reject_tg()
44 nf_send_unreach(skb, ICMP_PROT_UNREACH, hook); in reject_tg()
47 nf_send_unreach(skb, ICMP_PORT_UNREACH, hook); in reject_tg()
50 nf_send_unreach(skb, ICMP_NET_ANO, hook); in reject_tg()
53 nf_send_unreach(skb, ICMP_HOST_ANO, hook); in reject_tg()
56 nf_send_unreach(skb, ICMP_PKT_FILTERED, hook); in reject_tg()
59 nf_send_reset(xt_net(par), par->state->sk, skb, hook); in reject_tg()
/linux/security/ipe/
H A Dhooks.c19 * ipe_bprm_check_security() - ipe security hook function for bprm check.
23 * This LSM hook is called when a binary is loaded through the exec
39 * ipe_bprm_creds_for_exec() - ipe security hook function for bprm creds check.
43 * This LSM hook is called when userspace signals the kernel to check a file
45 * The hook triggers IPE policy evaluation on the script file and returns
66 * ipe_mmap_file() - ipe security hook function for mmap check.
73 * This hook is called when a file is loaded through the mmap
94 * ipe_file_mprotect() - ipe security hook function for mprotect check.
100 * This LSM hook is called when a mmap'd region of memory is changing
126 * ipe_kernel_read_file() - ipe security hook function for kernel read.
[all …]
/linux/drivers/acpi/
H A Dbattery.c704 static void battery_hook_unregister_unlocked(struct acpi_battery_hook *hook) in battery_hook_unregister_unlocked() argument
709 * In order to remove a hook, we first need to in battery_hook_unregister_unlocked()
713 if (!hook->remove_battery(battery->bat, hook)) in battery_hook_unregister_unlocked()
716 list_del_init(&hook->list); in battery_hook_unregister_unlocked()
718 pr_info("hook unregistered: %s\n", hook->name); in battery_hook_unregister_unlocked()
721 void battery_hook_unregister(struct acpi_battery_hook *hook) in battery_hook_unregister() argument
726 * if a battery hook was previously unloaded due to an error when in battery_hook_unregister()
729 if (!list_empty(&hook->list)) in battery_hook_unregister()
730 battery_hook_unregister_unlocked(hook); in battery_hook_unregister()
736 void battery_hook_register(struct acpi_battery_hook *hook) in battery_hook_register() argument
[all …]
/linux/security/integrity/ima/
H A Dima.h49 /* bitset of digests algorithms allowed in the setxattr hook */
340 #define __ima_hooks(hook) \ in func_measure_str()
341 hook(NONE, none) \ in func_measure_str()
342 hook(FILE_CHECK, file) \ in func_measure_str()
343 hook(MMAP_CHECK, mmap) \ in func_measure_str()
344 hook(MMAP_CHECK_REQPROT, mmap_reqprot) \ in func_measure_str()
345 hook(BPRM_CHECK, bprm) \ in func_measure_str()
346 hook(CREDS_CHECK, creds) \
347 hook(POST_SETATTR, post_setattr) \
348 hook(MODULE_CHEC
307 __ima_hooks(hook) global() argument
[all...]
/linux/security/selinux/
H A Dxfrm.c5 * This file contains the SELinux XFRM hook function implementations.
145 * LSM hook implementation that authorizes that a flow can use a xfrm policy
167 * LSM hook implementation that authorizes that a state matches
253 * LSM hook implementation that checks and/or returns the xfrm sid for the
277 * LSM hook implementation that allocs and transfers uctx spec to xfrm_policy.
287 * LSM hook implementation that copies security data structure from old to new
309 * LSM hook implementation that frees xfrm_sec_ctx security information.
317 * LSM hook implementation that authorizes deletion of labeled policies.
325 * LSM hook implementation that allocates a xfrm_sec_state, populates it using
335 * LSM hook implementation that allocates a xfrm_sec_state and populates based
[all …]
/linux/include/uapi/linux/netfilter/
H A Dnfnetlink_hook.h11 * enum nfnl_hook_attributes - netfilter hook netlink attributes
13 * @NFNLA_HOOK_HOOKNUM: netfilter hook number (NLA_U32)
14 * @NFNLA_HOOK_PRIORITY: netfilter hook priority (NLA_U32)
16 * @NFNLA_HOOK_FUNCTION_NAME: hook function name (NLA_STRING)
17 * @NFNLA_HOOK_MODULE_NAME: kernel module that registered this hook (NLA_STRING)
18 * @NFNLA_HOOK_CHAIN_INFO: basechain hook metadata (NLA_NESTED)
/linux/include/acpi/
H A Dbattery.h16 int (*add_battery)(struct power_supply *battery, struct acpi_battery_hook *hook);
17 int (*remove_battery)(struct power_supply *battery, struct acpi_battery_hook *hook);
21 void battery_hook_register(struct acpi_battery_hook *hook);
22 void battery_hook_unregister(struct acpi_battery_hook *hook);
23 int devm_battery_hook_register(struct device *dev, struct acpi_battery_hook *hook);
/linux/tools/testing/selftests/net/netfilter/
H A Dnft_queue.sh98 type filter hook prerouting priority $prio; policy accept;
102 type filter hook input priority $prio; policy accept;
106 type filter hook forward priority $prio; policy accept;
111 type filter hook output priority $prio; policy accept;
117 type filter hook postrouting priority $prio; policy accept;
130 type filter hook prerouting priority $prio; policy accept;
134 type filter hook input priority $prio; policy accept;
138 type filter hook forward priority $prio; policy accept;
142 type filter hook output priority $prio; policy accept;
146 type filter hook postrouting priority $prio; policy accept;
[all …]
H A Dnft_nat.sh161 type nat hook output priority 0; policy accept;
167 echo "SKIP: Could not add add $family dnat hook"
231 type nat hook output priority 0; policy accept;
242 echo "SKIP: Could not add add $family dnat hook"
353 type nat hook output priority 0; policy accept;
365 echo "SKIP: Could not add $family dnat hook"
415 type nat hook postrouting priority 0; policy accept;
421 echo "SKIP: Could not add add $family masquerade hook"
506 type nat hook postrouting priority 0; policy accept;
512 echo "SKIP: Could not add add $family masquerade hook"
[all...]
H A Dnft_interface_stress.sh6 # renaming of interfaces which netdev-family chains and flowtables hook into.
46 type filter hook ingress device rc$i priority 0
50 type filter hook ingress device rs$i priority 0
60 hook ingress priority 0
66 echo "type filter hook forward priority 0"
106 hook ingress priority 0
/linux/fs/xfs/
H A Dxfs_hooks.h37 typedef int (*xfs_hook_fn_t)(struct xfs_hook *hook, unsigned long action,
41 int xfs_hooks_add(struct xfs_hooks *chain, struct xfs_hook *hook);
42 void xfs_hooks_del(struct xfs_hooks *chain, struct xfs_hook *hook);
46 static inline void xfs_hook_setup(struct xfs_hook *hook, notifier_fn_t fn) in xfs_hook_setup() argument
48 hook->nb.notifier_call = fn; in xfs_hook_setup()
49 hook->nb.priority = 0; in xfs_hook_setup()
/linux/sound/core/
H A Dvmaster.c36 void (*hook)(void *private_data, int); member
124 if (master->hook) in master_init()
125 master->hook(master->hook_private_data, master->val); in master_init()
379 if (master->hook && !first_init) in master_put()
380 master->hook(master->hook_private_data, master->val); in master_put()
465 * snd_ctl_add_vmaster_hook - Add a hook to a vmaster control
467 * @hook: the hook function
470 * Adds the given hook to the vmaster control element so that it's called
476 void (*hook)(void *private_data, int), in snd_ctl_add_vmaster_hook()
480 master->hook = hook; in snd_ctl_add_vmaster_hook()
[all …]
/linux/security/
H A Dsecurity.c39 * security_locked_down() LSM hook. Placing this array here allows
88 #define SECURITY_HOOK_ACTIVE_KEY(HOOK, IDX) security_hook_active_##HOOK##_##IDX argument
92 * HOOK is an LSM hook as defined in linux/lsm_hookdefs.h
95 #define LSM_STATIC_CALL(HOOK, IDX) lsm_static_call_##HOOK##_##IDX argument
98 * Call the macro M for each LSM hook MAX_LSM_COUNT times.
115 * Define static calls and static keys for each LSM hook.
129 * Initialise a table of static calls for each LSM hook.
439 * The default value of the LSM hook is defined in linux/lsm_hook_defs.h and
445 * LSM hook.
458 * Hook list operation macros.
[all …]
/linux/tools/testing/selftests/bpf/progs/
H A Dverifier_lsm.c131 __description("lsm disabled hook: getprocattr")
132 __failure __msg("points to disabled hook") in disabled_hook_test1()
142 __description("lsm disabled hook: setprocattr")
143 __failure __msg("points to disabled hook") in disabled_hook_test2()
153 __description("lsm disabled hook: ismaclabel")
154 __failure __msg("points to disabled hook") in disabled_hook_test3()

12345678910>>...28