Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3013648rwb; Mon, 15 Aug 2022 16:09:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR4p0yiib4Z3u6sjfEWxaU5Ux0n/zjrZgoocg7ooXWfCma3qio4RG8Q+xWVbXhs+lksMzdx4 X-Received: by 2002:aa7:d6cd:0:b0:43d:4ab8:87b8 with SMTP id x13-20020aa7d6cd000000b0043d4ab887b8mr16442084edr.412.1660604965382; Mon, 15 Aug 2022 16:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604965; cv=none; d=google.com; s=arc-20160816; b=mZ5awlSwC2hNxgfo1JxSRK4esNTOb9Hwp3HhWB6BuE0iFvYds98pHFroydYIM46MDm BIUkgwHKjrOwihbDXVXIhAI5bQSqUUZ+ADH7tH4MVxxR2g5+pSveXxEqUIUuWLZw64Z5 Py9cjPXozfpp9roLT3owc/WoGcIdzegnXOPiNhaeQwrVJ9JgJdRrp8JjfuFHf2/9WLGr TKZDKcaeRlqmyiY6VNKPsKnFRh8d7WiG7INc8HfxAcqrkA6DM1B1KCik+07Cq/8eFQLa k+4WYpObEYjmdvgcfMLtFta0uPdvni0jYBjn92ie2oFQ/wgxZj5tC3JEfQ2ZQet2qYOU 99Nw== 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=sxehl+8a3ZmDlF+ksVu38dXYVSlmg1SI/8fZPAB+cZBuT5uz5rONVftJA4nIvDnPpb OYnKHtM3h9yWQif/sCXdB0bdwDV5QmsiCkTX9upElE34ILl/whMGbuRYbsGmXAZg5XWs t0iQfdWGWOSWUd/wvVoE73x9rb+9gOv9vPu0xeQreNNTZCORdT7Vj5dKlmRRVQa2JKnw FZWzDSYQ3iaLwVjmnybsQWxZGWqV08cVYRAblV06+LZAX/bi6rdC2bsmlD5m4SWzBkCP 8OGu3rwBntv0o/D17CoXBTwj/UwqbCvrgL/66YOXs7Bn2NtrMyAlvjKCBJFRC1PPGmjc wMHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ytMjJR3K; 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 k16-20020a1709063e1000b00730c1be119asi7526883eji.408.2022.08.15.16.08.59; Mon, 15 Aug 2022 16:09: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=ytMjJR3K; 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 S1347789AbiHOV6V (ORCPT + 99 others); Mon, 15 Aug 2022 17:58:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350726AbiHOV4y (ORCPT ); Mon, 15 Aug 2022 17:56:54 -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 DBDA86B8FE; Mon, 15 Aug 2022 12:34:30 -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 320CF610A5; Mon, 15 Aug 2022 19:34:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 199F3C433D6; Mon, 15 Aug 2022 19:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592068; bh=xiETIeoHQ+5PvRfu22IMJsts+TQDJtrJiMNFQMjmY/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ytMjJR3KK+g7+yLJSfmFx6VpmViXczwOhyym/JlJ16InwqRjvyXdZw5AnXqax7dTO cuTIoGKATwMsyRrAHus+cOu2N28GQpjjY2qq5FA3LAe2l6+Vgbpxn/IFD9nDUtiups n1hVj/DJEvxpQ4M6lXCHnSlGpK5VQ0ffhvyy4J5o= 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.19 0052/1157] tty: vt: initialize unicode screen buffer Date: Mon, 15 Aug 2022 19:50:08 +0200 Message-Id: <20220815180441.527555144@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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;