Created attachment 278069 [details] poc.c - Reproduce # mkdir mnt # mount -t xfs 79.img mnt # gcc 79.c # ./a.out ./mnt - Kernel message Check attachment: 79.log - Reason https://elixir.bootlin.com/linux/latest/source/fs/xfs/libxfs/xfs_dir2.c#L185 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; return !sfp->count; Missing checks on sfp. Reported by Wen Xu (wen.xu@gatech.edu) from SSLab.
Created attachment 278071 [details] The (compressed) crafted image which causes crash
Created attachment 278073 [details] kernel log
[PATCH] xfs: verify size-vs-format for symlinks & dirs