Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2038634imn; Mon, 1 Aug 2022 08:57:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sN5XHaws20HhDBtOyCWb5OcFCYAmvFLGN/RHZIZLEim2DhhjD7oGfMMmeWX/mVM3a4ZrNI X-Received: by 2002:a05:6402:424f:b0:43c:12e7:36dc with SMTP id g15-20020a056402424f00b0043c12e736dcmr16332467edb.243.1659369475592; Mon, 01 Aug 2022 08:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659369475; cv=none; d=google.com; s=arc-20160816; b=eWsYGQp2kTBiVyy4p15sY3CEoVJfJAvg8bk+PHlf7QK8enqYKwHJ1ovW49QSOzjJ9W Sy+3FsC0PowrXcY2iLpLXtCtTZYEKEw4QkcOyYlVR0UNUpHWbxJIwfUmLuc5buRRXwDm z/UKgzMe+Q/gXR+eiHGkpEzlnK3x8g0fs/WnpSv0FA1/NdaGlBqjbsJJsBCsIY48YrIC gaGO3TnhqkmhyQIFa4xsvKHSlDhzqbB/EyH4g7etvtfBaFaE3UQ5F4fXHVE7qK2/1I3q 2GLvQwNzOk8zvgsuzHJsaCLhonjUfjLht8k/icHf+LfUsFgvMCPQFVOJwo0zsM2aQc7T cVYA== 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=F/mKqS076MwtXGIYmf7ms4xhT6MgpvQ8HviHZjdmqhs=; b=o8/YdMGJFXS8wLS9KYrRukBsWqWoLJ3GYCO+yCmPR+mzc64vZfFYJAZivVyWoZynFk vhtYkTUoi9xbi0THS5lcUqVWtd0yzdWPGdO4KBo8iEbBQ3scDa6X+kPka83Wm33j+lS/ OxqcEGghjQhqLHok/1O53Y3vEDSiGmuQsy6iWJwIrfSGcjLxx3wfeGVAH69zebTVJGOv AYfr1ALnl9SCtjeWHKeCDYVAjv5R6DuI74zEjNCAL09E098f06IQvGtT3mr36r/ftePC arj4uMWp9Vm/I2kkyK0dT2nehXYvEgKs+ZWNYo0t/JZLvQdMSX/HBcmWIrh3ztnde3Eb B8FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IFEtGqq7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj26-20020a170906b05a00b0072b41b3d3c3si9003362ejb.766.2022.08.01.08.57.30; Mon, 01 Aug 2022 08:57:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IFEtGqq7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232503AbiHAPmf (ORCPT + 99 others); Mon, 1 Aug 2022 11:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbiHAPma (ORCPT ); Mon, 1 Aug 2022 11:42:30 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C609932062 for ; Mon, 1 Aug 2022 08:42:29 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id m2so4043812pls.4 for ; Mon, 01 Aug 2022 08:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=F/mKqS076MwtXGIYmf7ms4xhT6MgpvQ8HviHZjdmqhs=; b=IFEtGqq7gPqVKSrjjT0byqYrwfZQNpuvFBjEqNKseJGeyOQTf6PQZ7a8YeKzacmpsk kvShvFI67IJB8xOD+mEkt4pHG54yZWaoi66+DrPnCoHP7h6ykhe18kgDpey9zMHJp2KO 6cazarm9G8WrAGPyVpbXREw/ZLWyzD16BIXSPniBHSHJ/nXfOuXxXxmxJ/YZ78O0mYZ5 hDUFXZf/wdaMFLHk8CtLOGnsZE04jeDq34latLhSBZAduni6ISSRzXdmtYXBCwV1h2uL 4id/YqDHRx8pDobTCKF1BX26h7+Uvsi1AzjGohRaTYW09+y4TeZ/G3rquQ3X01uRC4Nk MyXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=F/mKqS076MwtXGIYmf7ms4xhT6MgpvQ8HviHZjdmqhs=; b=5fPrWt32cpWCXZ+cd1kqL3/aq/KjWFBu5R0r2T6KhFvEwRdNsgyv1dCGh1BtLt9Zfg JvO6rmqPZPsLoRYIEI9wCCtI+G7Ui00FAsx6pJBhyburY5FyrvIQhFSIK9wNeD75i78H bwpZKw4mPJWWIiJavn9XqA16f2fuNvXWhsCtuwrN8wBburDy/grAVshyxxITgu8k9BVm NJd54FuFWIe5aq+05FGOVsOGZAmeWrJ/0F+Mn22pUvkjZ88utQBLacQy3fE/1Rof4w8m TrKTJQr90cVM0fdml+XGMrW1yWgy8QMo3SyvNf76f3jOF2KxWydNbXN/C7VAx09mxhzk LgfA== X-Gm-Message-State: ACgBeo2QfRI9F5n5T/Hil9mN4gd5Ycpor0YB4eZ0il4/ghQbLlwA2AAS vkHHn2D88Mh9XSInRqxeBRjyHRC7VTej3w== X-Received: by 2002:a17:90b:4b8a:b0:1f5:942:dcc6 with SMTP id lr10-20020a17090b4b8a00b001f50942dcc6mr4324408pjb.78.1659368549280; Mon, 01 Aug 2022 08:42:29 -0700 (PDT) Received: from fedora.. ([103.159.189.153]) by smtp.gmail.com with ESMTPSA id e7-20020a170902784700b0016bea2a0a8dsm5895114pln.91.2022.08.01.08.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 08:42:28 -0700 (PDT) From: Khalid Masum To: deller@gmx.de Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, dan.carpenter@oracle.com, syzbot+14b0e8f3fd1612e35350@syzkaller.appspotmail.com, Khalid Masum Subject: Re: [syzbot] KASAN: vmalloc-out-of-bounds Write in imageblit (2) Date: Mon, 1 Aug 2022 21:42:20 +0600 Message-Id: <20220801154220.186048-1-khalid.masum.92@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org #syz test: https://github.com/torvalds/linux.git 3d7cb6b04c3f --- drivers/video/fbdev/core/fbcon.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 1a9aa12cf886..d026f3845b60 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2591,14 +2591,13 @@ static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos, { unsigned long ret; int x, y; + unsigned long offset = (pos - vc->vc_origin) / 2; + x = offset % vc->vc_cols; + y = offset / vc->vc_cols; + ret = pos + (vc->vc_cols - x) * 2; - if (pos >= vc->vc_origin && pos < vc->vc_scr_end) { - unsigned long offset = (pos - vc->vc_origin) / 2; - - x = offset % vc->vc_cols; - y = offset / vc->vc_cols; - ret = pos + (vc->vc_cols - x) * 2; - } else { + if (pos < vc->vc_origin || pos >= vc->vc_scr_end || + ret >= vc->vc_scr_end) { /* Should not happen */ x = y = 0; ret = vc->vc_origin; -- 2.36.1