Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp898727ybl; Wed, 4 Dec 2019 12:54:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzM1aBaStFs/RFsRYZ92PJEnSyEDESa+YcT4Iyulp2Cnn5Lbrnt0W7AxH9UPNN5S9hXeujG X-Received: by 2002:aca:5083:: with SMTP id e125mr4403664oib.96.1575492863180; Wed, 04 Dec 2019 12:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575492863; cv=none; d=google.com; s=arc-20160816; b=ZHpC6ryTD/636c+yiNiv8hLlIWf+sCS9AqElEIbnq46CBgpsD2QOdUe4nyzD/4DPwk p5fx6n2zaVHFKjsN1Yg+ljMareM0r3FL3ZWSP4KcigKqeQ0NY74vrgRKPDWhDdNoHb/0 7kMGKG5SVkOicBvaPInmL1ZNP/gqZv/ZbpjENpfqnYe66NuWU/pilqWRQatiT1diXr3p dVH70xSRXc1DQ7Zgxw73B1j5caKn42jP50hUeL4MDJY/060ScC84Rg/jBaPMY9xeRmb4 9fgJdl41U7U+n1G2K93+Ea/JcMct3/FzCtXHN+1frSRPfta9TQ5QukQ31E0wP2W9VNb+ h3sQ== 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:from:references:cc:to:subject; bh=rI921cbdR3FPUrcj6kPsNPEpD4kh09sgPUfwixlZtm8=; b=x6EzFx6j7mZGtSl4se7a6oFrIY9lFjS9SArL3zkQSbswyHr7cK6LTU+hz4dq7KF/9E +GMQFp/JMNxT7ygGX8ozgIdx7Mr0vVkCtTxD1i8qOSqKrAK/oV6GYwT2W9LzWJ+gRQd1 9L+w32itCzjtSHyK3kw1Eer4D4SjBuciuErR2+gw1y3Z6Ons/9vVQf3kIfGfd4Ko2eS7 FBlScJ2BNZqgHR4fF0TTQHy90Ostk+/Lfx3BKOjJtWj4FlehPFikg8/4dFXP0UAwpcCf j9YCeJvt1XJH5CqpKs7hwp2fEzBn1DIwuMPfeuUopcxg9eHhyCTNBcGbbBUzfiPJ6lKF areA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w65si3900523oig.149.2019.12.04.12.54.10; Wed, 04 Dec 2019 12:54:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728274AbfLDUwb (ORCPT + 99 others); Wed, 4 Dec 2019 15:52:31 -0500 Received: from relay.sw.ru ([185.231.240.75]:50772 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727889AbfLDUwb (ORCPT ); Wed, 4 Dec 2019 15:52:31 -0500 Received: from [192.168.15.5] by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1icbcl-0001ny-LQ; Wed, 04 Dec 2019 23:51:51 +0300 Subject: Re: KASAN: slab-out-of-bounds Read in fbcon_get_font To: Dmitry Vyukov , Daniel Vetter , kasan-dev Cc: syzbot , Kentaro Takeda , Tetsuo Handa , James Morris , "Serge E. Hallyn" , linux-security-module , Bartlomiej Zolnierkiewicz , Daniel Thompson , dri-devel , ghalat@redhat.com, Linux Fbdev development list , Linux Kernel Mailing List , Maarten Lankhorst , Sam Ravnborg , syzkaller-bugs References: <0000000000002cfc3a0598d42b70@google.com> From: Andrey Ryabinin Message-ID: <6632ddb6-37bf-dc42-e355-2443c17e6da0@virtuozzo.com> Date: Wed, 4 Dec 2019 23:49:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 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 On 12/4/19 9:33 AM, Dmitry Vyukov wrote: > On Tue, Dec 3, 2019 at 11:37 PM Daniel Vetter wrote: >> >> On Tue, Dec 3, 2019 at 11:25 PM syzbot >> wrote: >>> >>> Hello, >>> >>> syzbot found the following crash on: >>> >>> HEAD commit: 76bb8b05 Merge tag 'kbuild-v5.5' of git://git.kernel.org/p.. >>> git tree: upstream >>> console output: https://syzkaller.appspot.com/x/log.txt?x=10bfe282e00000 >>> kernel config: https://syzkaller.appspot.com/x/.config?x=dd226651cb0f364b >>> dashboard link: https://syzkaller.appspot.com/bug?extid=4455ca3b3291de891abc >>> compiler: gcc (GCC) 9.0.0 20181231 (experimental) >>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11181edae00000 >>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=105cbb7ae00000 >>> >>> IMPORTANT: if you fix the bug, please add the following tag to the commit: >>> Reported-by: syzbot+4455ca3b3291de891abc@syzkaller.appspotmail.com >>> >>> ================================================================== >>> BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:380 [inline] >>> BUG: KASAN: slab-out-of-bounds in fbcon_get_font+0x2b2/0x5e0 >>> drivers/video/fbdev/core/fbcon.c:2465 >>> Read of size 16 at addr ffff888094b0aa10 by task syz-executor414/9999 >> >> So fbcon allocates some memory, security/tomoyo goes around and frees >> it, fbcon goes boom because the memory is gone. I'm kinda leaning >> towards "not an fbcon bug". Adding relevant security folks and mailing >> lists. >> >> But from a very quick look in tomoyo it loosk more like "machine on >> fire, random corruption all over". No idea what's going on here. > > Hi Daniel, > > This is an out-of-bounds access, not use-after-free. > I don't know why we print the free stack at all (maybe +Andrey knows), > but that's what KASAN did from day one. I filed > https://bugzilla.kernel.org/show_bug.cgi?id=198425 which I think is a > good idea, I will add your confusion as a data point :) Because we have that information (free stack) and it usually better to provide all the information we have rather than hide it. You never known what information might be needed to fix the bug. Free memory might be reused and what we report as OOB might be an UAF and free stack could be useful in such case.