Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbdHHWAv (ORCPT ); Tue, 8 Aug 2017 18:00:51 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:37231 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751961AbdHHWAt (ORCPT ); Tue, 8 Aug 2017 18:00:49 -0400 Date: Tue, 8 Aug 2017 15:00:47 -0700 From: Omar Sandoval To: Anton Volkov 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 Subject: Re: [PATCH] loop: fix to a race condition due to the early registration of device Message-ID: <20170808220047.GA4072@vader.DHCP.thefacebook.com> References: <1502109470-2945-1-git-send-email-avolkov@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502109470-2945-1-git-send-email-avolkov@ispras.ru> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 657 Lines: 21 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