From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from va-1-19.ptr.blmpb.com (va-1-19.ptr.blmpb.com [209.127.230.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 359C22DEA7B for ; Wed, 20 Aug 2025 09:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755681758; cv=none; b=G19X1K2rwVdA6Pgw3UP25Ri+po6gWqrk2QJxQsq0r9EkqeYp9RP+ALLMWmNdKQikJdoPMMjxIt+v8WTBwYuOTjI7cL8+IcDRG0Ljp/zka36fQQFrwbbgwdlMvU7H4VGnMKsJ6lsZQZtLjqPoaU3M5kNDugj0fJX3J0l0wY9GeVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755681758; c=relaxed/simple; bh=BgVYMUDchAWudzWUKpedFO6xiS7BV3++GzlHR+tYfHc=; h=References:Content-Type:Date:Mime-Version:To:Cc:In-Reply-To: Message-Id:From:Subject; b=OBZKqGyW39907WVPu64s8fb+D+ByTtwSr+AceuXlhdOKm/q6xqy7Qqn3k3pBNTPE1rekoUBKBW3IfiBM5JYWjrJoxbnaqAGtq/lbFanzz7cqOs8aAr4yru+FDU3MT1aEWfa/gtIQs7BsyytK/TYvcp+jQRcEwsYaGgnm8CJpZas= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lanxincomputing.com; spf=pass smtp.mailfrom=lanxincomputing.com; dkim=pass (2048-bit key) header.d=lanxincomputing-com.20200927.dkim.feishu.cn header.i=@lanxincomputing-com.20200927.dkim.feishu.cn header.b=z3mXtNiU; arc=none smtp.client-ip=209.127.230.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lanxincomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lanxincomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lanxincomputing-com.20200927.dkim.feishu.cn header.i=@lanxincomputing-com.20200927.dkim.feishu.cn header.b="z3mXtNiU" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=lanxincomputing-com.20200927.dkim.feishu.cn; t=1755681700; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=26u28Ud/7i5hcKzRJDyQdYOfPIqHtE24mfxQ8LptvT8=; b=z3mXtNiUkxhHMDXpKd4Pg82xb9xvoc9gx/rM6ReuznEKIkf/7rgN03rLn2kFVs8JmIuMf+ qm/2KlX7m5DanWNPsMx+ZXF0Q/uWziYp3xDY9BRvVyO7MaVd5VkBo1EC3bAIg98Z3sHens 45+Y2HyGw+BsKpY9QpY0r3psl+2y9/mK02DsLND1MnEiXmWY89BIA126QJOuEcz1ZXB/up sE1F7Owxvr5fIfR0o2hrUD1WW6Th4IRPMVFoeQOU0JtBWsOfNMJWwwK9/fGwfdlongCQEn gHMoBdvuMNQvLYhOMV0N/gYdDghQxGgppXMHa1gvf0oXJDl51ALBhIM5Rwq5lQ== References: <568d8b25-8cb5-48f8-850e-0298e3fc456a@web.de> Content-Type: text/plain; charset=UTF-8 Date: Wed, 20 Aug 2025 17:21:28 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Lms-Return-Path: To: Cc: , , , , , , , , , , , X-Mailer: git-send-email 2.34.1 In-Reply-To: <568d8b25-8cb5-48f8-850e-0298e3fc456a@web.de> Received: from LeonHXL.localdomain ([116.237.111.137]) by smtp.feishu.cn with ESMTPS; Wed, 20 Aug 2025 17:21:34 +0800 Message-Id: <20250820092128.8069-1-huangxianliang@lanxincomputing.com> X-Original-From: XianLiang Huang Content-Transfer-Encoding: quoted-printable From: "XianLiang Huang" Subject: Re: [PATCH v4] iommu/riscv: prevent NULL deref in iova_to_phys https://lore.kernel.org/lkml/feb46658-5a3a-4403-b407-500566280eb3@web.de/ I updated the patch in v3, and updated change description accordingly: In v1 > - if (_io_pte_none(*ptr) || !_io_pte_present(*ptr)) > + if (!ptr || _io_pte_none(*ptr) || !_io_pte_present(*ptr)) In v3 > - if (_io_pte_none(*ptr) || !_io_pte_present(*ptr)) > + if (!ptr) but put your proposal at the patch Subject... v1: check pte null pointer before use v3: prevent NULL deref in iova_to_phys > =E2=80=A6> --- > > Changes > > v4: > > - Change the summary as Markus recommends > >=20 > > v3: sorry for making this messy. Regards, Xianliang