bisecting fixing commit since 2762b48e9611529239da2e68cba908dbbec9805f building syzkaller on d4f4eca56fbea6f58a4d5adfd19cb5e0dc32fe46 testing commit 2762b48e9611529239da2e68cba908dbbec9805f with gcc (GCC) 8.4.1 20210217 kernel signature: 406d32a526a65b630f9080056ba7363a09d467d25ff74652dcbd68c141e5e86d all runs: crashed: WARNING in ext4_xattr_set_entry testing current HEAD bd634aa6416382439890b78f7be0023020a86207 testing commit bd634aa6416382439890b78f7be0023020a86207 with gcc (GCC) 8.4.1 20210217 kernel signature: 2f612936ecd9e94307951db2e7a01e695b0785d5278d7a8172175439bd5c3de7 all runs: OK # git bisect start bd634aa6416382439890b78f7be0023020a86207 2762b48e9611529239da2e68cba908dbbec9805f Bisecting: 336 revisions left to test after this (roughly 8 steps) [c15587fc621ee1a574222dc4d793d5611127a4f5] perf test: Fix unaligned access in sample parsing test testing commit c15587fc621ee1a574222dc4d793d5611127a4f5 with gcc (GCC) 8.4.1 20210217 kernel signature: 286d556dfcf3e4f61bb845554e614bfac3ccf68768becfdbaddaa458059035ed all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good c15587fc621ee1a574222dc4d793d5611127a4f5 Bisecting: 168 revisions left to test after this (roughly 7 steps) [75593df99b8af54a2028e14da1584a5d748deec2] net: phy: fix save wrong speed and duplex problem if autoneg is on testing commit 75593df99b8af54a2028e14da1584a5d748deec2 with gcc (GCC) 8.4.1 20210217 kernel signature: a9899f6c074eeb4f555ab3629fb9b9da476b7efc705e09e8415283f8e77645dc all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 75593df99b8af54a2028e14da1584a5d748deec2 Bisecting: 84 revisions left to test after this (roughly 6 steps) [a1507d7f825dd45758f569c340a3b2fc7bfb5220] sunrpc: fix refcount leak for rpc auth modules testing commit a1507d7f825dd45758f569c340a3b2fc7bfb5220 with gcc (GCC) 8.4.1 20210217 kernel signature: 2fc32ad41fb5d5f79e84e11558906687aacd818d9aaedd503d1b028bad912c3b all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good a1507d7f825dd45758f569c340a3b2fc7bfb5220 Bisecting: 42 revisions left to test after this (roughly 5 steps) [352e23b69d39ac5c3b02fde5d088521eaefbf94d] drm/radeon: fix AGP dependency testing commit 352e23b69d39ac5c3b02fde5d088521eaefbf94d with gcc (GCC) 8.4.1 20210217 kernel signature: 1f19fb47c1acf88a1d91c5e6fe6e3a4fd975f7ccb8f58d5ab7b61e9a93a654bb all runs: OK # git bisect bad 352e23b69d39ac5c3b02fde5d088521eaefbf94d Bisecting: 20 revisions left to test after this (roughly 4 steps) [470f69cb3742e4c774ff2c89f6dbc691ba702926] ext4: do not try to set xattr into ea_inode if value is empty testing commit 470f69cb3742e4c774ff2c89f6dbc691ba702926 with gcc (GCC) 8.4.1 20210217 kernel signature: b523f19d13a7726a285057962254d35e43249cdab3db86072e9f50aebbebd321 all runs: OK # git bisect bad 470f69cb3742e4c774ff2c89f6dbc691ba702926 Bisecting: 10 revisions left to test after this (roughly 3 steps) [7ffb3fa5b774a8931a86b7ee047387329eaf95d9] iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler testing commit 7ffb3fa5b774a8931a86b7ee047387329eaf95d9 with gcc (GCC) 8.4.1 20210217 kernel signature: 45c30f39f0df1f271c6bd288c0e567c86ad7aeb34aacb2b9224a7728f3a2f87e all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 7ffb3fa5b774a8931a86b7ee047387329eaf95d9 Bisecting: 5 revisions left to test after this (roughly 3 steps) [403fdabcc1bcd0d31f9fcb9b9b2e831214ab2192] perf/x86/intel: Fix a crash caused by zero PEBS status testing commit 403fdabcc1bcd0d31f9fcb9b9b2e831214ab2192 with gcc (GCC) 8.4.1 20210217 kernel signature: 3408571047145c9054b9db82731f0951cd3c46f706c22a89a40d4c6815a0a9ea all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 403fdabcc1bcd0d31f9fcb9b9b2e831214ab2192 Bisecting: 2 revisions left to test after this (roughly 2 steps) [400e3df46a76dd8f301677daddf4c761b9248ff7] x86: Move TS_COMPAT back to asm/thread_info.h testing commit 400e3df46a76dd8f301677daddf4c761b9248ff7 with gcc (GCC) 8.4.1 20210217 kernel signature: 2392728766bfa1c2b67697e409e3a6677c18ed3a194ab339d1eafbbfc6812b4f all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 400e3df46a76dd8f301677daddf4c761b9248ff7 Bisecting: 0 revisions left to test after this (roughly 1 step) [1b46d1d9d02e529f6f2856795d8bae1669253a39] ext4: find old entry again if failed to rename whiteout testing commit 1b46d1d9d02e529f6f2856795d8bae1669253a39 with gcc (GCC) 8.4.1 20210217 kernel signature: ab684f842089713e77e29de7a49f9f36775fcd3bc159f6aa3ad5b17a4a94f828 all runs: crashed: WARNING in ext4_xattr_set_entry # git bisect good 1b46d1d9d02e529f6f2856795d8bae1669253a39 470f69cb3742e4c774ff2c89f6dbc691ba702926 is the first bad commit commit 470f69cb3742e4c774ff2c89f6dbc691ba702926 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: b523f19d13a7726a285057962254d35e43249cdab3db86072e9f50aebbebd321 parent signature: ab684f842089713e77e29de7a49f9f36775fcd3bc159f6aa3ad5b17a4a94f828 revisions tested: 11, total time: 2h8m51.961720118s (build: 1h20m5.784405271s, test: 47m54.086848699s) first good commit: 470f69cb3742e4c774ff2c89f6dbc691ba702926 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): []