Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997AbdHOSvL (ORCPT ); Tue, 15 Aug 2017 14:51:11 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:38266 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752381AbdHOSvJ (ORCPT ); Tue, 15 Aug 2017 14:51:09 -0400 Subject: Re: [PATCH] loop: fix to a race condition due to the early registration of device To: Anton Volkov , tom.leiming@gmail.com Cc: 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> From: Jens Axboe Message-ID: <1426f1f4-4193-e107-4191-251888bc0952@kernel.dk> Date: Tue, 15 Aug 2017 12:51:05 -0600 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: <1502109470-2945-1-git-send-email-avolkov@ispras.ru> Content-Type: text/plain; charset=utf-8 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: 372 Lines: 13 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 Verification project (linuxtesting.org). Added for 4.14, thanks. -- Jens Axboe