Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-14 Thread Dmitry Vyukov
On Wed, May 9, 2018 at 4:02 PM, Theodore Y. Ts'o wrote: > On Wed, May 09, 2018 at 10:49:54AM +0200, Dmitry Vyukov wrote: >> Hi Ted, >> >> Did you follow all instructions (commit, config, compiler, etc)? >> syzbot does not have any special magic, it just executes the described >>

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-09 Thread Theodore Y. Ts'o
On Wed, May 09, 2018 at 10:49:54AM +0200, Dmitry Vyukov wrote: > Hi Ted, > > Did you follow all instructions (commit, config, compiler, etc)? > syzbot does not have any special magic, it just executes the described > steps and then collects the kernel crash output it sees. No, I didn't.

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-09 Thread Dmitry Vyukov
On Tue, May 8, 2018 at 5:56 AM, Theodore Y. Ts'o wrote: > On Tue, May 08, 2018 at 09:28:17AM +0900, Tetsuo Handa wrote: >> The thread I mean is: >> >> general protection fault in lo_ioctl (2) >> >> https://syzkaller.appspot.com/bug?id=f3cfe26e785d85f9ee259f385515291d21bd80a3

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-07 Thread Theodore Y. Ts'o
On Tue, May 08, 2018 at 09:28:17AM +0900, Tetsuo Handa wrote: > The thread I mean is: > > general protection fault in lo_ioctl (2) > > https://syzkaller.appspot.com/bug?id=f3cfe26e785d85f9ee259f385515291d21bd80a3 > > Are you sure that your patch solves this problem as well? Well, I can't

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-07 Thread Theodore Y. Ts'o
On Tue, May 08, 2018 at 05:45:21AM +0900, Tetsuo Handa wrote: > > > > > By the way, are you aware that current "/* Avoid recursion */" loop is > > > not thread safe? > > > > Actually, it is safe. While the child loop device has an open file on > > the parent, lo_refcnt is elevated, which

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-07 Thread Tetsuo Handa
Theodore Y. Ts'o wrote: > On Mon, May 07, 2018 at 10:21:04PM +0900, Tetsuo Handa wrote: > > > I don't understand your concern; where are we going to out_putf when > > > error == 0? > > Ah, now I see it, thanks. I'll send a revised patch. > > > By the way, are you aware that current "/* Avoid

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-07 Thread Theodore Y. Ts'o
On Mon, May 07, 2018 at 10:21:04PM +0900, Tetsuo Handa wrote: > > I don't understand your concern; where are we going to out_putf when > > error == 0? Ah, now I see it, thanks. I'll send a revised patch. > By the way, are you aware that current "/* Avoid recursion */" loop is not > thread

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-07 Thread Tetsuo Handa
Theodore Y. Ts'o wrote: > On Mon, May 07, 2018 at 08:16:58PM +0900, Tetsuo Handa wrote: > > Oh, your message did not arrive at news.gmane.org and I didn't notice that > > you > > already wrote this patch. But please update yours or review mine shown > > below. > > > > > @@ -673,14 +703,13 @@

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-07 Thread Theodore Y. Ts'o
On Mon, May 07, 2018 at 08:16:58PM +0900, Tetsuo Handa wrote: > Oh, your message did not arrive at news.gmane.org and I didn't notice that you > already wrote this patch. But please update yours or review mine shown below. > > > @@ -673,14 +703,13 @@ static int loop_change_fd(struct loop_device

Re: [PATCH] loop: add recursion validation to LOOP_CHANGE_FD

2018-05-07 Thread Tetsuo Handa
Oh, your message did not arrive at news.gmane.org and I didn't notice that you already wrote this patch. But please update yours or review mine shown below. > @@ -673,14 +703,13 @@ static int loop_change_fd(struct loop_device *lo, > struct block_device *bdev, > if (!file) >