From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEB0DC5AD49 for ; Wed, 28 May 2025 09:23:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F6F010E5CA; Wed, 28 May 2025 09:23:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; secure) header.d=ffwll.ch header.i=@ffwll.ch header.b="j0p2ZKKw"; dkim-atps=neutral Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C35C10E5BE for ; Wed, 28 May 2025 09:23:18 +0000 (UTC) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-442f9043f56so28649625e9.0 for ; Wed, 28 May 2025 02:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1748424196; x=1749028996; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OWbW6DSaS7EhhOnN6RRx03CpNOhwNByuhVw8RHuiKe4=; b=j0p2ZKKwssGTdb0zqKWq88HkufFnKAdlC+d3gWSMWY7QYqh/t1VPaq/tSKcPB0iR9a 4Bfn4PwmKX/23NbaBIjLu3x/Fp5LwRKZIXDYBpS95TQrsJtFWFjjAZ94zhJ7kjm8cvim eL2aEzOH+O0s9GNDhZJIvXPH7RB8eUZkg0fY8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748424196; x=1749028996; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OWbW6DSaS7EhhOnN6RRx03CpNOhwNByuhVw8RHuiKe4=; b=rxYVYE4+k6+a5P7Xhpk4l9d9bq+VGxqhWZpyJzTwjPBYF0eCgfY/Bkv4s6do1WeVtg Fd4t1IjfbOviM9yPDAS4t5tXVwsXF8/U0wSkK4+noEHqw02rwXD0rMO7C29VQGgqw7Qg jRk1SZ2Smu/5wnSP8Wtn81Em5PZuJqznPhxoRycZ7s6960WDLGoWQWu39BWYz1j+NdiN plSZXiS8nyCuPwN8CBVxPIv8nMtSQaqX7K6iamy8S8gUSSe4xvfCUjKMP/pxNIj35Esl HfZC1r0eBO3/GLo38Akss4mNj6jyQu05xrJVCGH4buIv19L/Dr+hymmxWTLdPdRb5L2P f5lw== X-Gm-Message-State: AOJu0YzCU3tSyM58LzHA/tPa6THq7o3dFioRD/tIKccDIMm3mhy8VrCg n5oQmODcc2PwU8QAHCEjU2RjsmF0Jw51KYC+kE8uMn2ET7FXTx3pTCaJVH+9cSWxtNo= X-Gm-Gg: ASbGnctAXU1Zs18S6vxUovEySly2pXrLQZAbvLTcgYwBKeDMq8sYaz+k11Pk3sW4j2t KPGUO+NWL3ZipXpXHheDNBkbjRbhqKaym+SDJaA5VDGjgHjdaPO/DHNGlfc/KgRiXgwd886aaIY 4y/2Hi4Ix2KnLYq9wPjozFKzPi9Z8ylW1HrJr6lhl17tM+VvC5y73SmNLkphZGOH7WEahiXToXN /ednVzYVyk2gk/7mcQ3l1sFWjCa3nQNLj4ZEJuDBxQKG+LwiQ+Qz6LDbN+SmWx1INPd/t+hRu9P tm7adfgG9uOQq/1QJxhihgqAx7iCKMe8djjQ0MTc2T7wvWtGLu4J8A9iYitACX8= X-Google-Smtp-Source: AGHT+IECvxtDkXo4c3njMnU8BGrUNWkT/CLwIW61OnEn14bzAhOWHTXaITQrwX36/3VuUA3VhNB3aQ== X-Received: by 2002:a05:600c:4e45:b0:442:f4a3:8c5c with SMTP id 5b1f17b1804b1-44c919e13ddmr190908365e9.10.1748424196628; Wed, 28 May 2025 02:23:16 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:5485:d4b2:c087:b497]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4eac8aa79sm948086f8f.50.2025.05.28.02.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 May 2025 02:23:16 -0700 (PDT) Date: Wed, 28 May 2025 11:23:14 +0200 From: Simona Vetter To: DRI Development Cc: intel-xe@lists.freedesktop.org, Simona Vetter , Simona Vetter , Zack Rusin , Broadcom internal kernel review list Subject: Re: [PATCH 7/8] drm/vmwgfx: Add comments about drm_file.object_idr issues Message-ID: References: <20250528091307.1894940-1-simona.vetter@ffwll.ch> <20250528091307.1894940-8-simona.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250528091307.1894940-8-simona.vetter@ffwll.ch> X-Operating-System: Linux phenom 6.12.25-amd64 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Wed, May 28, 2025 at 11:13:05AM +0200, Simona Vetter wrote: > idr_for_each_entry() is fine, but will prematurely terminate on > transient NULL entries. It should be switched over to idr_for_each, > which allows you to handle this explicitly. > > Note that transient NULL pointers in drm_file.object_idr have been a > thing since f6cd7daecff5 ("drm: Release driver references to handle > before making it available again"), this is a really old issue. > > Since it's just a premature loop terminate the impact should be fairly > benign, at least for any debugfs or fdinfo code. Rereading idr_get_next I now think it's all fine, please disregard this patch. -Sima > > Signed-off-by: Simona Vetter > Signed-off-by: Simona Vetter > Cc: Zack Rusin > Cc: Broadcom internal kernel review list > --- > drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c > index c55382167c1b..438e40b92281 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c > @@ -323,6 +323,7 @@ static int vmw_debugfs_gem_info_show(struct seq_file *m, void *unused) > rcu_read_unlock(); > > spin_lock(&file->table_lock); > + /* FIXME: Use idr_for_each to handle transient NULL pointers */ > idr_for_each_entry(&file->object_idr, gobj, id) { > struct vmw_bo *bo = to_vmw_bo(gobj); > > -- > 2.49.0 > -- Simona Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch