Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2807568rwb; Mon, 15 Aug 2022 11:44:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR5qYMjuNYUbIwiynkZer5nmtuG2mDc9WdtsH+6yBhfdZmQwGRVgGYIqMNvJwNWWkoBKqGfy X-Received: by 2002:a17:906:cc4a:b0:730:850f:5cb5 with SMTP id mm10-20020a170906cc4a00b00730850f5cb5mr11559745ejb.658.1660589096079; Mon, 15 Aug 2022 11:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589096; cv=none; d=google.com; s=arc-20160816; b=klU6KFhjhfMP8FLWvk3Pw4XR8O+nsa6LScwI/nI8SoG6XqIUVVIbtwQ1VawfT4d8Am ynO9clXzc9S2WlTZn7eyVIrDGrZiRZAtxm8jVf6xXEpbdIMRWzzt3knqIud6Z04qc9/G mMY4yeWKeYD8m+FLSxXljcJtuui84sochM3yvOGYn2d0652hP+AyN8xCpR2ID6aQnQOf aBXLogJvtQw2BRo5cgvGo5hYp6x3jk8UdoPfP36/3xqxm+Y6E6577g1KCblmzn7BZHQx fxLaUp8r/Gya5bu3Kt+6vgvjdAQczJaLKiL1ji9pvNn8S5sJa8VXVsd1qkBHuV2aNQE/ Y6Lw== 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=yVIFUT6h4oi0OujOQ1qTxP5Em14wi3OE9HIvm7mHyFw47ufn0GmbU/qGJZ98Zfh5yu AjlUooFudXPegdGgMIP7JQU0QRKcn6PgAoXUAXrAqdZZYV92xj5PJeKK619186b5KEzF wz0RywpE82w4wpowGZ54JKP45FtqhJ68IOMVj3PwKeKOtDxTnQAgZKa/nv6SQ3jdKE8K QXp/fMglBiI/D+noyYqK8QUYJG+W4/xmCq5qeGcHeRRmLg0y7KZFAhtky0ZxqT1rcC6h NO0FWqRmS1Gd8rKmM3QtzrRj1dpJZuRzdF2esGMntUavUAnCt8Fbg+GLsrE2jRZJoyqI rQfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AiRxlMUl; 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 a12-20020a170906190c00b0073317d6b047si6651722eje.569.2022.08.15.11.44.30; Mon, 15 Aug 2022 11:44:56 -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=AiRxlMUl; 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 S239234AbiHOSRf (ORCPT + 99 others); Mon, 15 Aug 2022 14:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239513AbiHOSQj (ORCPT ); Mon, 15 Aug 2022 14:16:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDB342A940; Mon, 15 Aug 2022 11:14:58 -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 ams.source.kernel.org (Postfix) with ESMTPS id 503B2B80F99; Mon, 15 Aug 2022 18:14:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F6B4C43141; Mon, 15 Aug 2022 18:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587296; bh=xiETIeoHQ+5PvRfu22IMJsts+TQDJtrJiMNFQMjmY/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AiRxlMUloQpRBwzFMaCUZ8f+AG63mFAVlstwRuONmyoxeMr9FRg4wauEyCjqEdrcf BSXxNWFj0N/eRiZxGbkYBHwhLrAjk7Ppvdp+qaPj5sB4FjJkAYV7AQrH4b+6ByaYIh K9d+E0kHaYcxbIJCAIgxQ/5bp77Q5aAw9iv9myFg= 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.15 039/779] tty: vt: initialize unicode screen buffer Date: Mon, 15 Aug 2022 19:54:43 +0200 Message-Id: <20220815180338.892725357@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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;