Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bbfe059 authored by Alexey Dobriyan's avatar Alexey Dobriyan
Browse files

proc: remove kernel.maps_protect



After commit 831830b5 aka
"restrict reading from /proc/<pid>/maps to those who share ->mm or can ptrace"
sysctl stopped being relevant because commit moved security checks from ->show
time to ->start time (mm_for_maps()).

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Acked-by: default avatarKees Cook <kees.cook@canonical.com>
parent 45acb8db
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -1332,13 +1332,6 @@ determine whether or not they are still functioning properly.
Because the NMI watchdog shares registers with oprofile, by disabling the NMI
watchdog, oprofile may have more registers to utilize.

maps_protect
------------

Enables/Disables the protection of the per-process proc entries "maps" and
"smaps".  When enabled, the contents of these files are visible only to
readers that are allowed to ptrace() the given process.

msgmni
------

+0 −3
Original line number Diff line number Diff line
@@ -148,9 +148,6 @@ static unsigned int pid_entry_count_dirs(const struct pid_entry *entries,
	return count;
}

int maps_protect;
EXPORT_SYMBOL(maps_protect);

static struct fs_struct *get_fs_struct(struct task_struct *task)
{
	struct fs_struct *fs;
+0 −2
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@ do { \
extern int nommu_vma_show(struct seq_file *, struct vm_area_struct *);
#endif

extern int maps_protect;

extern int proc_tid_stat(struct seq_file *m, struct pid_namespace *ns,
				struct pid *pid, struct task_struct *task);
extern int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns,
+1 −15
Original line number Diff line number Diff line
@@ -210,9 +210,6 @@ static int show_map(struct seq_file *m, void *v)
	dev_t dev = 0;
	int len;

	if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
		return -EACCES;

	if (file) {
		struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
		dev = inode->i_sb->s_dev;
@@ -742,22 +739,11 @@ const struct file_operations proc_pagemap_operations = {
#ifdef CONFIG_NUMA
extern int show_numa_map(struct seq_file *m, void *v);

static int show_numa_map_checked(struct seq_file *m, void *v)
{
	struct proc_maps_private *priv = m->private;
	struct task_struct *task = priv->task;

	if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
		return -EACCES;

	return show_numa_map(m, v);
}

static const struct seq_operations proc_pid_numa_maps_op = {
        .start  = m_start,
        .next   = m_next,
        .stop   = m_stop,
        .show   = show_numa_map_checked
        .show   = show_numa_map,
};

static int numa_maps_open(struct inode *inode, struct file *file)
+0 −5
Original line number Diff line number Diff line
@@ -110,11 +110,6 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
static int show_map(struct seq_file *m, void *_vml)
{
	struct vm_list_struct *vml = _vml;
	struct proc_maps_private *priv = m->private;
	struct task_struct *task = priv->task;

	if (maps_protect && !ptrace_may_access(task, PTRACE_MODE_READ))
		return -EACCES;

	return nommu_vma_show(m, vml->vma);
}
Loading