linux/drivers/connector/cn_proc.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * cn_proc.c - process events connector
 *
 * Copyright (C) Matt Helsley, IBM Corp. 2005
 * Based on cn_fork.c by Guillaume Thouvenin <[email protected]>
 * Original copyright notice follows:
 * Copyright (C) 2005 BULL SA.
 */

#include <linux/kernel.h>
#include <linux/ktime.h>
#include <linux/init.h>
#include <linux/connector.h>
#include <linux/gfp.h>
#include <linux/ptrace.h>
#include <linux/atomic.h>
#include <linux/pid_namespace.h>

#include <linux/cn_proc.h>
#include <linux/local_lock.h>

/*
 * Size of a cn_msg followed by a proc_event structure.  Since the
 * sizeof struct cn_msg is a multiple of 4 bytes, but not 8 bytes, we
 * add one 4-byte word to the size here, and then start the actual
 * cn_msg structure 4 bytes into the stack buffer.  The result is that
 * the immediately following proc_event structure is aligned to 8 bytes.
 */
#define CN_PROC_MSG_SIZE

/* See comment above; we test our assumption about sizeof struct cn_msg here. */
static inline struct cn_msg *buffer_to_cn_msg(__u8 *buffer)
{}

static atomic_t proc_event_num_listeners =;
static struct cb_id cn_proc_event_id =;

/* local_event.count is used as the sequence number of the netlink message */
struct local_event {};
static DEFINE_PER_CPU(struct local_event, local_event) =;

static int cn_filter(struct sock *dsk, struct sk_buff *skb, void *data)
{}

static inline void send_msg(struct cn_msg *msg)
{}

void proc_fork_connector(struct task_struct *task)
{}

void proc_exec_connector(struct task_struct *task)
{}

void proc_id_connector(struct task_struct *task, int which_id)
{}

void proc_sid_connector(struct task_struct *task)
{}

void proc_ptrace_connector(struct task_struct *task, int ptrace_id)
{}

void proc_comm_connector(struct task_struct *task)
{}

void proc_coredump_connector(struct task_struct *task)
{}

void proc_exit_connector(struct task_struct *task)
{}

/*
 * Send an acknowledgement message to userspace
 *
 * Use 0 for success, EFOO otherwise.
 * Note: this is the negative of conventional kernel error
 * values because it's not being returned via syscall return
 * mechanisms.
 */
static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
{}

/**
 * cn_proc_mcast_ctl
 * @msg: message sent from userspace via the connector
 * @nsp: NETLINK_CB of the client's socket buffer
 */
static void cn_proc_mcast_ctl(struct cn_msg *msg,
			      struct netlink_skb_parms *nsp)
{}

/*
 * cn_proc_init - initialization entry point
 *
 * Adds the connector callback to the connector driver.
 */
static int __init cn_proc_init(void)
{}
device_initcall(cn_proc_init);