Commit 0b54142e authored by Daniel Borkmann's avatar Daniel Borkmann
Browse files


Pull in Christoph Hellwig's series that changes the sysctl's ->proc_handler
methods to take kernel pointers instead. It gets rid of the set_fs address
space overrides used by BPF. As per discussion, pull in the feature branch
into bpf-next as it relates to BPF sysctl progs.

Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200427071508.GV23230@ZenIV.linux.org.uk/T/
parents 8c1b2bf1 32927393
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops)
}

static int emulation_proc_handler(struct ctl_table *table, int write,
				  void __user *buffer, size_t *lenp,
				  void *buffer, size_t *lenp,
				  loff_t *ppos)
{
	int ret = 0;
+1 −2
Original line number Diff line number Diff line
@@ -341,8 +341,7 @@ static unsigned int find_supported_vector_length(unsigned int vl)
#ifdef CONFIG_SYSCTL

static int sve_proc_do_default_vl(struct ctl_table *table, int write,
				  void __user *buffer, size_t *lenp,
				  loff_t *ppos)
				  void *buffer, size_t *lenp, loff_t *ppos)
{
	int ret;
	int vl = sve_default_vl;
+5 −8
Original line number Diff line number Diff line
@@ -95,16 +95,15 @@ int proc_lasat_ip(struct ctl_table *table, int write,
		len = 0;
		p = buffer;
		while (len < *lenp) {
			if (get_user(c, p++))
				return -EFAULT;
			c = *p;
			p++;
			if (c == 0 || c == '\n')
				break;
			len++;
		}
		if (len >= sizeof(ipbuf)-1)
			len = sizeof(ipbuf) - 1;
		if (copy_from_user(ipbuf, buffer, len))
			return -EFAULT;
		memcpy(ipbuf, buffer, len);
		ipbuf[len] = 0;
		*ppos += *lenp;
		/* Now see if we can convert it to a valid IP */
@@ -122,11 +121,9 @@ int proc_lasat_ip(struct ctl_table *table, int write,
		if (len > *lenp)
			len = *lenp;
		if (len)
			if (copy_to_user(buffer, ipbuf, len))
				return -EFAULT;
			memcpy(buffer, ipbuf, len);
		if (len < *lenp) {
			if (put_user('\n', ((char *) buffer) + len))
				return -EFAULT;
			*((char *)buffer + len) = '\n';
			len++;
		}
		*lenp = len;
+5 −6
Original line number Diff line number Diff line
@@ -51,10 +51,9 @@ static struct platform_device *appldata_pdev;
 */
static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
static int appldata_timer_handler(struct ctl_table *ctl, int write,
				  void __user *buffer, size_t *lenp, loff_t *ppos);
				  void *buffer, size_t *lenp, loff_t *ppos);
static int appldata_interval_handler(struct ctl_table *ctl, int write,
					 void __user *buffer,
					 size_t *lenp, loff_t *ppos);
				     void *buffer, size_t *lenp, loff_t *ppos);

static struct ctl_table_header *appldata_sysctl_header;
static struct ctl_table appldata_table[] = {
@@ -217,7 +216,7 @@ static void __appldata_vtimer_setup(int cmd)
 */
static int
appldata_timer_handler(struct ctl_table *ctl, int write,
			   void __user *buffer, size_t *lenp, loff_t *ppos)
			   void *buffer, size_t *lenp, loff_t *ppos)
{
	int timer_active = appldata_timer_active;
	int rc;
@@ -250,7 +249,7 @@ appldata_timer_handler(struct ctl_table *ctl, int write,
 */
static int
appldata_interval_handler(struct ctl_table *ctl, int write,
			   void __user *buffer, size_t *lenp, loff_t *ppos)
			   void *buffer, size_t *lenp, loff_t *ppos)
{
	int interval = appldata_interval;
	int rc;
@@ -280,7 +279,7 @@ appldata_interval_handler(struct ctl_table *ctl, int write,
 */
static int
appldata_generic_handler(struct ctl_table *ctl, int write,
			   void __user *buffer, size_t *lenp, loff_t *ppos)
			   void *buffer, size_t *lenp, loff_t *ppos)
{
	struct appldata_ops *ops = NULL, *tmp_ops;
	struct list_head *lh;
+1 −1
Original line number Diff line number Diff line
@@ -867,7 +867,7 @@ static int debug_active = 1;
 * if debug_active is already off
 */
static int s390dbf_procactive(struct ctl_table *table, int write,
			      void __user *buffer, size_t *lenp, loff_t *ppos)
			      void *buffer, size_t *lenp, loff_t *ppos)
{
	if (!write || debug_stoppable || !debug_active)
		return proc_dointvec(table, write, buffer, lenp, ppos);
Loading