#include <linux/init.h>
#include <linux/sysctl.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/printk.h>
#include <linux/security.h>
#include <linux/sched.h>
#include <linux/cred.h>
#include <linux/namei.h>
#include <linux/mm.h>
#include <linux/uio.h>
#include <linux/module.h>
#include <linux/bpf-cgroup.h>
#include <linux/mount.h>
#include <linux/kmemleak.h>
#include "internal.h"
#define list_for_each_table_entry(entry, header) …
static const struct dentry_operations proc_sys_dentry_operations;
static const struct file_operations proc_sys_file_operations;
static const struct inode_operations proc_sys_inode_operations;
static const struct file_operations proc_sys_dir_file_operations;
static const struct inode_operations proc_sys_dir_operations;
static struct ctl_table sysctl_mount_point[] = …;
struct ctl_table_header *register_sysctl_mount_point(const char *path)
{ … }
EXPORT_SYMBOL(…);
#define sysctl_is_perm_empty_ctl_header(hptr) …
#define sysctl_set_perm_empty_ctl_header(hptr) …
#define sysctl_clear_perm_empty_ctl_header(hptr) …
void proc_sys_poll_notify(struct ctl_table_poll *poll)
{ … }
static struct ctl_table root_table[] = …;
static struct ctl_table_root sysctl_table_root = …;
static DEFINE_SPINLOCK(sysctl_lock);
static void drop_sysctl_table(struct ctl_table_header *header);
static int sysctl_follow_link(struct ctl_table_header **phead,
struct ctl_table **pentry);
static int insert_links(struct ctl_table_header *head);
static void put_links(struct ctl_table_header *header);
static void sysctl_print_dir(struct ctl_dir *dir)
{ … }
static int namecmp(const char *name1, int len1, const char *name2, int len2)
{ … }
static struct ctl_table *find_entry(struct ctl_table_header **phead,
struct ctl_dir *dir, const char *name, int namelen)
{ … }
static int insert_entry(struct ctl_table_header *head, struct ctl_table *entry)
{ … }
static void erase_entry(struct ctl_table_header *head, struct ctl_table *entry)
{ … }
static void init_header(struct ctl_table_header *head,
struct ctl_table_root *root, struct ctl_table_set *set,
struct ctl_node *node, struct ctl_table *table, size_t table_size)
{ … }
static void erase_header(struct ctl_table_header *head)
{ … }
static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header)
{ … }
static int use_table(struct ctl_table_header *p)
{ … }
static void unuse_table(struct ctl_table_header *p)
{ … }
static void proc_sys_invalidate_dcache(struct ctl_table_header *head)
{ … }
static void start_unregistering(struct ctl_table_header *p)
{ … }
static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head)
{ … }
static void sysctl_head_finish(struct ctl_table_header *head)
{ … }
static struct ctl_table_set *
lookup_header_set(struct ctl_table_root *root)
{ … }
static struct ctl_table *lookup_entry(struct ctl_table_header **phead,
struct ctl_dir *dir,
const char *name, int namelen)
{ … }
static struct ctl_node *first_usable_entry(struct rb_node *node)
{ … }
static void first_entry(struct ctl_dir *dir,
struct ctl_table_header **phead, struct ctl_table **pentry)
{ … }
static void next_entry(struct ctl_table_header **phead, struct ctl_table **pentry)
{ … }
static int test_perm(int mode, int op)
{ … }
static int sysctl_perm(struct ctl_table_header *head, struct ctl_table *table, int op)
{ … }
static struct inode *proc_sys_make_inode(struct super_block *sb,
struct ctl_table_header *head, struct ctl_table *table)
{ … }
void proc_sys_evict_inode(struct inode *inode, struct ctl_table_header *head)
{ … }
static struct ctl_table_header *grab_header(struct inode *inode)
{ … }
static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
unsigned int flags)
{ … }
static ssize_t proc_sys_call_handler(struct kiocb *iocb, struct iov_iter *iter,
int write)
{ … }
static ssize_t proc_sys_read(struct kiocb *iocb, struct iov_iter *iter)
{ … }
static ssize_t proc_sys_write(struct kiocb *iocb, struct iov_iter *iter)
{ … }
static int proc_sys_open(struct inode *inode, struct file *filp)
{ … }
static __poll_t proc_sys_poll(struct file *filp, poll_table *wait)
{ … }
static bool proc_sys_fill_cache(struct file *file,
struct dir_context *ctx,
struct ctl_table_header *head,
struct ctl_table *table)
{ … }
static bool proc_sys_link_fill_cache(struct file *file,
struct dir_context *ctx,
struct ctl_table_header *head,
struct ctl_table *table)
{ … }
static int scan(struct ctl_table_header *head, struct ctl_table *table,
unsigned long *pos, struct file *file,
struct dir_context *ctx)
{ … }
static int proc_sys_readdir(struct file *file, struct dir_context *ctx)
{ … }
static int proc_sys_permission(struct mnt_idmap *idmap,
struct inode *inode, int mask)
{ … }
static int proc_sys_setattr(struct mnt_idmap *idmap,
struct dentry *dentry, struct iattr *attr)
{ … }
static int proc_sys_getattr(struct mnt_idmap *idmap,
const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int query_flags)
{ … }
static const struct file_operations proc_sys_file_operations = …;
static const struct file_operations proc_sys_dir_file_operations = …;
static const struct inode_operations proc_sys_inode_operations = …;
static const struct inode_operations proc_sys_dir_operations = …;
static int proc_sys_revalidate(struct dentry *dentry, unsigned int flags)
{ … }
static int proc_sys_delete(const struct dentry *dentry)
{ … }
static int sysctl_is_seen(struct ctl_table_header *p)
{ … }
static int proc_sys_compare(const struct dentry *dentry,
unsigned int len, const char *str, const struct qstr *name)
{ … }
static const struct dentry_operations proc_sys_dentry_operations = …;
static struct ctl_dir *find_subdir(struct ctl_dir *dir,
const char *name, int namelen)
{ … }
static struct ctl_dir *new_dir(struct ctl_table_set *set,
const char *name, int namelen)
{ … }
static struct ctl_dir *get_subdir(struct ctl_dir *dir,
const char *name, int namelen)
{ … }
static struct ctl_dir *xlate_dir(struct ctl_table_set *set, struct ctl_dir *dir)
{ … }
static int sysctl_follow_link(struct ctl_table_header **phead,
struct ctl_table **pentry)
{ … }
static int sysctl_err(const char *path, struct ctl_table *table, char *fmt, ...)
{ … }
static int sysctl_check_table_array(const char *path, struct ctl_table *table)
{ … }
static int sysctl_check_table(const char *path, struct ctl_table_header *header)
{ … }
static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_header *head)
{ … }
static bool get_links(struct ctl_dir *dir,
struct ctl_table_header *header,
struct ctl_table_root *link_root)
{ … }
static int insert_links(struct ctl_table_header *head)
{ … }
static struct ctl_dir *sysctl_mkdir_p(struct ctl_dir *dir, const char *path)
{ … }
struct ctl_table_header *__register_sysctl_table(
struct ctl_table_set *set,
const char *path, struct ctl_table *table, size_t table_size)
{ … }
struct ctl_table_header *register_sysctl_sz(const char *path, struct ctl_table *table,
size_t table_size)
{ … }
EXPORT_SYMBOL(…);
void __init __register_sysctl_init(const char *path, struct ctl_table *table,
const char *table_name, size_t table_size)
{ … }
static void put_links(struct ctl_table_header *header)
{ … }
static void drop_sysctl_table(struct ctl_table_header *header)
{ … }
void unregister_sysctl_table(struct ctl_table_header * header)
{ … }
EXPORT_SYMBOL(…);
void setup_sysctl_set(struct ctl_table_set *set,
struct ctl_table_root *root,
int (*is_seen)(struct ctl_table_set *))
{ … }
void retire_sysctl_set(struct ctl_table_set *set)
{ … }
int __init proc_sys_init(void)
{ … }
struct sysctl_alias { … };
static const struct sysctl_alias sysctl_aliases[] = …;
static const char *sysctl_find_alias(char *param)
{ … }
bool sysctl_is_alias(char *param)
{ … }
static int process_sysctl_arg(char *param, char *val,
const char *unused, void *arg)
{ … }
void do_sysctl_args(void)
{ … }