cregit-Linux how code gets into the kernel

Release 4.14 net/xfrm/xfrm_sysctl.c

Directory: net/xfrm
// SPDX-License-Identifier: GPL-2.0
#include <linux/sysctl.h>
#include <linux/slab.h>
#include <net/net_namespace.h>
#include <net/xfrm.h>


static void __net_init __xfrm_sysctl_init(struct net *net) { net->xfrm.sysctl_aevent_etime = XFRM_AE_ETIME; net->xfrm.sysctl_aevent_rseqth = XFRM_AE_SEQT_SIZE; net->xfrm.sysctl_larval_drop = 1; net->xfrm.sysctl_acq_expires = 30; }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan44100.00%2100.00%
Total44100.00%2100.00%

#ifdef CONFIG_SYSCTL static struct ctl_table xfrm_table[] = { { .procname = "xfrm_aevent_etime", .maxlen = sizeof(u32), .mode = 0644, .proc_handler = proc_douintvec }, { .procname = "xfrm_aevent_rseqth", .maxlen = sizeof(u32), .mode = 0644, .proc_handler = proc_douintvec }, { .procname = "xfrm_larval_drop", .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec }, { .procname = "xfrm_acq_expires", .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec }, {} };
int __net_init xfrm_sysctl_init(struct net *net) { struct ctl_table *table; __xfrm_sysctl_init(net); table = kmemdup(xfrm_table, sizeof(xfrm_table), GFP_KERNEL); if (!table) goto out_kmemdup; table[0].data = &net->xfrm.sysctl_aevent_etime; table[1].data = &net->xfrm.sysctl_aevent_rseqth; table[2].data = &net->xfrm.sysctl_larval_drop; table[3].data = &net->xfrm.sysctl_acq_expires; /* Don't export sysctls to unprivileged users */ if (net->user_ns != &init_user_ns) table[0].procname = NULL; net->xfrm.sysctl_hdr = register_net_sysctl(net, "net/core", table); if (!net->xfrm.sysctl_hdr) goto out_register; return 0; out_register: kfree(table); out_kmemdup: return -ENOMEM; }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan14086.96%133.33%
Eric W. Biedermann2113.04%266.67%
Total161100.00%3100.00%


void __net_exit xfrm_sysctl_fini(struct net *net) { struct ctl_table *table; table = net->xfrm.sysctl_hdr->ctl_table_arg; unregister_net_sysctl_table(net->xfrm.sysctl_hdr); kfree(table); }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan40100.00%2100.00%
Total40100.00%2100.00%

#else
int __net_init xfrm_sysctl_init(struct net *net) { __xfrm_sysctl_init(net); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan19100.00%1100.00%
Total19100.00%1100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan36793.15%228.57%
Eric W. Biedermann215.33%228.57%
Tejun Heo30.76%114.29%
Subash Abhinov Kasiviswanathan20.51%114.29%
Greg Kroah-Hartman10.25%114.29%
Total394100.00%7100.00%
Directory: net/xfrm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.