Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-24 Thread Fengwei Yin
On Fri, Apr 25, 2014 at 12:29 AM, Al Viro wrote: > On Thu, Apr 24, 2014 at 10:26:50PM +0800, Fengwei Yin wrote: >> On Thu, Apr 24, 2014 at 5:58 AM, Al Viro wrote: >> > On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: >> >> When dump /proc/xxx/maps, if d_path return error in seq_path,

Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-24 Thread Al Viro
On Thu, Apr 24, 2014 at 10:26:50PM +0800, Fengwei Yin wrote: > On Thu, Apr 24, 2014 at 5:58 AM, Al Viro wrote: > > On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: > >> When dump /proc/xxx/maps, if d_path return error in seq_path, the > >> buffer will be exhaust and trigger dead loop i

Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-24 Thread Fengwei Yin
On Thu, Apr 24, 2014 at 5:58 AM, Al Viro wrote: > On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: >> When dump /proc/xxx/maps, if d_path return error in seq_path, the >> buffer will be exhaust and trigger dead loop in seq_read. Till >> kmalloc fails with -ENOMEM. > > *WHAT* d_path err

Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-23 Thread Al Viro
On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: > When dump /proc/xxx/maps, if d_path return error in seq_path, the > buffer will be exhaust and trigger dead loop in seq_read. Till > kmalloc fails with -ENOMEM. *WHAT* d_path error? -ENAMETOOLONG, aka. "you've got too little space"?

[PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-21 Thread Fengwei Yin
When dump /proc/xxx/maps, if d_path return error in seq_path, the buffer will be exhaust and trigger dead loop in seq_read. Till kmalloc fails with -ENOMEM. Saving and restoring the m->count to avoid the dead loop in seq_read if d_path return error. Signed-off-by: Fengwei Yin --- fs/proc/task_m