Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp548167pxf; Wed, 31 Mar 2021 09:44:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFFnYSTBuAnxQ4wjhCz1tRtJsxfZBZsh0hftHYJRfWCkkFyQoulTHJHSQapOZNOhzQAlil X-Received: by 2002:a17:906:1386:: with SMTP id f6mr4441018ejc.45.1617209097558; Wed, 31 Mar 2021 09:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617209097; cv=none; d=google.com; s=arc-20160816; b=r0HBeONQC8i/cUp6NubpdydSOkrlltt8K+md9qCv+F4zEcRZsgUBk4sQFsMYjSO0Bk aFvhpeGKXjooBNP8nYCqDqgtOPzVIAMsp0gJo4Burx9zUqRDvncRSNcGmA0b8joEuAyT ZDeq/aXGZAdV92nhXHJrmMXqlu/4nK+Rj9faPLXX5ug4xl5ih1i2zKuJJCDuVPw1lwVu 6wectuOB0oNYxx1Ynkn347I3e5mUVjiXjwNOrf9PrlwPcYnhfobSGUyVKYaH/vRZ0LUw fUepIdGWYr/uQS5lmpBHMPGZWBHgcuxvHL7RLAZ1/9ccRiFlWTuPYGgGDF9W8FiqX7tI 4fFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=69RsZQP8V4UnpYZy11fJRF0FoC9i++XGLM1UOmQqQnI=; b=0wz6gGURcYiHpJyUN8qOOvcxDdMwSBNvKZ4kpglfF1m/0HRs9NaxK2Ye/oC6IX/kW2 rVWsFap4LWRAzs5uZzUiNdB8eGbtV0WF4fLLZVBmb5l0vaAtgQu05KgsH1ynm0chlmYP fOmPJi2SEPLtdbrake49aKLNIp7FRD4S/2sOIfi3DSnnyhJtdVgvPWmZGeM9gYn2bqN5 oZkb+oBtRbOQvQe2zmRRM1jB8BnoE8ccvcHS5229VXYeBT0mQJI3ZdT/INtZs+O60qQZ +hJDZDw8IZh0vkWB2K2ojog1UVDV8eh3Nqhz1ItZtmCaPHLekyG3CJW2PTEOlLTsVDuq FnwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W+uXbX6T; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si2139602edb.89.2021.03.31.09.44.33; Wed, 31 Mar 2021 09:44:57 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W+uXbX6T; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233950AbhCaQni (ORCPT + 99 others); Wed, 31 Mar 2021 12:43:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233891AbhCaQnR (ORCPT ); Wed, 31 Mar 2021 12:43:17 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98304C061574; Wed, 31 Mar 2021 09:43:16 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id b14so30052472lfv.8; Wed, 31 Mar 2021 09:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=69RsZQP8V4UnpYZy11fJRF0FoC9i++XGLM1UOmQqQnI=; b=W+uXbX6Ts6KkMF2YvgXpeKrn+NQqRdR/Qqw0iTCmDUacJN5uw9QId9sK/1BCSrcVji qelyj3Ca/VK/LrSTCFxp87yrfducIHJaP1YKI47su8de3N5othmYnmcl9+e4/1U36KpL NIv8uYGy0ejNhW6MwNEl+GNSGRHE706RtvukzNBne9zgYurq9b2/gNOKtNQTTV8N6kAG lErbXIZLbjyw2S9YKWbXhYqrEGggH1hxvjy0UUwGbnijIWK2znnwe30xROOIoHYos2Od XjOfrd7XT8+LnVRNNzbSCez7hr6q9D8NkXoQvyRMDt9NaRzcIHkofMIlVrtNwJsXxTS9 DRWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=69RsZQP8V4UnpYZy11fJRF0FoC9i++XGLM1UOmQqQnI=; b=KV7xZJBNP4zFQX+ZwFR9LqXHHYi+XEnpQzFWqL/QRaI6azVWdlwcMYMbJanxWqvyHL dN+AEGusyGGGLZAzbJN6/7dr0SKX0Cz52Xe/7p1muk6NDtcgdqEP/KPu3tiTbcEXdCkN xIUFy6Utk+4Xtu610P3BbWDJdzZ6VuAD7qEoTNkdaN4qjw6Pe2czkfo7qIeN/BdxAvOq DrDU4qaTVDXhrkNzVXUfr85l5z8DElHifdrdl6Vb233cbhdcIxt0Q1XhJQ6nJqMJ7+tP B7YWlUEzfaOzzXTnaaHBVe7MSiRCJuhSXVBIbpS3l7tAXLBO0A64TfxNf6qZkpkL1Bqj H8jg== X-Gm-Message-State: AOAM531Rhu6vHpiz5QGrfOPjQ98V5tRACSc3Vecsi957Har6IxGWLt2E OWKOh7udTXV5E9x7j4w1/Tkt3NMVRAC/qQ== X-Received: by 2002:a19:c18f:: with SMTP id r137mr2559820lff.519.1617208995107; Wed, 31 Mar 2021 09:43:15 -0700 (PDT) Received: from localhost.localdomain (cable-hki-50dc2f-26.dhcp.inet.fi. [80.220.47.26]) by smtp.gmail.com with ESMTPSA id b25sm277693lff.268.2021.03.31.09.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 09:43:14 -0700 (PDT) From: Hassan Shahbazi To: gregkh@linuxfoundation.org, daniel.vetter@ffwll.ch, jirislaby@kernel.org, yepeilin.cs@gmail.com Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Hassan Shahbazi Subject: [PATCH] fix NULL pointer deference crash Date: Wed, 31 Mar 2021 19:34:29 +0300 Message-Id: <20210331163425.8092-1-h.shahbazi.git@gmail.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch has fixed a NULL pointer deference crash in hiding the cursor. It is verified by syzbot patch tester. Reported by: syzbot https://syzkaller.appspot.com/bug?id=defb47bf56e1c14d5687280c7bb91ce7b608b94b Signed-off-by: Hassan Shahbazi --- drivers/video/fbdev/core/fbcon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 44a5cd2f54cc..ee252d1c43c6 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -1333,8 +1333,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode) ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1; - ops->cursor(vc, info, mode, get_color(vc, info, c, 1), - get_color(vc, info, c, 0)); + if (ops && ops->cursor) + ops->cursor(vc, info, mode, get_color(vc, info, c, 1), + get_color(vc, info, c, 0)); } static int scrollback_phys_max = 0; -- 2.26.3