Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp37945pxk; Tue, 15 Sep 2020 17:05:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/ieS4r8e7NmTRCXa0WufCPgnKR31xv4kdAR2O5QlDEgtKgGT4tSvTDzqoEWvCWM8kalvr X-Received: by 2002:a05:6402:6d6:: with SMTP id n22mr24639335edy.79.1600214732290; Tue, 15 Sep 2020 17:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600214732; cv=none; d=google.com; s=arc-20160816; b=b4vMzluvxlIdbNAnHtbqqKU29OHYUij3xKTVGdzMbMkjbPNib8O4HN04aw7OjUF1nr 5KBUavzRD32TvHf1J2pCp4P5p/V0RLqarWfVYkPzengNSjDEUCo6ZJbyVmPIctEJeFV4 sNpyaB9vEkZ08Cs92fYTmr3tKsRuVBml46LYO4wQBW/n0wbxJGpwN09oijzgRwS8ZHQJ EORdf0T/0ubVYlLfUsBCs7O5yNJpVs+frUvAwxDf51sLrMA5usJHN4iqqrbQV5A2i3dV scOE83OBtNpdVUHUIvuyr4w7+5lH/kYjsnjoW2aKV8vau2KHicWCiuoO7xa1RcwxXIRZ LiOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=J18Lu3bSm+JcszN5Hxf1t+jPAGBvZ0tEukHyft1K9O4=; b=BGJi3BUesNGpf5kKG89JYP1oHf/qnGjdpIbwxgjkn84FJ+GxUZ5Ik2xafvFBkcHLV3 PLL7AI/H+ANkGsQAcq5pCIf9v/lfpXzNQWP4JRX/4HevwNp74z1HcW6e+gsSDgan82LJ uUUEoqwhzWybJazdIDU7UnxZj2cQiLBjW3ipPaUwF5pKXUwxhuCPXOXF0QHXS/e0duZO MY/Mlu4wIeL/WGU2R2W24Sr6su1E7a+N1rMrdpmM6VqdfCBQ9bxX7HtwOcxSUbZxqabv wD1a8KWBiP2bvjAX35Rl1jV+hIPFEEVZAyOrQR9xYi1EOWOTbMb7nlv6GR+kOgft9Mkb yVvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lt3si10232896ejb.687.2020.09.15.17.05.09; Tue, 15 Sep 2020 17:05:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgIPABe (ORCPT + 99 others); Tue, 15 Sep 2020 20:01:34 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:49217 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727021AbgIPABT (ORCPT ); Tue, 15 Sep 2020 20:01:19 -0400 Received: from fsav102.sakura.ne.jp (fsav102.sakura.ne.jp [27.133.134.229]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 08G01Fah025558; Wed, 16 Sep 2020 09:01:15 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav102.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav102.sakura.ne.jp); Wed, 16 Sep 2020 09:01:15 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav102.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 08G017YP025522 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Sep 2020 09:01:15 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Subject: Re: [PATCH] fbcon: Fix user font detection test at fbcon_resize(). From: Tetsuo Handa To: syzbot , george.kennedy@oracle.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, syzkaller-bugs@googlegroups.com Cc: b.zolnierkie@samsung.com, daniel.vetter@ffwll.ch, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, natechancellor@gmail.com References: <00000000000024be1505ad487cbb@google.com> Message-ID: <7c52e8cd-e4cb-cd0b-40d5-b9654aec09f3@I-love.SAKURA.ne.jp> Date: Wed, 16 Sep 2020 09:01:06 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greg, will you pick up this patch? It seems that finding the real cause of [3] and actually fixing [3] will be difficult. Since I can't reproduce [3] locally, I will have to try flood of "#syz test" requests for debug printk() patches. On 2020/09/11 7:57, Tetsuo Handa wrote: > syzbot is reporting OOB read at fbcon_resize() [1], for > commit 39b3cffb8cf31117 ("fbcon: prevent user font height or width change > from causing potential out-of-bounds access") is by error using > registered_fb[con2fb_map[vc->vc_num]]->fbcon_par->p->userfont (which was > set to non-zero) instead of fb_display[vc->vc_num].userfont (which remains > zero for that display). > > We could remove tricky userfont flag [2], for we can determine it by > comparing address of the font data and addresses of built-in font data. > But since that commit is failing to fix the original OOB read [3], this > patch keeps the change minimal in case we decide to revert altogether. > > [1] https://syzkaller.appspot.com/bug?id=ebcbbb6576958a496500fee9cf7aa83ea00b5920 > [2] https://syzkaller.appspot.com/text?tag=Patch&x=14030853900000 > [3] https://syzkaller.appspot.com/bug?id=6fba8c186d97cf1011ab17660e633b1cc4e080c9 > > Reported-by: syzbot > Signed-off-by: Tetsuo Handa > Fixes: 39b3cffb8cf31117 ("fbcon: prevent user font height or width change from causing potential out-of-bounds access") > Cc: George Kennedy > --- > drivers/video/fbdev/core/fbcon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > index 66167830fefd..dae7ae7f225a 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -2203,7 +2203,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, > struct fb_var_screeninfo var = info->var; > int x_diff, y_diff, virt_w, virt_h, virt_fw, virt_fh; > > - if (ops->p && ops->p->userfont && FNTSIZE(vc->vc_font.data)) { > + if (p->userfont && FNTSIZE(vc->vc_font.data)) { > int size; > int pitch = PITCH(vc->vc_font.width); > >