erofs-utils: xattr: fix OOB access due to alignment

erofs_buf_write_bhops can only be safely used for block-aligned
buffers, otherwise, it could write random out-of-bound data due
to buffer alignment. Such random data is meaningless but it does
harm to reproducable builds.

Fixes: 116ac0a254fc ("erofs-utils: introduce shared xattr support")
Reported-by: Huang Jianan <>
Reviewed-by: Li Guifu <>
Signed-off-by: Gao Xiang <>
1 file changed