Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp257584lqp; Fri, 12 Apr 2024 17:34:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKIVIAm4ayfSaqv4nTf4mP2CzqK+ccjyEY2jfzvyxE0y0Gmnja307m6XfY3CRuFH5ukSQHLmTbFDfqmdIHfIkAvtNUygkFkmKivUxz7Q== X-Google-Smtp-Source: AGHT+IGlZnZmSX9avMpOBfSFqun2ICvDm8kF4uPbWFeeBgsj4rIdjYCW42Aih0f2UG679E/9vKW/ X-Received: by 2002:a17:90b:46c8:b0:2a2:50ef:ece2 with SMTP id jx8-20020a17090b46c800b002a250efece2mr3864924pjb.17.1712968491976; Fri, 12 Apr 2024 17:34:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712968491; cv=pass; d=google.com; s=arc-20160816; b=AF8E1+QWfIxoa4obcDzdPd7uWlq/nRkH6GjOAjEXz8VLJU8oJJ3TcKfpm4/01rxcDn Zcdj0GpOK0T0bFam53a6hCVpKmZtTg3lm73a02cPC69CnyQFILBkQqOuA9RqfvoQfJyM 1KfOLDKCpYS9x9SrEw8DvtOFZP/0YcjNm1vhiaB8KuS8jsDUMAczUuIOP4acibRgDfQ0 jMovwqRTWTKATIyuqKUaQgcPdDfSZ019YET266MbrHk/54U3I9T2TT79x+RQ4DNcDnRk grTL3KPc9z4boAlNzxE/Qe0+o9ChSFevmBVpewelEdBuy92p5hqvQtJyNRwPyYjtIVHC GV5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=Ga9BDy950sqrkymKo/DX0soSuDFkOI9AzOuH62JvhYw=; fh=YxIO6i+6u/K9Dh4di3tD1aZL7mqx5fhpaOyqffkMDSo=; b=dKe82W3ZMqyQ7fxoAH7J7vjNuOZ17V4cwLE8GoiqegnJq/Oh0PH1HdfLc/Ird5lF6F XUtnfo6Gt9jXRQgXa9M+vyN1Y2thJDj7IrGrkzPEkBiFuBswBbjlIOCn8chPeIhYRkmI 23Ohs28UqWzHnlum2pyZ2qK897DMfNdeRbH4jS01ow2Jw58H3lgZphpu6O5NGOVpuJSa 53TEAmElFN3ErEVAwa4JAd9cwKujWa2Eg0h7xfw9pijcWJgGjl3dnrw7VRwuw7hnoxlW bLkhOBQV7IX3TeFcXtKR6nV8VYNOwKqOmjdZqU/C1ymXfWZ8FyOuwCuM3bSBpgAtDQW8 PQtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="I8NcdD/e"; dkim=pass header.i=@suse.com header.s=susede1 header.b="I8NcdD/e"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-143455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b2-20020a17090a10c200b002a2f7dd8afcsi6263366pje.31.2024.04.12.17.34.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 17:34:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="I8NcdD/e"; dkim=pass header.i=@suse.com header.s=susede1 header.b="I8NcdD/e"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-143455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3B7F4B2354F for ; Sat, 13 Apr 2024 00:33:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C91E32F5E; Sat, 13 Apr 2024 00:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="I8NcdD/e"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="I8NcdD/e" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 F19C037E; Sat, 13 Apr 2024 00:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712968380; cv=none; b=mTuQwrHETK3iNwA+3iShWdaAaJg/mN0xUYcKGKQhzQvvYBguEq+I8X+3wnEZrqdHqT3VR3hMnDhxHE8Noco17QZqLIDXAI8J2MTmhl7wgZ9QXabs/HsIPJjtn094g9DHEVNxSbULuuR+VdC4dGNl6+ULLIMjl8ZF14z50acfPBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712968380; c=relaxed/simple; bh=coyk5nt8YNwTSTgY3qFZSAF1qy56yQEwiyGek0JLb04=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gBaq8Ja/qsNL8xOC6HCFPz/HjpQyAY3PPQpHBULFuo/qVDD8hfaqylzApyGwaaaG9weH2aebFCDiExQUPE5W1zydMfKOrjxiuJGnh9YyuhGoU1fhC19H6v53PbeogRZdclWGS5X82ePKI8SUiDO2WRljoK05gHR0PhgEdgfn9f0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=I8NcdD/e; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=I8NcdD/e; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DAC6022C4A; Sat, 13 Apr 2024 00:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1712968375; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Ga9BDy950sqrkymKo/DX0soSuDFkOI9AzOuH62JvhYw=; b=I8NcdD/e1cLEL+nxIyxQnHqKpsUPCfjG7jRi48rRO496Fg9sqJd96AMINZ//aK1SXlaaBk yx4TdpyriWgtaSgGl3g1WhSlTJSfzkL68Mk4dsPaxMgqIS5ivgz8XTOgNTqZPx+CdO/iOO ZzXxGKsXCAQYTDO6ttOJiJVn4fGySh8= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1712968375; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Ga9BDy950sqrkymKo/DX0soSuDFkOI9AzOuH62JvhYw=; b=I8NcdD/e1cLEL+nxIyxQnHqKpsUPCfjG7jRi48rRO496Fg9sqJd96AMINZ//aK1SXlaaBk yx4TdpyriWgtaSgGl3g1WhSlTJSfzkL68Mk4dsPaxMgqIS5ivgz8XTOgNTqZPx+CdO/iOO ZzXxGKsXCAQYTDO6ttOJiJVn4fGySh8= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id AE3361368B; Sat, 13 Apr 2024 00:32:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id /MuCKrfSGWZhGAAAD6G6ig (envelope-from ); Sat, 13 Apr 2024 00:32:55 +0000 Received: from localhost.localdomain (silencio.work.jeffm.io [192.168.111.21]) by mail.work.jeffm.io (Postfix) with ESMTPS id 52F881014592; Fri, 12 Apr 2024 20:32:50 -0400 (EDT) Received: by localhost.localdomain (Postfix, from userid 1000) id B6E721079455; Fri, 12 Apr 2024 20:22:54 -0400 (EDT) From: Jeff Mahoney To: Wayne Lin , dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, David Airlie , Daniel Vetter , Jeff Mahoney , stable@vger.kernel.org Subject: [PATCH] drm/mst: Fix NULL pointer dereference in drm_dp_add_payload_part2 (again) Date: Fri, 12 Apr 2024 20:22:52 -0400 Message-ID: <20240413002252.30780-1-jeffm@suse.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-Spam-Score: 0.20 X-Spam-Level: X-Spamd-Result: default: False [0.20 / 50.00]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; BAYES_HAM(-0.00)[25.85%]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[vger.kernel.org,gmail.com,ffwll.ch,suse.com]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_BLOCKED(0.00)[rspamd.com]; FREEMAIL_ENVRCPT(0.00)[gmail.com] Commit 54d217406afe (drm: use mgr->dev in drm_dbg_kms in drm_dp_add_payload_part2) appears to have been accidentially reverted as part of commit 5aa1dfcdf0a42 (drm/mst: Refactor the flow for payload allocation/removement). I've been seeing NULL pointer dereferences in drm_dp_add_payload_part2 due to state->dev being NULL in the debug message printed if the payload allocation has failed. This commit restores mgr->dev to avoid the Oops. Fixes: 5aa1dfcdf0a42 ("drm/mst: Refactor the flow for payload allocation/removement") Cc: stable@vger.kernel.org Signed-off-by: Jeff Mahoney --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 03d528209426..3dc966f25c0c 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3437,7 +3437,7 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, /* Skip failed payloads */ if (payload->payload_allocation_status != DRM_DP_MST_PAYLOAD_ALLOCATION_DFP) { - drm_dbg_kms(state->dev, "Part 1 of payload creation for %s failed, skipping part 2\n", + drm_dbg_kms(mgr->dev, "Part 1 of payload creation for %s failed, skipping part 2\n", payload->port->connector->name); return -EIO; } -- 2.44.0