Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp395364pxt; Thu, 12 Aug 2021 00:37:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7tFFIOu+o2k66TFi0bCl99iSXSfHn5UGM1ZXUSKHlNlE3T8a44b1i46CZIAFdtuhtBeFl X-Received: by 2002:a05:6402:31bc:: with SMTP id dj28mr3812121edb.143.1628753829312; Thu, 12 Aug 2021 00:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628753829; cv=none; d=google.com; s=arc-20160816; b=lxx6AtwD/9tgCBb1x4grDYlXkx+deXpI7ZxPAAwUYbN/2U73wcj9aoZyp/x2+JTadk KywF2BO88rv072Et6p//O3kmDKoAl1SdkYLl8vDjH1Q7LtHY0ePBYxa+E2jqVwNkMZ83 iRP5Pbh0UGmZlWFUcNRj2HJgloR7ETgdRaSmrPR1p0Bo8xN4sFYcqKRy5u/pudw6SJAH u86J9E1qISGhUHZ82LEgfwV/R/TBNV/WHUNxQtWmytisY3fGqj9D/dlstZ0zWj2ufR/6 inJAcL3oH4gCSx4Ot2maO8DCEtg0RaUSN8rdWQXsM+KobqnEGTHSdm+KCp/knRMcymcI W2xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=zhDQmFnTWLYtzsRpiKu2OMk44q3mdjnN4bw/yYkHEpo=; b=iRnn3j9GA57J4hcKMGs70d9hGOdNW+es/w3DWjQxAw+j5m+f9jLowIcZiUK5Z9tqz0 XZiIbTSGs7OKtsp2z2DTgzEOCFYqf6m6GUwjYjRyXM06uTOViRSciKbp0Mtd76kQISIO ZjJ25fLog/Ka9y5aRfR6d9Neh51//LGd7289dgnx5RB/wBQplxRXRRJA6scUi+uVefYG imag0xICXuQG98yivQfeM1Nt8sVCjtKb1dLhlpq4/sMguy+8XQKGqGXtX6sNKaLdtiAj k4ZyZmUHWtXU+xrvwnYtnLNZp/IGW1C8IGs3d0MHQZ7U9MG2raojsL/MqjS/VWg0m9RW VtVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb13si1911156edb.107.2021.08.12.00.36.32; Thu, 12 Aug 2021 00:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234099AbhHLGTP (ORCPT + 99 others); Thu, 12 Aug 2021 02:19:15 -0400 Received: from verein.lst.de ([213.95.11.211]:43000 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233076AbhHLGTH (ORCPT ); Thu, 12 Aug 2021 02:19:07 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B6B1368AFE; Thu, 12 Aug 2021 08:18:39 +0200 (CEST) Date: Thu, 12 Aug 2021 08:18:39 +0200 From: Christoph Hellwig To: Pavel Skripkin Cc: Christoph Hellwig , Hillf Danton , syzbot , linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Eric Sandeen , Al Viro , Luis Chamberlain , Greg Kroah-Hartman Subject: Re: [syzbot] WARNING in internal_create_group Message-ID: <20210812061839.GA26497@lst.de> References: <000000000000bd7c8a05c719ecf2@google.com> <20210721033703.949-1-hdanton@sina.com> <20210721043034.GB7444@lst.de> <39ac87a8-42ac-acf7-11eb-ba0b6a9f4a95@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <39ac87a8-42ac-acf7-11eb-ba0b6a9f4a95@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 12, 2021 at 12:37:08AM +0300, Pavel Skripkin wrote: > --- a/drivers/block/nbd.c > +++ b/drivers/block/nbd.c > @@ -1725,7 +1725,17 @@ static int nbd_dev_add(int index) > refcount_set(&nbd->refs, 1); > INIT_LIST_HEAD(&nbd->list); > disk->major = NBD_MAJOR; > + > + /* Too big first_minor can cause duplicate creation of > + * sysfs files/links, since first_minor will be truncated to > + * byte in __device_add_disk(). > + */ > disk->first_minor = index << part_shift; > + if (disk->first_minor > 0xff) { > + err = -EINVAL; > + goto out_free_idr; > + } > + > disk->minors = 1 << part_shift; > disk->fops = &nbd_fops; > disk->private_data = nbd; > > > What to do you think about it? This sounds reasonable and looks good to me.