Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp746648imu; Wed, 16 Jan 2019 07:00:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN6hru6pZMPw6GGyYCKlulblI570N9kzsLYcG5vVu3rKOCwxFoaiYxVBDUQ9kInmHRtUSJYR X-Received: by 2002:a65:50c1:: with SMTP id s1mr9016149pgp.350.1547650825422; Wed, 16 Jan 2019 07:00:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547650825; cv=none; d=google.com; s=arc-20160816; b=B15SZM1MER9j1QT1W1qxjVBNiRFJCxm+37Bg997G6M3hCpySUVjBHHje6VP7gDSlSK V/0+JrV9IZzboWSdvMX2TGOtC+MSR1tAvqU/5NjQ9fIRu9uEYPoqcQ0iMRYeOcLA7dEL I8tvQSulKBlQG+mZvcz2RQAe01hAyDx61LhLA0lPOZCj6h1YO0av+N8LiVOREvd0wax0 PiZRSo3U6MkfwyCS2KWNqCmsa8PMRSkdMZg8Rq4fMwNUBFNaJ509/2mzZCI4B1IFILEX zO1xNk+6+hGA1Nu4UpFZsER7Lcpeud9lZBOnyMKvfFCWeTyibA3R5ozoQTdA7QaJ5cH2 zjLA== 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; bh=iR2ByECA/bbnX5KUprJV3Dyc8DZlZ+AXTN6R/ayDlrI=; b=s6gTMBfHjKMTXq4HxgjVro5bRgm8mWQObdXyhislHatErIyWYSPH4n1dy8GCHLoUR0 HaxxDn6O3pUMXXmWlGFEUbq3Zpmh4kS9RHsnb2faVG5pYNo+b0ZZBWJlSj+fBBWMRc0u lA5N94rf40ELTTvsL82okwDsITSnFkjlJ/H+5U/w1SJJMtVMvEYUsk8xKpnl0w8gZ2h6 hAqFBPlWTDCQVvTnNfXJwL30SvkiZWMBvxOmTSpnwt32ELN1/ZXxbD7B61n/EX7Dq0kZ mzqFOuSNs3aPbjguYhp6xwGjX3KYhpvlpMMqyzCEroOutqW5gZJL0o0VccRlHLFv+Hwv 7Uzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LYgcVZN6; 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 l10si6834560pls.162.2019.01.16.07.00.07; Wed, 16 Jan 2019 07:00:25 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LYgcVZN6; 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 S2388041AbfAOWZw (ORCPT + 99 others); Tue, 15 Jan 2019 17:25:52 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:36981 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727036AbfAOWZw (ORCPT ); Tue, 15 Jan 2019 17:25:52 -0500 Received: by mail-it1-f193.google.com with SMTP id b5so92897iti.2 for ; Tue, 15 Jan 2019 14:25:51 -0800 (PST) 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=iR2ByECA/bbnX5KUprJV3Dyc8DZlZ+AXTN6R/ayDlrI=; b=LYgcVZN6nPZLEWsnBYxY75oCWkENxMVB/0cvWm5XrH9zbXn8+P9sdr8oyLYRu/3+dp 0/x2cFCJSJOEy3PTKSyu8P3XkbjdwaPTmKMucDEXEWrS0IqFBdRbMFz/CI+RtrL1bhaE HjLbWIfJJk69IoSmc3GDfse6GgDhBi0qVl2FLg+qQbs9YRXfw+tLrCwYJpN5hDu6T9iZ U4wjYW1LwSL1iRTwuDgTBzrjHvjkp4wSML729i+CkZZq7sPJfqRj9eJaIhnOoPFKV29a N6TzsCYPKdY0ZWuv1w2NBa4nIob0LMqLSyMokQGL1pOFyLrHEhz7GM67tCKHgL7Gj2eI Q8WA== 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=iR2ByECA/bbnX5KUprJV3Dyc8DZlZ+AXTN6R/ayDlrI=; b=mluvxjJVoTHE58lV43EGPoITBBr5fw3MpBG+DWnzaus/imn5wkNq0cBFYN1hdI7aZt BNP+j9roTynPZUd87+RkOh1uq3sVKjglwb1S4kXPsVrKQMz+ptBHqeoXx8aCaDxtqSiN ArQ5JuvQkG9aXuipIlvo4EDFysoQ/m+80upTzfWnPj8Vy8qNJKCU+PKZ9lKy5iWe338b p2+fcxrxFTjRWVGBO26NNrBA7RXE0l8lGnkD1o1Q6xbTe4FHI2ZR+qWMyuhI6mnk0Zms sMNt/zEqBhlUJzMjeBaB+2WEk0dvnmqHAfkcvykSBKsaWQC0dbtCx6eXnTg2s1RHMI/V mZ5g== X-Gm-Message-State: AJcUukfkTlTQb7Lq7qxivEwC6zsg0CZD0SCqxoaEfvxllk3XRHlqa4NC F13+6srLy3x009tOidofkcu5XFROtNk8xFZZnNU= X-Received: by 2002:a24:c705:: with SMTP id t5mr3810156itg.60.1547591150972; Tue, 15 Jan 2019 14:25:50 -0800 (PST) MIME-Version: 1.0 From: Kyungtae Kim Date: Tue, 15 Jan 2019 17:25:39 -0500 Message-ID: Subject: UBSAN: Undefined behaviour in fs/f2fs/extent_cache.c To: jaegeuk@kernel.org, yuchao0@huawei.com Cc: Byoungyoung Lee , DaeRyong Jeong , syzkaller@googlegroups.com, linux-f2fs-devel@lists.sourceforge.net, 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 We report a bug in linux-4.20.2: "UBSAN: Undefined behaviour in fs/f2fs/extent_cache.c" kernel config: https://kt0755.github.io/etc/config_v4.20_stable repro: https://kt0755.github.io/etc/repro.4a3e7.c (f2fs is mounted on /mnt/f2fs/) This arose in f2fs_update_extent_tree_range (fs/f2fs/extent_cache.c:605). It seems that, for some reason, its last argument became "24" although that was supposed to be bool type. ========================================= UBSAN: Undefined behaviour in fs/f2fs/extent_cache.c:605:4 load of value 24 is not a valid value for type '_Bool' CPU: 0 PID: 6774 Comm: syz-executor5 Not tainted 4.20.2 #1 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+0xb1/0x118 lib/dump_stack.c:113 ubsan_epilogue+0x12/0x94 lib/ubsan.c:159 __ubsan_handle_load_invalid_value+0x17a/0x1be lib/ubsan.c:457 f2fs_update_extent_tree_range+0x1d4a/0x1d50 fs/f2fs/extent_cache.c:605 f2fs_update_extent_cache+0x2b6/0x350 fs/f2fs/extent_cache.c:804 f2fs_update_data_blkaddr+0x61/0x70 fs/f2fs/data.c:656 f2fs_outplace_write_data+0x1d6/0x4b0 fs/f2fs/segment.c:3140 f2fs_convert_inline_page+0x86d/0x2060 fs/f2fs/inline.c:163 f2fs_convert_inline_inode+0x6b5/0xad0 fs/f2fs/inline.c:208 f2fs_preallocate_blocks+0x78b/0xb00 fs/f2fs/data.c:982 f2fs_file_write_iter+0x31b/0xf40 fs/f2fs/file.c:3062 call_write_iter include/linux/fs.h:1857 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x538/0x6e0 fs/read_write.c:487 vfs_write+0x1b3/0x520 fs/read_write.c:549 ksys_write+0xde/0x1c0 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+0x7e/0xc0 fs/read_write.c:607 do_syscall_64+0xbe/0x4f0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4497b9 Code: e8 8c 9f 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 9b 6b fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1ea15edc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f1ea15ee6cc RCX: 00000000004497b9 RDX: 0000000000001000 RSI: 0000000020000140 RDI: 0000000000000013 RBP: 000000000071bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000bb50 R14: 00000000006f4bf0 R15: 00007f1ea15ee700 ========================================= Thanks, Kyungtae Kim