acrn-kernel/fs/ocfs2
Joseph Qi de19433423 ocfs2: fix crash when mount with quota enabled
There is a reported crash when mounting ocfs2 with quota enabled.

  RIP: 0010:ocfs2_qinfo_lock_res_init+0x44/0x50 [ocfs2]
  Call Trace:
    ocfs2_local_read_info+0xb9/0x6f0 [ocfs2]
    dquot_load_quota_sb+0x216/0x470
    dquot_load_quota_inode+0x85/0x100
    ocfs2_enable_quotas+0xa0/0x1c0 [ocfs2]
    ocfs2_fill_super.cold+0xc8/0x1bf [ocfs2]
    mount_bdev+0x185/0x1b0
    legacy_get_tree+0x27/0x40
    vfs_get_tree+0x25/0xb0
    path_mount+0x465/0xac0
    __x64_sys_mount+0x103/0x140

It is caused by when initializing dqi_gqlock, the corresponding dqi_type
and dqi_sb are not properly initialized.

This issue is introduced by commit 6c85c2c728, which wants to avoid
accessing uninitialized variables in error cases.  So make global quota
info properly initialized.

Link: https://lkml.kernel.org/r/20220323023644.40084-1-joseph.qi@linux.alibaba.com
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1007141
Fixes: 6c85c2c728 ("ocfs2: quota_local: fix possible uninitialized-variable access in ocfs2_local_read_info()")
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reported-by: Dayvison <sathlerds@gmail.com>
Tested-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-04-01 11:46:09 -07:00
..
cluster Merge branch 'akpm' (patches from Andrew) 2022-03-22 16:11:53 -07:00
dlm all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate 2022-01-15 08:47:31 -08:00
dlmfs fs: allocate inode by using alloc_inode_sb() 2022-03-22 15:57:03 -07:00
Kconfig
Makefile
acl.c
acl.h
alloc.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
alloc.h
aops.c Filesystem folio changes for 5.18 2022-03-22 18:26:56 -07:00
aops.h
blockcheck.c
blockcheck.h
buffer_head_io.c
buffer_head_io.h
dcache.c
dcache.h
dir.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
dir.h
dlmglue.c
dlmglue.h
export.c
export.h
extent_map.c
extent_map.h
file.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
file.h
filecheck.c ocfs2: use default_groups in kobj_type 2022-01-15 16:30:24 +02:00
filecheck.h
heartbeat.c
heartbeat.h
inode.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
inode.h
ioctl.c
ioctl.h
journal.c ocfs2: use BUG_ON instead of if condition followed by BUG. 2022-01-15 16:30:24 +02:00
journal.h ocfs2: cleanup journal init and shutdown 2021-11-06 13:30:32 -07:00
localalloc.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
localalloc.h
locks.c
locks.h
mmap.c
mmap.h
move_extents.c
move_extents.h
namei.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
namei.h
ocfs1_fs_compat.h
ocfs2.h fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
ocfs2_fs.h
ocfs2_ioctl.h
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h
quota.h
quota_global.c ocfs2: fix crash when mount with quota enabled 2022-04-01 11:46:09 -07:00
quota_local.c ocfs2: fix crash when mount with quota enabled 2022-04-01 11:46:09 -07:00
refcounttree.c
refcounttree.h
reservations.c
reservations.h
resize.c
resize.h
slot_map.c
slot_map.h
stack_o2cb.c
stack_user.c ocfs2: cleanup some return variables 2022-03-22 15:57:00 -07:00
stackglue.c ocfs2: fix subdirectory registration with register_sysctl() 2022-01-28 18:15:16 +02:00
stackglue.h
suballoc.c ocfs2: fix a deadlock when commit trans 2022-01-30 09:56:58 +02:00
suballoc.h
super.c fs: allocate inode by using alloc_inode_sb() 2022-03-22 15:57:03 -07:00
super.h
symlink.c
symlink.h
sysfile.c
sysfile.h
uptodate.c
uptodate.h
xattr.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
xattr.h