Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp263122lqt; Thu, 6 Jun 2024 02:54:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXivAIoPyzzgj+bt7jQ+FRDslSVzl/mQRZPcFg2ty8WFtjW0j9DFLnHq9cwenbytA4CmQs5InwVzgc0NG2vjaeZCogP/nVmgoGQeOmpug== X-Google-Smtp-Source: AGHT+IFwwKqRaKk5ADagRvQS52jdyT6NyG53EqYuwqIWXreOLW5jFCac6UotkonuW9Qbp9J3rCnJ X-Received: by 2002:ae9:e30c:0:b0:794:f364:d92 with SMTP id af79cd13be357-79523c239b1mr573865785a.7.1717667649762; Thu, 06 Jun 2024 02:54:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717667649; cv=pass; d=google.com; s=arc-20160816; b=j/aYPGpTLTnmBWyRJhMtGk9wNlI9KSnu2OsHjWxGWBlu8yF8ofFNv/+dfiYbqbVebA dsL5eUkrcAPYiOc8hidBst94oDq8glmTFeWUdpLS93iiU0M8mQRwrs8jL3h3XPjtrOw1 0B8z5gJxFq0hjnIx9Wk8/jvFVzZdJqzAKTrme4Yp/NJ12zF9a6ahl6eU+k7ZpafDTILd SPDwLHPDkqgHEJ3AKC5+eKPo1eBQBg+SiJtcynmEEEVl9hq4foxWv5zyD/XuUbjh9AAE 9QxMxwcvb0nGf6erF0lLL4EbU5zS0zL46JvgWHsxc5YwdmJyn4TRIk8ohQwLYY0jzmf3 JphQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8rpvCY5bzwtgFrw8HO1MFPpTrsqw6qdsV1vTK4nMLwI=; fh=fGW9MwlD0XJrQgSYiKV+6b8P5Baj7R8IKy/eJs77hKg=; b=vVH6zLYqfCN7yjrDHkRfb6fiGNlV5eBNPHErYDf0T6Jwf19+FDazgF9luLV9SegRVz YGbnEnGG4DgtibsSVrsiKp317zqhWzzAeONNPDaP+hH/ddXBaCsjqX+C5cs74Rr8NFgr 2L2oT6WO/Ep7h1SHOlQe2aU4Fn3l0hPosrcSwo7ok2LFtJ6FvfEKnLUKq4fsGzKuD2WK 2A/+3nxPOmy4PTh6K0FWi6xIy68WdY8MpmpVieR9lqGNil9mMlnYKj5xpTvyCAcY9HcD en1QrILFXXDCKhKm5SJ9AJ/9Mk5ktZ2VDEWvxyO5qrCLCAlSEAEt9uqNCD1x6mbZZT46 0XSg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VOn+B8HT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-204061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7953339d9fdsi99009885a.741.2024.06.06.02.54.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VOn+B8HT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-204061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A65001C25A0E for ; Thu, 6 Jun 2024 09:53:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CC9217FAAD; Thu, 6 Jun 2024 09:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VOn+B8HT" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7823F17F362 for ; Thu, 6 Jun 2024 09:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717667549; cv=none; b=Xdcz5EYAYzUZqx2eanKydOCJkUy6NFe4R+BGsBWPW4gVnwesg43X+ROczxGFIEfeiYTYzVjMU7o0stFOP4fm0gwF6eH6Tx07MBu0XNMKImc7i6z33aX5qUwVkp+jZLCyGzUKLX4SLy+KedtzGZehMSeD3NZ/OWVH/w8CQq5fhrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717667549; c=relaxed/simple; bh=X7cVxbBveQqrOZ2WwFezmFwF45VgSY2MzHX0JhuP+Uc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gLc4Iml6j0RctGXwblQL/AIUE64MjzRAINddkY7ImqVcsdOw/vMdW1zGGH2yBuwEmF3OXBe+L0omFR06L6+BvSFu4ErXmO2I+tRu4OkrfcbC7fbRLaL+x2WKpn4uHAYnG98k4GuMjAL0685SXknpODfxmkaILsSJ1gRyzHrKYqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VOn+B8HT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717667546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8rpvCY5bzwtgFrw8HO1MFPpTrsqw6qdsV1vTK4nMLwI=; b=VOn+B8HT4qYh8o0koqMmyCQnOWPO/59F8cL/9fSOFiCL6pXEtiZ5evV6/RcuiPxtx+Ho7C 6aJWGnpAtqdrCCV2fjtgZdIVz9NXUDL1UweAvuTtSgx3n+hd2auycW8NimEcGpzW31K8r9 h0oyf3E2hiS3KgY8lMo2551j/acouKM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-mIggGKAlO3S6ge_9wYrxmw-1; Thu, 06 Jun 2024 05:52:23 -0400 X-MC-Unique: mIggGKAlO3S6ge_9wYrxmw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E97C185A78E; Thu, 6 Jun 2024 09:52:22 +0000 (UTC) Received: from fedora (unknown [10.72.113.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A116492BF1; Thu, 6 Jun 2024 09:52:16 +0000 (UTC) Date: Thu, 6 Jun 2024 17:52:12 +0800 From: Ming Lei To: Li Nan Cc: Changhui Zhong , axboe@kernel.dk, ZiyangZhang@linux.alibaba.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH] ublk_drv: fix NULL pointer dereference in ublk_ctrl_start_recovery() Message-ID: References: <20240529095313.2568595-1-linan666@huaweicloud.com> <225f4c8e-0e2c-8f4b-f87d-69f4677af572@huaweicloud.com> <918f128b-f752-2d66-ca60-7d9c711ed928@huaweicloud.com> <2c46587e-0621-b21e-fbc1-fd69e87def03@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2c46587e-0621-b21e-fbc1-fd69e87def03@huaweicloud.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 On Thu, Jun 06, 2024 at 04:05:33PM +0800, Li Nan wrote: > > > 在 2024/6/6 12:48, Changhui Zhong 写道: > > [...] > > > > > > > Hi Changhui, > > > > > > The hang is actually expected because recovery fails. > > > > > > Please pull the latest ublksrv and check if the issue can still be > > > reproduced: > > > > > > https://github.com/ublk-org/ublksrv > > > > > > BTW, one ublksrv segfault and two test cleanup issues are fixed. > > > > > > Thanks, > > > Ming > > > > > > > Hi,Ming and Nan > > > > after applying the new patch and pulling the latest ublksrv, > > I ran the test for 4 hours and did not observe any task hang. > > the test results looks good! > > > > Thanks, > > Changhui > > > > > > . > > Thanks for you test! > > However, I got a NULL pointer dereference bug with ublksrv. It is not BTW, your patch isn't related with generic/004 which won't touch recovery code path. > introduced by this patch. It seems io was issued after deleting disk. And > it can be reproduced by: > > while true; do make test T=generic/004; done We didn't see that when running such test with linus tree, and usually Changhui run generic test for hours. > > [ 1524.286485] running generic/004 > [ 1529.110875] blk_print_req_error: 109 callbacks suppressed ... > [ 1541.171010] BUG: kernel NULL pointer dereference, address: 0000000000000000 > [ 1541.171734] #PF: supervisor write access in kernel mode > [ 1541.172271] #PF: error_code(0x0002) - not-present page > [ 1541.172798] PGD 0 P4D 0 > [ 1541.173065] Oops: Oops: 0002 [#1] PREEMPT SMP > [ 1541.173515] CPU: 0 PID: 43707 Comm: ublk Not tainted > 6.9.0-next-20240523-00004-g9bc7e95c7323 #454 > [ 1541.174417] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS > 1.16.1-2.fc37 04/01/2014 > [ 1541.175311] RIP: 0010:io_fallback_tw+0x252/0x300 This one looks one io_uring issue. Care to provide which line of source code points to by 'io_fallback_tw+0x252'? gdb> l *(io_fallback_tw+0x252) Thanks, Ming