Messages in this thread | | | From | Andy Shevchenko <> | Date | Wed, 21 Feb 2018 21:28:41 +0200 | Subject | Re: [PATCH 1/5] proc: make /proc/*/cmdline go through LSM |
| |
On Wed, Feb 21, 2018 at 9:23 PM, Alexey Dobriyan <adobriyan@gmail.com> wrote: > /proc/*/cmdline is not different from /proc/*/environ as it accesses > target task's memory (and can access the very same region of memory) > but it doesn't go through ptrace_may_access() and thus doesn't go through LSM.
> +static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) > +{ > + struct mm_struct *mm = proc_mem_open(inode, mode); > + > + if (IS_ERR(mm)) > + return PTR_ERR(mm);
So, is it possible to have it NULL?..
> + > + file->private_data = mm; > + return 0; > +}
> +static int mem_release(struct inode *inode, struct file *file) > +{ > + struct mm_struct *mm = file->private_data;
> + if (mm)
...or I don't get this check.
> + mmdrop(mm); > + return 0; > +}
-- With Best Regards, Andy Shevchenko
| |