Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-15 Thread Jens Axboe
On 08/07/2017 06:37 AM, Anton Volkov wrote: > The early device registration made possible a race leading to allocations > of disks with wrong minors. > > This patch moves the device registration further down the loop_init > function to make the race infeasible. > > Found by Linux Driver

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-15 Thread Jens Axboe
On 08/07/2017 06:37 AM, Anton Volkov wrote: > The early device registration made possible a race leading to allocations > of disks with wrong minors. > > This patch moves the device registration further down the loop_init > function to make the race infeasible. > > Found by Linux Driver

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-10 Thread Anton Volkov
Hello, Omar. It was a purely theoretical race that had been considered to be possible in real-life. Regards, Anton On 09.08.2017 01:00, Omar Sandoval wrote: On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: The early device registration made possible a race leading to

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-10 Thread Anton Volkov
Hello, Omar. It was a purely theoretical race that had been considered to be possible in real-life. Regards, Anton On 09.08.2017 01:00, Omar Sandoval wrote: On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: The early device registration made possible a race leading to

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-08 Thread Omar Sandoval
On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: > The early device registration made possible a race leading to allocations > of disks with wrong minors. > > This patch moves the device registration further down the loop_init > function to make the race infeasible. > > Found by

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-08 Thread Omar Sandoval
On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: > The early device registration made possible a race leading to allocations > of disks with wrong minors. > > This patch moves the device registration further down the loop_init > function to make the race infeasible. > > Found by

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Johannes Thumshirn
On Mon, Aug 07, 2017 at 04:09:12PM +0300, Anton Volkov wrote: > This is more of a style-oriented suggestion. This kind of template is > commonly used in other modules. Yes but there is no point in using gotos here (i.e. cleanup to be done), you an just return directly. And yes it is a minor nit.

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Johannes Thumshirn
On Mon, Aug 07, 2017 at 04:09:12PM +0300, Anton Volkov wrote: > This is more of a style-oriented suggestion. This kind of template is > commonly used in other modules. Yes but there is no point in using gotos here (i.e. cleanup to be done), you an just return directly. And yes it is a minor nit.

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Anton Volkov
This is more of a style-oriented suggestion. This kind of template is commonly used in other modules. Regards, Anton On 07.08.2017 15:54, Johannes Thumshirn wrote: On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: +err_out: return err; Any reason you can't just use

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Anton Volkov
This is more of a style-oriented suggestion. This kind of template is commonly used in other modules. Regards, Anton On 07.08.2017 15:54, Johannes Thumshirn wrote: On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: +err_out: return err; Any reason you can't just use

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Johannes Thumshirn
On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: > +err_out: > return err; Any reason you can't just use return err; at the respective callsites? Thanks, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Johannes Thumshirn
On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: > +err_out: > return err; Any reason you can't just use return err; at the respective callsites? Thanks, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de

[PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Anton Volkov
The early device registration made possible a race leading to allocations of disks with wrong minors. This patch moves the device registration further down the loop_init function to make the race infeasible. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton

[PATCH] loop: fix to a race condition due to the early registration of device

2017-08-07 Thread Anton Volkov
The early device registration made possible a race leading to allocations of disks with wrong minors. This patch moves the device registration further down the loop_init function to make the race infeasible. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-06 Thread Ming Lei
On Thu, Aug 3, 2017 at 11:01 PM, Anton Volkov wrote: > The early device registration made possible a race leading to allocations > of disks with wrong minors. > > This patch moves the device registration further down the loop_init > function to make the race infeasible. > >

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-06 Thread Ming Lei
On Thu, Aug 3, 2017 at 11:01 PM, Anton Volkov wrote: > The early device registration made possible a race leading to allocations > of disks with wrong minors. > > This patch moves the device registration further down the loop_init > function to make the race infeasible. > > Found by Linux Driver

[PATCH] loop: fix to a race condition due to the early registration of device

2017-08-03 Thread Anton Volkov
The early device registration made possible a race leading to allocations of disks with wrong minors. This patch moves the device registration further down the loop_init function to make the race infeasible. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton

[PATCH] loop: fix to a race condition due to the early registration of device

2017-08-03 Thread Anton Volkov
The early device registration made possible a race leading to allocations of disks with wrong minors. This patch moves the device registration further down the loop_init function to make the race infeasible. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton