Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1862535rwb; Fri, 19 Aug 2022 10:37:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ZCULYKJP4rNoetXmUM0AJL5qKvbE9fCGCPnXaNTqBPdU6rYkGU+70KMQjUrNSm4p/03nv X-Received: by 2002:a62:e804:0:b0:536:3d1a:1b33 with SMTP id c4-20020a62e804000000b005363d1a1b33mr1135262pfi.4.1660930645099; Fri, 19 Aug 2022 10:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930645; cv=none; d=google.com; s=arc-20160816; b=nLxwr1TxvysGPy40j2Q9fUZSTaOqMRbUagTj66EMpaB4lbBVJSobcDi5OgtRlbzxDv ++POozb4TnUZZBoq5PMlJbJQUBwWJRhookYXSm2cDNMgyHc5iBUx0PQCW84+fyxmVe5R jvlxQFTQlIDIfMnlx2TS7HSj+7q8PatmMh/gKlRkoXU9kShK1TIqcvmNYMXG+xE9y22v aGxx0E0kta0kmrqbxpz/5uTj7L7DVUGsso+m7lsqLwGydT6QIaAOPW9K89HFU21AY9Kk +l2yc48sKCYebYFjwTqOdrXD5F4ddDnLf3oYqjXpfZhdM655HrplA6e1JRHh/zrpC0PE GVUg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NaOimzYRLwwQPQ7LoJT3Hjfr70RlqtJ4abqxnYy6gxk=; b=xTQHX1yIvoxHPZyc09cmDGS6hSY7IwjXxoZ86WpgR1BIK/G+1FUPbRQGjwE+bBn6YE MhAsfll2oCYrmd9WZmH9FMn/otl1EUesE6WRwRz0Wjy+gXCJq2blqny4vtLy7dG7Fwbk mdOspBK9GEavy/SpyyqTnvaWYNuiG0+kwcqqPALAWLwkSd9dqm7mxXBdiilYndQ1tY05 tNhAaxxZV48tjCAd5kxyAMgHQ0OF/oWc9iV7LsOJo+tt1ikbblhpNAcsfKxRw4f3nQru 8aR9SRNnOciGuOjI2rfk33Fjc3HGavC5XlltUbRKe/vAJi14nHC8eR+A6148Ps5xWiCP sHJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jHv220vr; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a63d907000000b003fd31d844f7si4695544pgg.538.2022.08.19.10.37.13; Fri, 19 Aug 2022 10:37:25 -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=@linuxfoundation.org header.s=korg header.b=jHv220vr; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350266AbiHSPs7 (ORCPT + 99 others); Fri, 19 Aug 2022 11:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349918AbiHSPrZ (ORCPT ); Fri, 19 Aug 2022 11:47:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5124313F64; Fri, 19 Aug 2022 08:47:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 91917616D5; Fri, 19 Aug 2022 15:47:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 966C2C433D6; Fri, 19 Aug 2022 15:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924027; bh=xiETIeoHQ+5PvRfu22IMJsts+TQDJtrJiMNFQMjmY/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jHv220vru0XZ1ZOhJIk/s6gGt9AY0CzEkBPjQGm9gnGUMYfYALoQPIFvPRtr5pgor ztfdY5DO7+PNMC0EHl6l+21GnKDM5nPjiJRVFAYNxRbwIwqMfiEVsq2pHOgLnkBxaS z7Qgi6YCMVKYq+SQiztbU9J6IsF8hGDIPSCr53JA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , Jiri Slaby , Tetsuo Handa Subject: [PATCH 5.10 031/545] tty: vt: initialize unicode screen buffer Date: Fri, 19 Aug 2022 17:36:41 +0200 Message-Id: <20220819153830.589119680@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Tetsuo Handa commit af77c56aa35325daa2bc2bed5c2ebf169be61b86 upstream. syzbot reports kernel infoleak at vcs_read() [1], for buffer can be read immediately after resize operation. Initialize buffer using kzalloc(). ---------- #include #include #include #include int main(int argc, char *argv[]) { struct fb_var_screeninfo var = { }; const int fb_fd = open("/dev/fb0", 3); ioctl(fb_fd, FBIOGET_VSCREENINFO, &var); var.yres = 0x21; ioctl(fb_fd, FBIOPUT_VSCREENINFO, &var); return read(open("/dev/vcsu", O_RDONLY), &var, sizeof(var)) == -1; } ---------- Link: https://syzkaller.appspot.com/bug?extid=31a641689d43387f05d3 [1] Cc: stable Reported-by: syzbot Reviewed-by: Jiri Slaby Signed-off-by: Tetsuo Handa Link: https://lore.kernel.org/r/4ef053cf-e796-fb5e-58b7-3ae58242a4ad@I-love.SAKURA.ne.jp Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vt/vt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -344,7 +344,7 @@ static struct uni_screen *vc_uniscr_allo /* allocate everything in one go */ memsize = cols * rows * sizeof(char32_t); memsize += rows * sizeof(char32_t *); - p = vmalloc(memsize); + p = vzalloc(memsize); if (!p) return NULL;