Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753190AbdHJPqt (ORCPT ); Thu, 10 Aug 2017 11:46:49 -0400 Received: from mail.ispras.ru ([83.149.199.45]:43962 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752737AbdHJPqs (ORCPT ); Thu, 10 Aug 2017 11:46:48 -0400 Subject: Re: [PATCH] loop: fix to a race condition due to the early registration of device To: Omar Sandoval Cc: tom.leiming@gmail.com, axboe@fb.com, osandov@fb.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, ldv-project@linuxtesting.org, khoroshilov@ispras.ru References: <1502109470-2945-1-git-send-email-avolkov@ispras.ru> <20170808220047.GA4072@vader.DHCP.thefacebook.com> From: Anton Volkov Message-ID: Date: Thu, 10 Aug 2017 18:46:46 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170808220047.GA4072@vader.DHCP.thefacebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 956 Lines: 36 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 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 Volkov >> Reviewed-by: Ming Lei > > Hi, Anton, > > Were you able to reproduce this issue or was it purely theoretical? If > the former, it'd be nice if you could add a test case to blktests [1]. > > 1: https://github.com/osandov/blktests > > Thanks! > Omar > -- Anton Volkov Linux Verification Center, ISPRAS web: http://linuxtesting.org e-mail: avolkov@ispras.ru