Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3586915imm; Thu, 17 May 2018 11:05:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq4H+4zVaS/hjXSEWNmePfM9TTLgKGIlxLXGNoJQ4oTsRWzuYkIr9e4nARmtYoqkRrw+1ki X-Received: by 2002:a65:61c8:: with SMTP id j8-v6mr4798020pgv.370.1526580334881; Thu, 17 May 2018 11:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526580334; cv=none; d=google.com; s=arc-20160816; b=Bg+HQr9xOl5usIwbPs30oqvf8FaP+ySSvk3Rj8WPq2j2X/NLgHxw8YNmfgjN0i/tYv ED3GUkn9Gm3bv+fkWqlmPVAn5PYl7XfAv9U+buxe0LoPmtJuc6uIiMnItXvVF4dyfmeW s1ZokUirW+Qttn8/pWwxfQBW3Pyktr8ARbK460QNZ5/7muGFXPWv5i+JQIRPo2KT3qKO FZoT0zKcGxgGFT3CpsXnQAWG/2t5BvT0A9rLsM2OwNVidBUj6CksGfgcg0AElenyc28B O+e/YdQsO8D3gGmwCjGW1IGIxCHGU/G2TDDMvMy8QJuDYkcka0SjWecB+fkGQy50i/IZ iVtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature:arc-authentication-results; bh=/rPWHAUFOQBMrO2Xjc5W6KvT/KMhO6B9RHdffApwEf0=; b=iGO0StdTcdnmkmbjzh4gaH4YntKmEiuEMnbq6KPEBo0BL44ZdAvSvGuIi/RE24Le/U ApxkI9sMoK6VChuUa09qt2ALGvYgD5hEhn9kjPaNDXyb+1zntv7XN6h7VULokKVT59WD YiPG5tXEO+qRKognIU1PSzAhYA1LtXjjii3wT2zfMZraTeE0+FPcELPUeMcSXS7F/jPu whQiDWENlX42wk0G8+bf2KusMlx0/KWiJig3BAZVZtulVB9wXavewIJM5OAnrV5fpm3z DT2lj7uUDZx8/IEdhtd4+EIvQStXRbsLwXqHvd2hvVr2KbDV6O51o21uYeWiV7Iy3i0X KFDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HbvRxOCM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9-v6si5411088plo.208.2018.05.17.11.05.20; Thu, 17 May 2018 11:05:34 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HbvRxOCM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbeEQSEl (ORCPT + 99 others); Thu, 17 May 2018 14:04:41 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:40532 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbeEQSEj (ORCPT ); Thu, 17 May 2018 14:04:39 -0400 Received: by mail-io0-f195.google.com with SMTP id g14-v6so3079273ioc.7; Thu, 17 May 2018 11:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=/rPWHAUFOQBMrO2Xjc5W6KvT/KMhO6B9RHdffApwEf0=; b=HbvRxOCMnzjFKCnRx9IiEwYFcfA9K2p/xH8AMw1Mr/vdyK0jG6bwQu6vLauDGtpWDq KMi6R7GnDqznjO6dw4k88JYxWSFFEw02uxRcyaaCy7lvCm7vqgv0GB2ZXyxMrMgA+mRW Hz/fE5kn8SFhSOkbxM3yp8WB8tGyo0phs5t2+pnMmvxdn3SN9kYgfAY0df81F3Ac9btM L7/Ac6Tlgsg1oZh0Lh0cJOW00sZNksUOqFeS4UM2oLEstVmxhiQsi8UU98NCe2d6yj9h ODBNbbCMrL39+ICfPns2sOHI6e9HVOKXZji7LUEzNb+iJesIP8v89RDkcDh+JdZoeipO 27oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=/rPWHAUFOQBMrO2Xjc5W6KvT/KMhO6B9RHdffApwEf0=; b=s6DzJ0tjdchKFSXDNdaNMPCzPpjmSIfCYlFYxZihq9fG3YkConmbHZW5cxTadedDMx OGTD1qRN5+KqAHyieXkJAYBQ+TWnCtf9Haof9g4+EJD/lZ4e4c2ke+ww5ljcccxpYgoe Y6XkTUh6JVwSFTCJLfEHtWB2odCKCwhUObHAJCf7Pe7Ax48ej2O0DopMck3yx3AQJDlf 5YHDSAa4bkFA0pJKS/0OKIz0ouEszAQRzBguvjEIkwefUsXj5b8DDXRvVD+G7G2gDhUB lsnp7Y05FyxZ0YWsYSaX9XAClfoVFEeafwVc9BVNv0qi5hK7TuaxP2YK/BLtLjWVxjg9 /DcA== X-Gm-Message-State: ALKqPwfFEMSswopXp2n3xFZ0MJn6vBGs4eqDkfX5CtjOSfjmmEVJVtXS G7xK/eKhwMsx6PWfAdqNDE5+Dpw5DqnpXsP7Leo= X-Received: by 2002:a6b:268b:: with SMTP id m133-v6mr7242901iom.107.1526580279095; Thu, 17 May 2018 11:04:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:a157:0:0:0:0:0 with HTTP; Thu, 17 May 2018 11:04:38 -0700 (PDT) From: Kyungtae Kim Date: Thu, 17 May 2018 14:04:38 -0400 Message-ID: Subject: KASAN: use-after-free Read in vgacon_invert_region To: b.zolnierkie@samsung.com Cc: Byoungyoung Lee , DaeRyong Jeong , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We report the crash: "KASAN: use-after-free Read in vgacon_invert_region" This crash was found in v4.17-rc3. Specifically, memory access (read operation) is invalid, and it is detected by KASAN. C repro code: https://kiwi.cs.purdue.edu/static/alexkkid-fuzzer/repro-ba6c1.c kernel config: https://kiwi.cs.purdue.edu/static/alexkkid-fuzzer/kernel-config-v4.17-rc3 Crash log: ============================================================== BUG: KASAN: use-after-free in vgacon_invert_region+0xf9/0x100 drivers/video/console/vgacon.c:663 Read of size 2 at addr ffff880000100000 by task syz-executor3/525 CPU: 0 PID: 525 Comm: syz-executor3 Not tainted 4.17.0-rc3 #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xc7/0x138 lib/dump_stack.c:113 print_address_description+0x78/0x290 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x234/0x350 mm/kasan/report.c:412 __asan_report_load2_noabort+0x19/0x20 mm/kasan/report.c:431 vgacon_invert_region+0xf9/0x100 drivers/video/console/vgacon.c:663 invert_screen+0x197/0x630 drivers/tty/vt/vt.c:461 highlight drivers/tty/vt/selection.c:51 [inline] set_selection+0x6b7/0xf60 drivers/tty/vt/selection.c:276 tioclinux+0x126/0x410 drivers/tty/vt/vt.c:2691 vt_ioctl+0x1036/0x2580 drivers/tty/vt/vt_ioctl.c:362 tty_ioctl+0x288/0x14c0 drivers/tty/tty_io.c:2646 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x191/0xfe0 fs/ioctl.c:686 ksys_ioctl+0x99/0xb0 fs/ioctl.c:701 __do_sys_ioctl fs/ioctl.c:708 [inline] __se_sys_ioctl fs/ioctl.c:706 [inline] __x64_sys_ioctl+0x78/0xb0 fs/ioctl.c:706 do_syscall_64+0xb0/0x460 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4497b9 RSP: 002b:00007f720c4bec68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f720c4bf6cc RCX: 00000000004497b9 RDX: 0000000020000040 RSI: 000200000000541c RDI: 0000000000000013 RBP: 000000000071bf58 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000005aa8 R14: 00000000006ecb48 R15: 00007f720c4bf700 The buggy address belongs to the page: page:ffffea0000004000 count:0 mapcount:-127 mapping:0000000000000000 index:0x0 flags: 0x0() raw: 0000000000000000 0000000000000000 0000000000000000 00000000ffffff80 raw: ffff88013fff9300 ffff88013fff9300 0000000000000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8800000fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8800000fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff880000100000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff880000100080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff880000100100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ============================================================== Thanks, Kyungtae Kim