Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1634576imm; Fri, 11 May 2018 20:52:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqpWcKUwalYpeBqTY5C622IHlJLyGkNoF37kOALSdqYjNGHRX5aLH5hBArrPXUCVY9SAhj3 X-Received: by 2002:a63:b007:: with SMTP id h7-v6mr1426644pgf.448.1526097150909; Fri, 11 May 2018 20:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526097150; cv=none; d=google.com; s=arc-20160816; b=L/LN2A5k4OTj3aeWPRr3+dnfJkDE05vXfumdIvMX94F98vbAbq1/G7dPe/TYRbi1+F 79ZAB8M3DggmgbA8DnrLdcj3LPgpC2w9R7KPSTTM4zrSi70yJwwfKwqAkUgIdfneo+wL rSXlKe4akzisSjrFgOmZIYEG4fv9HBm5KzHqyn0dZj2SozIf5BCtkvVPqkreaZT8e04z htsfj0ITH+8ZPFa/cXL+9YfZf+08r8ZM+obh7MvUdbHWfCV9dZ84rZm27e4JBroywqdX XjGO+vxERVlGEO1or3u4z7tWY0nL07hzPIXGp/HYYet6QKKVhEzvpqVCYedAPEVi+3ev J7dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=gTMH3pktmSC+JpAfzyfRPFpLC1E85E9RBJ3HheoxotU=; b=inXiY27wI9LfBAQN5oYIvpe24lhQYIjL80iKLLTAEE7lz0lJ3gOnfwxjNs/jJpnafO xkqvvZwrOGzUz1XGj1TcD9SM7d3/Gqp8YumvLG5IT+pK+RiSGJDp0FY/XixJNj1SHFpW bBi0KHAJwv0IiLVTP2BTJrAmNa+qoGNPP3l0bs0tiQmZjQN3AZRR/5AnnSZ+LRJeuvNl jIDEjI9A2LWOK8jiInjwr+QbAUj000PWsPIpuPgxOGRdoMmtfiMwEaLQvixLgsz5GGPQ EWt+VMUkLiwvmlRG1DRA64hj663uCbvfXnCR5JrQuEkPMaHWhnPzoPIv9qxeI5DaXW++ TrJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IblATgIF; 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 j1-v6si2635762pga.462.2018.05.11.20.52.14; Fri, 11 May 2018 20:52:30 -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=IblATgIF; 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 S1751373AbeELDwE (ORCPT + 99 others); Fri, 11 May 2018 23:52:04 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:41552 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbeELDwD (ORCPT ); Fri, 11 May 2018 23:52:03 -0400 Received: by mail-io0-f177.google.com with SMTP id e12-v6so9235034iob.8 for ; Fri, 11 May 2018 20:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=gTMH3pktmSC+JpAfzyfRPFpLC1E85E9RBJ3HheoxotU=; b=IblATgIFbSn78WhzCLXl2VyAnBrnQOAOU3wCAb2T+sL6m2aE3QBDhKD90SzvB2hF6w npBs+4+mQFdCOSJPeVcFzxicjtNW1tavpFAC3jYNZK2M+eLtq15KyqE+ThMgXrkUn/HM RfG4Sj2/es0NNd2TG1A4FhaK/HI5Qo+3JKextaNx+iA0IxfpHNl6MkRRgtrhVK4x7KKW C6FQHCMHjCsYvL67Po/eANv8nCAmoS5tPMiVke2s4avqm65LOcadjO0NFGeQgtQZvbCf Cmh5tuKNgGRjQovMZj1P+XV66cPapqkhXEVvKFaQHymy236C8z8fj0UuWaGjp0C5YNle EkrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=gTMH3pktmSC+JpAfzyfRPFpLC1E85E9RBJ3HheoxotU=; b=nedYNdy1aLRyUQSOF2TrPL1+300GmAa2lVoQ4cegGbreP81JvKyGMqf3NfYyrSbXIx 0XtMzNtnYp7kP47JYTfLVEKw0sa+z/A/CKH4s+JdrhsbF4IgRKomUL7+rWSrdHb+L1Ys JZGjk1g7EgNLe+tZJeogAgqmZZ9xIR+sO6PfhjdVV/gYdiIzOvURxOzY0bW2iS1GPZ0P yB11b1SpFfisHYW3pC3BU3fnMsX6o46wreu6Nx+OqOl9vfkcW7VjsOxwegUK0aN3Hdzs ut79PPSQ/m5wYhUb8NAE7lQHyORUwoUWYny5GsGP00Xe8yFrreAM7ksV6QWS5e2DmsH0 QfaA== X-Gm-Message-State: ALKqPwek1cb1wjKqX2YB386rN1+NEk5jPfHiyf9NCgM9MYZXIIhuiRK2 ODBF7ZaH/dFKq7xyyB8REO4q/X0KrPpF/0ageZ8= X-Received: by 2002:a6b:8bc8:: with SMTP id n191-v6mr1151986iod.145.1526097122439; Fri, 11 May 2018 20:52:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:a157:0:0:0:0:0 with HTTP; Fri, 11 May 2018 20:52:02 -0700 (PDT) In-Reply-To: References: From: Kyungtae Kim Date: Fri, 11 May 2018 23:52:02 -0400 Message-ID: Subject: Fwd: KASAN: use-after-free Write in write_mem To: linux-kernel@vger.kernel.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 ---------- Forwarded message ---------- From: Kyungtae Kim Date: Fri, May 11, 2018 at 11:38 AM Subject: KASAN: use-after-free Write in write_mem To: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Byoungyoung Lee , DaeLyong Jeong We report the crash: "KASAN: use-after-free Write in write_mem" This crash was found in v4.17-rc3. Specifically, memory access (write operation) is invalid, and it is detected by KASAN. C repro code: https://kiwi.cs.purdue.edu/static/alexkkid-fuzzer/repro-3c6e1.c kernel config: https://kiwi.cs.purdue.edu/static/alexkkid-fuzzer/kernel-config-v4.17-rc3 Crash log: ============================================================ Write of size 4096 at addr ffff880000010000 by task syz-executor1/3358 CPU: 0 PID: 3358 Comm: syz-executor1 Not tainted 4.17.0-rc3 #2 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+0x6a/0x280 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x22f/0x350 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13b/0x1a0 mm/kasan/kasan.c:267 kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278 _copy_from_user+0xb7/0x100 lib/usercopy.c:12 copy_from_user include/linux/uaccess.h:147 [inline] write_mem+0x8f/0x190 drivers/char/mem.c:240 __vfs_write+0x10d/0x610 fs/read_write.c:485 vfs_write+0x187/0x500 fs/read_write.c:549 ksys_write+0xd4/0x1a0 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0xa4/0x460 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4497b9 RSP: 002b:00007f6f7f254c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f6f7f2556cc RCX: 00000000004497b9 RDX: 00000000ffffffad RSI: 0000000020000000 RDI: 0000000000000013 RBP: 000000000071bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000009ee8 R14: 00000000006f0f88 R15: 00007f6f7f255700 The buggy address belongs to the page: page:ffffea0000000400 count:0 mapcount:-127 mapping:0000000000000000 index:0x0 flags: 0x0() raw: 0000000000000000 0000000000000000 0000000000000000 00000000ffffff80 raw: ffff88013fff91e0 ffffea0000002020 0000000000000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88000000ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88000000ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff880000010000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff880000010080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff880000010100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ============================================================ Thanks, Kyungtae Kim