Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3518612rwa; Tue, 23 Aug 2022 06:09:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yyE5iqucNcnb4WC2iEgP0HVA1gyxPOHL4ra2JkqK33dL8JkBrk9QTB1ld7m0A8IOWhhiw X-Received: by 2002:a63:b03:0:b0:429:c549:d1f1 with SMTP id 3-20020a630b03000000b00429c549d1f1mr21087740pgl.131.1661260150276; Tue, 23 Aug 2022 06:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661260150; cv=none; d=google.com; s=arc-20160816; b=G/Laf5aT49n+AgA2eMXOh/3VLuS/SOTNllzZNU6Mm3EDaFL/vNKdBsNtuWeLqYX6cx a9wRThvuGRUDFA0itoka0/1TZlXKgjEqxul4zwO3+GjEgrWpb6LlaVwiKXms/M6UuF/k X10H8Zw2f/7ofhOTOA9ia4nU4jFdqkaf2/GsEvvKc1vOuALNbuWTat1VVysV/qbHWmQa DZDZ2JhDSg3IDCLpuf/Rb9IWV8CJ8XQ+PO+OIO0DvHR+vEYtnbwbK5NqWxVJLk23j4MA 8R3kgo16rMMU7l6ELRBlzH8Ca/GqtjbfqGL0QusZt7sTc4WPC5PMt7pS5tQfOt2EJlc0 RQnQ== 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=Kv27TZwx4TPJppictIkG+32HY6aglEJpnww4H6WHlhs=; b=CM1fAj97YLKnLpmje/8XwhssynOtedB0hQEeoEbIphjfESqnjUqqpJpHm2cJYjgDio 4EBfnUyg3DdtIv8C6Xpi1p6Lsq05MyGhUPMirQL439BkRgsoT8cB4Bl7pjcDhIKvuVxg Z7BJdn0QyhgKx1AGsg96X81n2p3XWnSjuRB6+pDdWsWVt1rcInHzABWNs0+c/s6MTwXy h02xnlLFzcr8AH4l7N8nLwuroFc5kcO35L9Ny6rFxx7YYgv3eMhD2AJQ/huStyMOqUPi 2gbMr38Srq/BZeY/nfmFgToJEl6fBHPa6be4TZqOPX5ycXsrMiHdWU05c1NZTohN68TG Sqaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XeESJ5p6; 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 m12-20020a170902f64c00b00170a468c50dsi8483333plg.275.2022.08.23.06.08.56; Tue, 23 Aug 2022 06:09:10 -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=XeESJ5p6; 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 S1347616AbiHWLJC (ORCPT + 99 others); Tue, 23 Aug 2022 07:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357409AbiHWLGw (ORCPT ); Tue, 23 Aug 2022 07:06:52 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9374C6DAD3; Tue, 23 Aug 2022 02:16:10 -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 sin.source.kernel.org (Postfix) with ESMTPS id 7EBB8CE1B5A; Tue, 23 Aug 2022 09:16:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92E8CC433D6; Tue, 23 Aug 2022 09:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246167; bh=7Jj2tH95KOIwaTxARlYh01f+IroJdOrakoNNAcv34J0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XeESJ5p6i2u20sxEKBWGtRtY8Z/4GnIvlukIFSke/eZq0ePD3KMVj9Ko8Szraz20G Zlydja07mSxT6wu8zoVRBitrr19Ax0fHZ8syMKzpSVBcef6zaC0g94FGXmuPSfQvxU JBZ/gtYtdVSVZiKjmypIBnGbjIXZa/McLYj4qrW0= 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.4 022/389] tty: vt: initialize unicode screen buffer Date: Tue, 23 Aug 2022 10:21:40 +0200 Message-Id: <20220823080116.631573441@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@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 @@ -351,7 +351,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;