Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3414042rwa; Tue, 23 Aug 2022 04:30:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR4cTgbO0FKs4uwEb98ZU7VVycu8wSAOwXxXMmOpCsCjE8KbGMEfaHd/In6IgeNBwj8D2ScI X-Received: by 2002:aa7:90d1:0:b0:536:70e1:5e83 with SMTP id k17-20020aa790d1000000b0053670e15e83mr12434897pfk.11.1661254117826; Tue, 23 Aug 2022 04:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254117; cv=none; d=google.com; s=arc-20160816; b=uYhwf2xFR4MUpZvbg0CRJWR6VcuYy6owDfXgIz4OM8WtT5ugUPlb9UmIF3iqdyI6E6 jwgXzSF6l4YidafPr6F+7MoxoLPKAZwceEnSHF7aDIv/3m1M5tGhw03ZvRE3bB3UzmDr KNt9eQRXS53nMjyJV7gSce4kneMI9UQhXySl5boZJY1wTHaANx2slDB4EGKoPw1c/Z47 AajTVfe9Lbi7/TJwAbhaUr1hWATvbVjsKeneme1/0JGmTYwnt8pWsjZJ8oEI4PQattKu wqn9SvLcCMd6hColLXHCkGmYVGkFXVv36vNkGbXuxlpqalAtoUezj0dIglzOA49v0IO/ hw4g== 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=zTKgkPEziIf7lxOrdC9HYnnWlFcqbxfISO/8C+wyHfjK+p3UH44sIg6FeURwSaeVvQ W4wDf96trZ/QYuLpKSkAln1rilwiYr0xhfwBuyysFDqR17gotL5wUcvtvQxqB/JxQHuD /CXj5shfHv0NvKrx28amMuH+JjkOfmj71Wn+AClNJbcCPh7bnYPIs0aDo5LTAEEe3ywp YTAzmzQv5oXUj6FK9tSlliw50W7JkT9fU4cWMHPi6iZIaxO/wHUg3KuV7t1CsXX8xEVO 3aAcqHWtqC/voQmpfeiBznCPIWr4NgqON+jMa5EMD/zpeVxP93W3HODSmISU1BWztqWL Fp9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TDcuwA7P; 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 h185-20020a6383c2000000b0042ad04f3686si3324544pge.616.2022.08.23.04.28.26; Tue, 23 Aug 2022 04:28:37 -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=TDcuwA7P; 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 S1355199AbiHWKbW (ORCPT + 99 others); Tue, 23 Aug 2022 06:31:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353489AbiHWKPO (ORCPT ); Tue, 23 Aug 2022 06:15:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CD2E72EF9; Tue, 23 Aug 2022 02:00:36 -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 CB101B81C3E; Tue, 23 Aug 2022 09:00:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D7D6C433C1; Tue, 23 Aug 2022 09:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245233; bh=7Jj2tH95KOIwaTxARlYh01f+IroJdOrakoNNAcv34J0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TDcuwA7P/P5n2iGb8kkb6kdG7iUtXDJcueIqgNXpyhEI1uwHP3Cv2+fI+Yyyeq7gY 3XMT8GIfO6q9uqABLkuQaaf7VjQ5FDO2wsNJg7bJ5eOB2+N75hzGe7d0LfNdqNWCPV aL/gYcPojc4GOfSxbvh6DlvcZDZ46VI7rdJq5Tlw= 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 4.19 014/287] tty: vt: initialize unicode screen buffer Date: Tue, 23 Aug 2022 10:23:03 +0200 Message-Id: <20220823080100.754328246@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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;