Commit ef2d73dc authored by Seth Forshee's avatar Seth Forshee Committed by Khalid Elmously

Revert "Restrict /dev/mem and /dev/kmem when module loading is restricted"

BugLink: https://bugs.launchpad.net/bugs/1884159

This reverts commit 517d6c3a to
backport an updated version.
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarAndrea Righi <andrea.righi@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent e1caf27b
...@@ -188,9 +188,6 @@ static ssize_t write_mem(struct file *file, const char __user *buf, ...@@ -188,9 +188,6 @@ static ssize_t write_mem(struct file *file, const char __user *buf,
if (p != *ppos) if (p != *ppos)
return -EFBIG; return -EFBIG;
if (secure_modules())
return -EPERM;
if (!valid_phys_addr_range(p, count)) if (!valid_phys_addr_range(p, count))
return -EFAULT; return -EFAULT;
...@@ -558,9 +555,6 @@ static ssize_t write_kmem(struct file *file, const char __user *buf, ...@@ -558,9 +555,6 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */ char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */
int err = 0; int err = 0;
if (secure_modules())
return -EPERM;
if (p < (unsigned long) high_memory) { if (p < (unsigned long) high_memory) {
unsigned long to_write = min_t(unsigned long, count, unsigned long to_write = min_t(unsigned long, count,
(unsigned long)high_memory - p); (unsigned long)high_memory - p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment