Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1052415pxb; Sun, 7 Mar 2021 04:43:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJySvZjpnWekYrxaCgMO240TQqbfRCiaYxEgZHx2zkKUTF5uCCUAOx9xaXohRSf8BtGIuxuh X-Received: by 2002:aa7:c0cd:: with SMTP id j13mr2400272edp.41.1615121014494; Sun, 07 Mar 2021 04:43:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615121014; cv=none; d=google.com; s=arc-20160816; b=EDO84py50rbiUj65DO4WE1j8RbiJc8rcYKqAeD5grtvLGHy2tcBBHs7UbyC9L9/bYb tb24OvU2lCrKM/zB6KVgmM7fsVZyGG2yGZyXRO02Ecn4g+4RuIMNawNvtFz25pGE9lXw Et7x/7A1GloC5VNU7OWcajkYky9Vr+KEBkmmb7uQxcM9Lg78KX9FiP1FopThRURzJER8 RJ3D2GwV/OZYEUJnTpjtnMYmMtUjYjccLfw51ptuqLTq+JLT+Q1iZ4+liXL9CpegWr/A GDN9IbN+Jq2kODYGYzX/THABmxJmNohuWr3p/Pd9XMJfFp25vEcvYcvkzbVeyGg/fTkn tq9w== 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=fAA4TPPCDGkT+Tya7F36DqMx6N0BmhqLnwdwo3XPN1I=; b=izkGKLghg0vxLlsoVN/2KAL78GjZEVIg8Mal1hO9TfPBk4AgpcDIgpOsy4Co9zhGjO ZsVoC11oFkts3HG2/5xqkYmfKOuCbm0kjLOpqnOZkC2mLklvC/YPypr8hC7sd5ZGC6Mu wtEMVWy27jqKVxKalUdlBD4mrn66yk6B2tF/xIoI/D9NuUWsX7GCsMpK35S4Nxusm76J Zl99BCyfzto/YovBmr6ADEJXXkqjh9FdL44c6tBH5hU6CnuIIn5J+aNvOxAksNIGCqFm FRAtLbpFJDoRp3oy/zEpsNDXIuf8EIG8MjK7QalPnZLSX+n6G9ZSHUyq6mr5niRVMwie Hh+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j6atcfc1; 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 e9si4933588edv.149.2021.03.07.04.43.11; Sun, 07 Mar 2021 04:43:34 -0800 (PST) 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=j6atcfc1; 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 S231574AbhCGK7X (ORCPT + 99 others); Sun, 7 Mar 2021 05:59:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbhCGK7I (ORCPT ); Sun, 7 Mar 2021 05:59:08 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8238DC06174A for ; Sun, 7 Mar 2021 02:59:07 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id u4so14699617lfs.0 for ; Sun, 07 Mar 2021 02:59:07 -0800 (PST) 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=fAA4TPPCDGkT+Tya7F36DqMx6N0BmhqLnwdwo3XPN1I=; b=j6atcfc1psN5Tz+4WxpRYvcbaOb5cUdpU2mTeXew96BDlBhCTI2zMLpiMZdpFW31kf Z3T7fGkK2wmlRamJ4ReGoJOGJniv/oc8Oy2X/ZlaqtmYRkRWRB8gc0natK8ctq/ud88r /ntGLH/i+02eCf4W1/U2z7cDulZkXVJMdg/Yk/GofqT2PDhwn88+toqYsZdNGJm5tolp knqkmaf3j7/lGJ63WuhZBR9G6OmoMsluPdD8jybF1rzmM3NeGlfZt/XAOlKphAkF/gTR TPkUCwiZQM5CsovCWOXe+IXVv7jnEp7wnYIWU0gnbsNybNemZHdWIlqEYxeiMlmm4qOj 1g7A== 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=fAA4TPPCDGkT+Tya7F36DqMx6N0BmhqLnwdwo3XPN1I=; b=MTj+5L8OWBuQysk93B/SCmWF/y2YUf1j3LifYxeBbrVCLv0VJFfnNnyDrve5VuwBI1 ACNBH7OvauSJeQJr6WLPFCEkp8O1wxulcpEjw20t5SQ6FsYJigaVqLGIr4op0srspinU JczpJ32vEybVcUdmLczufNl1FxC+Q1BGsvxSwGs0MK34fkN9kXdGp9XNt+IWqxxNz7JN ryFRTjLZ5OJ4HR6ov0PzCOAYwxfd8cGid5YZCJJKlpGV0Z7NE0PnPbywxRaJxmRsDFp3 AfnHINBOf+8xxhxUSUR/uNKVnOLrs6b6r+KDTHU2ggtI7yCtzs2cLRbeyWfdZ01xP4pK MsXA== X-Gm-Message-State: AOAM533zpviNX7AjhCNtYQ/R7hM4y9uI8HVbrVI0mCaQpKh/tv46TbBU giYMjFkq4G0UvHu6Q25ZQGdqMh2RZi4= X-Received: by 2002:a05:6512:39d5:: with SMTP id k21mr11067828lfu.142.1615114746056; Sun, 07 Mar 2021 02:59:06 -0800 (PST) Received: from localhost.localdomain (cable-hki-50dc98-67.dhcp.inet.fi. [80.220.152.67]) by smtp.gmail.com with ESMTPSA id e9sm1044213ljj.52.2021.03.07.02.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 02:59:05 -0800 (PST) From: Hassan Shahbazi To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Hassan Shahbazi Subject: [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash Date: Sun, 7 Mar 2021 12:56:43 +0200 Message-Id: <20210307105642.112572-1-h.shahbazi.git@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a NULL deference crash on hiding the cursor. Reported by: syzbot https://syzkaller.appspot.com/bug?id=defb47bf56e1c14d5687280c7bb91ce7b608b94b Signed-off-by: Hassan Shahbazi --- drivers/tty/vt/vt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 284b07224c55..8c3e83c81341 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -904,7 +904,9 @@ static void hide_cursor(struct vc_data *vc) if (vc_is_sel(vc)) clear_selection(); - vc->vc_sw->con_cursor(vc, CM_ERASE); + if (vc->vc_sw) + vc->vc_sw->con_cursor(vc, CM_ERASE); + hide_softcursor(vc); } -- 2.26.2