bisecting fixing commit since c4ff839de17f38b0ae0f8983b5c5186f8a389238 building syzkaller on 7df34f59bca2c74f1dfa5c198b94577cf918cbb2 testing commit c4ff839de17f38b0ae0f8983b5c5186f8a389238 with gcc (GCC) 8.4.1 20210217 kernel signature: 9649f8e70ec1c0197dd6bc1924eb35273a781cdf78fb2d77f75e30e633be7b65 all runs: crashed: WARNING in ext4_xattr_set_entry testing current HEAD 2034d6f0838e465dd8f120c4e946d8444b4bb5df testing commit 2034d6f0838e465dd8f120c4e946d8444b4bb5df with gcc (GCC) 8.4.1 20210217 kernel signature: 3287cf391fd185c745190fb715d254ad9866606bf3edf5a773ece4b83ba950b3 all runs: OK # git bisect start 2034d6f0838e465dd8f120c4e946d8444b4bb5df c4ff839de17f38b0ae0f8983b5c5186f8a389238 Bisecting: 394 revisions left to test after this (roughly 9 steps) [1167ca53dad823a5abe758232015c4a14e9ee4e1] tpm_tis: Clean up locality release testing commit 1167ca53dad823a5abe758232015c4a14e9ee4e1 with gcc (GCC) 8.4.1 20210217 kernel signature: 2f1b94e0bb1197f2148546dd2f780a61214029cce672af387a44bda9be72afd9 all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 1167ca53dad823a5abe758232015c4a14e9ee4e1 Bisecting: 197 revisions left to test after this (roughly 8 steps) [a882f473dece02f77e621cdd54e06e07f310e0c5] sparc64: Use arch_validate_flags() to validate ADI flag testing commit a882f473dece02f77e621cdd54e06e07f310e0c5 with gcc (GCC) 8.4.1 20210217 kernel signature: c2696f6b414dab4bfb4d68d6952858454a247a1c99046b8464398229fded68d9 all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good a882f473dece02f77e621cdd54e06e07f310e0c5 Bisecting: 98 revisions left to test after this (roughly 7 steps) [5d9873e46c6d5a3c358341e40c373b79677f14e2] nvme-rdma: fix possible hang when failing to set io queues testing commit 5d9873e46c6d5a3c358341e40c373b79677f14e2 with gcc (GCC) 8.4.1 20210217 kernel signature: 8dc6d3015288f90a896300fa87ee151e46eaa99693a028ead1011d9a2453c348 all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 5d9873e46c6d5a3c358341e40c373b79677f14e2 Bisecting: 49 revisions left to test after this (roughly 6 steps) [7b7437d4889c40e932f14893f16415df846dcbca] netsec: restore phy power state after controller reset testing commit 7b7437d4889c40e932f14893f16415df846dcbca with gcc (GCC) 8.4.1 20210217 kernel signature: f94411a052b610a2e535a0d8ab3a462371071694697a8d6361b8c5bfb0ecfddd all runs: OK # git bisect bad 7b7437d4889c40e932f14893f16415df846dcbca Bisecting: 24 revisions left to test after this (roughly 5 steps) [b0834edc70e402244ed8da96664368c15d869582] cifs: Fix preauth hash corruption testing commit b0834edc70e402244ed8da96664368c15d869582 with gcc (GCC) 8.4.1 20210217 kernel signature: a396f8cdd9195a422ac7e3c09448d785774d691a2b1019034cfc3c90f940c715 all runs: OK # git bisect bad b0834edc70e402244ed8da96664368c15d869582 Bisecting: 11 revisions left to test after this (roughly 4 steps) [c230ae35740eaa031fd25aa543b25d325378f9da] iio: hid-sensor-temperature: Fix issues of timestamp channel testing commit c230ae35740eaa031fd25aa543b25d325378f9da with gcc (GCC) 8.4.1 20210217 kernel signature: 42734e2b91e87a7292f74cbde26434ec26731e4b85e74de49a12855106859192 all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good c230ae35740eaa031fd25aa543b25d325378f9da Bisecting: 5 revisions left to test after this (roughly 3 steps) [1454a47fb97adcf17535316481f70d43c8e4f500] x86: Introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall() testing commit 1454a47fb97adcf17535316481f70d43c8e4f500 with gcc (GCC) 8.4.1 20210217 kernel signature: 97feba1e8273464b86e33a4a248221d8fd4205e2106463f69609f51e4ff4e477 all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 1454a47fb97adcf17535316481f70d43c8e4f500 Bisecting: 2 revisions left to test after this (roughly 2 steps) [1b59600cd8ac90cf259f59f89a2b2d5efcd9eb7c] ext4: fix potential error in ext4_do_update_inode testing commit 1b59600cd8ac90cf259f59f89a2b2d5efcd9eb7c with gcc (GCC) 8.4.1 20210217 kernel signature: d3382c051f70551f54fad4f2bd2e4478fa21b6e5d0b3759ec1b22e0fc77bef8f all runs: OK # git bisect bad 1b59600cd8ac90cf259f59f89a2b2d5efcd9eb7c Bisecting: 0 revisions left to test after this (roughly 1 step) [a8fb57ec924feec102d477c34a1e21685ff865e9] ext4: do not try to set xattr into ea_inode if value is empty testing commit a8fb57ec924feec102d477c34a1e21685ff865e9 with gcc (GCC) 8.4.1 20210217 kernel signature: d1b375991f53803f27a3ba0bbc3d6d1ad8c9a36a839b93f0f2d9504526ff1bb8 all runs: OK # git bisect bad a8fb57ec924feec102d477c34a1e21685ff865e9 Bisecting: 0 revisions left to test after this (roughly 0 steps) [5cdacb4181694713d849f80890bc8cb66143d99d] ext4: find old entry again if failed to rename whiteout testing commit 5cdacb4181694713d849f80890bc8cb66143d99d with gcc (GCC) 8.4.1 20210217 kernel signature: 57841e5050966fd332ae7e472e350baeaec3b0385861abdbdfddca837a57a5c7 all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 5cdacb4181694713d849f80890bc8cb66143d99d a8fb57ec924feec102d477c34a1e21685ff865e9 is the first bad commit commit a8fb57ec924feec102d477c34a1e21685ff865e9 Author: zhangyi (F) Date: Fri Mar 5 20:05:08 2021 +0800 ext4: do not try to set xattr into ea_inode if value is empty commit 6b22489911b726eebbf169caee52fea52013fbdd upstream. Syzbot report a warning that ext4 may create an empty ea_inode if set an empty extent attribute to a file on the file system which is no free blocks left. WARNING: CPU: 6 PID: 10667 at fs/ext4/xattr.c:1640 ext4_xattr_set_entry+0x10f8/0x1114 fs/ext4/xattr.c:1640 ... Call trace: ext4_xattr_set_entry+0x10f8/0x1114 fs/ext4/xattr.c:1640 ext4_xattr_block_set+0x1d0/0x1b1c fs/ext4/xattr.c:1942 ext4_xattr_set_handle+0x8a0/0xf1c fs/ext4/xattr.c:2390 ext4_xattr_set+0x120/0x1f0 fs/ext4/xattr.c:2491 ext4_xattr_trusted_set+0x48/0x5c fs/ext4/xattr_trusted.c:37 __vfs_setxattr+0x208/0x23c fs/xattr.c:177 ... Now, ext4 try to store extent attribute into an external inode if ext4_xattr_block_set() return -ENOSPC, but for the case of store an empty extent attribute, store the extent entry into the extent attribute block is enough. A simple reproduce below. fallocate test.img -l 1M mkfs.ext4 -F -b 2048 -O ea_inode test.img mount test.img /mnt dd if=/dev/zero of=/mnt/foo bs=2048 count=500 setfattr -n "user.test" /mnt/foo Reported-by: syzbot+98b881fdd8ebf45ab4ae@syzkaller.appspotmail.com Fixes: 9c6e7853c531 ("ext4: reserve space for xattr entries/names") Cc: stable@kernel.org Signed-off-by: zhangyi (F) Link: https://lore.kernel.org/r/20210305120508.298465-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman fs/ext4/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) culprit signature: d1b375991f53803f27a3ba0bbc3d6d1ad8c9a36a839b93f0f2d9504526ff1bb8 parent signature: 57841e5050966fd332ae7e472e350baeaec3b0385861abdbdfddca837a57a5c7 revisions tested: 12, total time: 2h40m48.578380139s (build: 1h34m39.141508767s, test: 1h5m11.112018111s) first good commit: a8fb57ec924feec102d477c34a1e21685ff865e9 ext4: do not try to set xattr into ea_inode if value is empty recipients (to): ["gregkh@linuxfoundation.org" "tytso@mit.edu" "yi.zhang@huawei.com"] recipients (cc): []