Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-24 Thread Tetsuo Handa
Davidlohr Bueso wrote: > On Fri, 2015-02-20 at 07:11 +0900, Tetsuo Handa wrote: > > Davidlohr Bueso wrote: > > > On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: > > > > Why do we need to let the caller call path_put() ? > > > > There is no need to do like proc_exe_link() does, for > > > >

Re: [PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-24 Thread Tetsuo Handa
Davidlohr Bueso wrote: On Fri, 2015-02-20 at 07:11 +0900, Tetsuo Handa wrote: Davidlohr Bueso wrote: On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: Why do we need to let the caller call path_put() ? There is no need to do like proc_exe_link() does, for tomoyo_get_exe()

Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-23 Thread Davidlohr Bueso
On Fri, 2015-02-20 at 08:28 -0800, Davidlohr Bueso wrote: > 8< > Subject: [PATCH v2 3/3] tomoyo: reduce mmap_sem hold for mm->exe_file Tetsuo, could you please ack/nack this? -- To unsubscribe from this list: send the line

Re: [PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-23 Thread Davidlohr Bueso
On Fri, 2015-02-20 at 08:28 -0800, Davidlohr Bueso wrote: 8 Subject: [PATCH v2 3/3] tomoyo: reduce mmap_sem hold for mm-exe_file Tetsuo, could you please ack/nack this? -- To unsubscribe from this list: send the line

Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-20 Thread Davidlohr Bueso
On Fri, 2015-02-20 at 07:11 +0900, Tetsuo Handa wrote: > Davidlohr Bueso wrote: > > On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: > > > Why do we need to let the caller call path_put() ? > > > There is no need to do like proc_exe_link() does, for > > > tomoyo_get_exe() returns pathname as

Re: [PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-20 Thread Davidlohr Bueso
On Fri, 2015-02-20 at 07:11 +0900, Tetsuo Handa wrote: Davidlohr Bueso wrote: On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: Why do we need to let the caller call path_put() ? There is no need to do like proc_exe_link() does, for tomoyo_get_exe() returns pathname as char *.

Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-19 Thread Tetsuo Handa
Davidlohr Bueso wrote: > On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: > > Why do we need to let the caller call path_put() ? > > There is no need to do like proc_exe_link() does, for > > tomoyo_get_exe() returns pathname as "char *". > > Having the pathname doesn't guarantee anything

Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-19 Thread Davidlohr Bueso
On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: > Why do we need to let the caller call path_put() ? > There is no need to do like proc_exe_link() does, for > tomoyo_get_exe() returns pathname as "char *". Having the pathname doesn't guarantee anything later, and thus doesn't seem very

Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-19 Thread Tetsuo Handa
Thank you, but I think this patch is wrong and redundant. Davidlohr Bueso wrote: > On Wed, 2015-02-18 at 16:10 -0800, Davidlohr Bueso wrote: > > +static const char *tomoyo_get_exe(struct mm_struct *mm) > > +{ > > + struct file *exe_file; > > + const char *cp = NULL; > > + > > + if (!mm) > >

Re: [PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-19 Thread Tetsuo Handa
Thank you, but I think this patch is wrong and redundant. Davidlohr Bueso wrote: On Wed, 2015-02-18 at 16:10 -0800, Davidlohr Bueso wrote: +static const char *tomoyo_get_exe(struct mm_struct *mm) +{ + struct file *exe_file; + const char *cp = NULL; + + if (!mm) +

Re: [PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-19 Thread Davidlohr Bueso
On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: Why do we need to let the caller call path_put() ? There is no need to do like proc_exe_link() does, for tomoyo_get_exe() returns pathname as char *. Having the pathname doesn't guarantee anything later, and thus doesn't seem very robust

Re: [PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-19 Thread Tetsuo Handa
Davidlohr Bueso wrote: On Thu, 2015-02-19 at 20:07 +0900, Tetsuo Handa wrote: Why do we need to let the caller call path_put() ? There is no need to do like proc_exe_link() does, for tomoyo_get_exe() returns pathname as char *. Having the pathname doesn't guarantee anything later, and

Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-18 Thread Davidlohr Bueso
On Wed, 2015-02-18 at 16:10 -0800, Davidlohr Bueso wrote: > +static const char *tomoyo_get_exe(struct mm_struct *mm) > +{ > + struct file *exe_file; > + const char *cp = NULL; > + > + if (!mm) > + return NULL; > + exe_file = get_mm_exe_file(mm); > + if (!exe_file) >

[PATCH 3/3] tomoyo: robustify handling of mm->exe_file

2015-02-18 Thread Davidlohr Bueso
From: Davidlohr Bueso The mm->exe_file is currently serialized with mmap_sem (shared) in order to both safely (1) read the file and (2) compute the realpath by calling tomoyo_realpath_from_path, making it an absolute overkill. Good users will, on the other hand, make use of the more standard

Re: [PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-18 Thread Davidlohr Bueso
On Wed, 2015-02-18 at 16:10 -0800, Davidlohr Bueso wrote: +static const char *tomoyo_get_exe(struct mm_struct *mm) +{ + struct file *exe_file; + const char *cp = NULL; + + if (!mm) + return NULL; + exe_file = get_mm_exe_file(mm); + if (!exe_file) +

[PATCH 3/3] tomoyo: robustify handling of mm-exe_file

2015-02-18 Thread Davidlohr Bueso
From: Davidlohr Bueso d...@stgolabs.net The mm-exe_file is currently serialized with mmap_sem (shared) in order to both safely (1) read the file and (2) compute the realpath by calling tomoyo_realpath_from_path, making it an absolute overkill. Good users will, on the other hand, make use of the