+12
−11
+5
−10
Loading
stable inclusion from stable-v6.6.60 commit 77ddc732416b017180893cbb2356e9f0a414c575 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB44K1 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=77ddc732416b017180893cbb2356e9f0a414c575 -------------------------------- [ Upstream commit dc60992ce76fbc2f71c2674f435ff6bde2108028 ] When the main loop in xfs_filestream_pick_ag fails to find a suitable AG it tries to just pick the online AG. But the loop for that uses args->pag as loop iterator while the later code expects pag to be set. Fix this by reusing the max_pag case for this last resort, and also add a check for impossible case of no AG just to make sure that the uninitialized pag doesn't even escape in theory. Reported-by:<syzbot+4125a3c514e3436a02e6@syzkaller.appspotmail.com> Signed-off-by:
Christoph Hellwig <hch@lst.de> Tested-by:
<syzbot+4125a3c514e3436a02e6@syzkaller.appspotmail.com> Fixes: f8f1ed1a ("xfs: return a referenced perag from filestreams allocator") Cc: <stable@vger.kernel.org> # v6.3 Reviewed-by:
Darrick J. Wong <djwong@kernel.org> Signed-off-by:
Carlos Maiolino <cem@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Wen Zhiwei <wenzhiwei@kylinos.cn>