Ye Bin
fae381a3d7
ext4: init quota for 'old.inode' in 'ext4_rename'
...
Syzbot found the following issue:
ext4_parse_param: s_want_extra_isize=128
ext4_inode_info_init: s_want_extra_isize=32
ext4_rename: old.inode=ffff88823869a2c8 old.dir=ffff888238699828 new.inode=ffff88823869d7e8 new.dir=ffff888238699828
__ext4_mark_inode_dirty: inode=ffff888238699828 ea_isize=32 want_ea_size=128
__ext4_mark_inode_dirty: inode=ffff88823869a2c8 ea_isize=32 want_ea_size=128
ext4_xattr_block_set: inode=ffff88823869a2c8
------------[ cut here ]------------
WARNING: CPU: 13 PID: 2234 at fs/ext4/xattr.c:2070 ext4_xattr_block_set.cold+0x22/0x980
Modules linked in:
RIP: 0010:ext4_xattr_block_set.cold+0x22/0x980
RSP: 0018:ffff888227d3f3b0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffff88823007a000 RCX: 0000000000000000
RDX: 0000000000000a03 RSI: 0000000000000040 RDI: ffff888230078178
RBP: 0000000000000000 R08: 000000000000002c R09: ffffed1075c7df8e
R10: ffff8883ae3efc6b R11: ffffed1075c7df8d R12: 0000000000000000
R13: ffff88823869a2c8 R14: ffff8881012e0460 R15: dffffc0000000000
FS: 00007f350ac1f740(0000) GS:ffff8883ae200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f350a6ed6a0 CR3: 0000000237456000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
? ext4_xattr_set_entry+0x3b7/0x2320
? ext4_xattr_block_set+0x0/0x2020
? ext4_xattr_set_entry+0x0/0x2320
? ext4_xattr_check_entries+0x77/0x310
? ext4_xattr_ibody_set+0x23b/0x340
ext4_xattr_move_to_block+0x594/0x720
ext4_expand_extra_isize_ea+0x59a/0x10f0
__ext4_expand_extra_isize+0x278/0x3f0
__ext4_mark_inode_dirty.cold+0x347/0x410
ext4_rename+0xed3/0x174f
vfs_rename+0x13a7/0x2510
do_renameat2+0x55d/0x920
__x64_sys_rename+0x7d/0xb0
do_syscall_64+0x3b/0xa0
entry_SYSCALL_64_after_hwframe+0x72/0xdc
As 'ext4_rename' will modify 'old.inode' ctime and mark inode dirty,
which may trigger expand 'extra_isize' and allocate block. If inode
didn't init quota will lead to warning. To solve above issue, init
'old.inode' firstly in 'ext4_rename'.
Reported-by: syzbot+98346927678ac3059c77@syzkaller.appspotmail.com
Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20221107015335.2524319-1-yebin@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
2022-12-08 21:49:24 -05:00
..
2022-07-02 18:52:21 +09:00
2022-05-09 16:21:44 -04:00
2022-08-19 13:03:10 +02:00
2022-10-06 17:13:18 -07:00
2022-07-17 17:31:42 -07:00
2022-08-02 12:34:03 -04:00
2022-05-09 16:21:44 -04:00
2022-11-03 11:12:48 -07:00
2022-09-24 07:00:00 +02:00
2022-10-16 15:27:07 -07:00
2022-11-04 23:36:54 -05:00
2022-08-02 12:34:03 -04:00
2022-08-02 12:34:02 -04:00
2022-10-19 20:54:43 -07:00
2022-09-24 15:00:48 +02:00
2022-10-04 13:38:03 -07:00
2022-10-06 17:31:02 -07:00
2022-10-21 11:09:40 +02:00
2022-05-09 16:21:45 -04:00
2022-10-17 14:57:57 +08:00
2022-10-11 17:42:58 -06:00
2022-08-17 17:25:04 -04:00
2022-10-11 17:42:58 -06:00
2022-12-08 21:49:24 -05:00
2022-10-16 15:27:07 -07:00
2022-10-11 17:42:58 -06:00
2022-08-02 12:34:03 -04:00
2022-08-09 14:13:59 +01:00
2022-10-28 14:25:20 +02:00
2022-10-10 20:13:22 -07:00
2022-09-11 21:55:09 -07:00
2022-09-11 21:55:05 -07:00
2022-09-19 22:46:25 +02:00
2022-05-09 16:21:45 -04:00
2022-10-10 19:45:17 -07:00
2022-10-02 11:42:19 -07:00
2022-10-12 11:00:22 -07:00
2022-10-10 17:53:04 -07:00
2022-09-21 10:38:07 +02:00
2022-08-03 10:35:43 -07:00
2022-09-24 13:52:27 +02:00
2022-10-07 08:19:26 -07:00
2022-09-26 14:02:42 -04:00
2022-09-24 07:00:00 +02:00
2022-07-14 10:10:12 +02:00
2022-10-27 15:52:11 -04:00
2022-11-01 15:05:03 -07:00
2022-10-12 11:16:58 -07:00
2022-10-07 08:28:50 -07:00
2022-10-12 11:00:22 -07:00
2022-10-11 17:42:58 -06:00
2022-10-20 21:27:22 -07:00
2022-05-09 16:21:44 -04:00
2022-03-22 15:57:03 -07:00
2022-10-13 09:56:14 -07:00
2022-10-10 19:45:17 -07:00
2022-10-20 21:27:23 -07:00
2022-09-30 08:16:06 -07:00
2022-05-09 16:21:44 -04:00
2022-09-11 21:55:07 -07:00
2022-12-08 21:49:23 -05:00
2022-10-10 19:45:17 -07:00
2022-10-12 11:00:22 -07:00
2022-05-09 16:21:46 -04:00
2022-10-05 01:55:27 -05:00
2022-10-28 13:37:21 -07:00
2022-04-05 15:39:19 +02:00
2022-05-27 11:22:03 -07:00
2022-09-08 17:10:54 -04:00
2022-10-16 15:27:07 -07:00
2022-10-10 19:45:17 -07:00
2022-09-11 20:26:07 -07:00
2022-05-09 16:21:46 -04:00
2022-10-06 17:36:48 -07:00
2022-10-31 08:58:22 -07:00
2022-08-11 13:11:49 -07:00
2022-09-11 21:55:08 -07:00
2022-08-20 11:34:04 -04:00
2022-08-08 10:39:29 -07:00
2022-09-24 07:00:00 +02:00
2022-10-25 15:11:21 -07:00
2022-04-22 10:57:18 -07:00
2022-10-12 11:00:22 -07:00
2022-10-10 17:53:04 -07:00
2022-08-20 11:34:33 -04:00
2022-09-24 18:14:12 -07:00
2022-10-10 19:45:17 -07:00
2022-09-20 08:24:38 -06:00
2022-09-21 10:30:42 -06:00
2022-09-11 21:55:07 -07:00
2022-10-29 17:49:33 -07:00
2022-06-10 16:10:23 -04:00
2022-09-01 17:36:39 -04:00
2022-08-16 10:59:54 -04:00
2022-06-29 13:07:16 +02:00
2022-12-01 10:46:54 -05:00
2022-11-22 17:00:00 -05:00
2022-05-19 23:25:10 -04:00
2022-10-06 16:49:00 -07:00
2022-10-06 17:31:02 -07:00
2022-04-01 19:35:56 -07:00
2022-09-11 20:26:10 -07:00
2022-10-10 14:21:11 -07:00
2022-06-16 19:58:21 -07:00
2022-10-03 14:21:43 -07:00
2022-08-17 15:08:58 -04:00
2022-09-27 07:11:02 -07:00
2022-09-30 23:46:52 -04:00
2022-07-05 16:18:21 -04:00
2022-08-03 10:35:43 -07:00
2022-10-10 19:45:17 -07:00
2022-08-17 11:27:11 +02:00
2022-08-20 11:34:04 -04:00
2022-10-06 17:13:18 -07:00
2022-08-20 11:34:04 -04:00
2022-10-10 17:53:04 -07:00
2022-06-28 13:58:05 -04:00
2022-09-28 14:28:40 -04:00
2022-08-17 17:25:04 -04:00
2022-08-05 16:32:45 -07:00
2022-05-22 21:03:01 +01:00
2022-08-08 22:37:23 -04:00
2022-09-11 19:47:12 -05:00
2022-10-19 20:54:43 -07:00
2022-04-26 13:36:25 -07:00
2022-10-10 17:53:04 -07:00
2022-09-21 12:01:29 +02:00