--- zzzz-none-000/linux-4.9.276/fs/squashfs/xattr_id.c 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/fs/squashfs/xattr_id.c 2023-04-05 08:19:02.000000000 +0000 @@ -44,23 +44,23 @@ struct squashfs_sb_info *msblk = sb->s_fs_info; int block = SQUASHFS_XATTR_BLOCK(index); int offset = SQUASHFS_XATTR_BLOCK_OFFSET(index); - u64 start_block; + u64 start_block = squash_le64_to_cpu(msblk->xattr_id_table[block]); struct squashfs_xattr_id id; int err; if (index >= msblk->xattr_ids) return -EINVAL; - start_block = le64_to_cpu(msblk->xattr_id_table[block]); + start_block = squash_le64_to_cpu(msblk->xattr_id_table[block]); err = squashfs_read_metadata(sb, &id, &start_block, &offset, sizeof(id)); if (err < 0) return err; - *xattr = le64_to_cpu(id.xattr); - *size = le32_to_cpu(id.size); - *count = le32_to_cpu(id.count); + *xattr = squash_le64_to_cpu(id.xattr); + *size = squash_le32_to_cpu(id.size); + *count = squash_le32_to_cpu(id.count); return 0; } @@ -82,8 +82,8 @@ if (IS_ERR(id_table)) return (__le64 *) id_table; - *xattr_table_start = le64_to_cpu(id_table->xattr_table_start); - *xattr_ids = le32_to_cpu(id_table->xattr_ids); + *xattr_table_start = squash_le64_to_cpu(id_table->xattr_table_start); + *xattr_ids = squash_le32_to_cpu(id_table->xattr_ids); kfree(id_table); /* Sanity check values */ @@ -119,8 +119,8 @@ * Finally xattr_table_start should be less than table[0]. */ for (n = 0; n < (indexes - 1); n++) { - start = le64_to_cpu(table[n]); - end = le64_to_cpu(table[n + 1]); + start = squash_le64_to_cpu(table[n]); + end = squash_le64_to_cpu(table[n + 1]); if (start >= end || (end - start) > (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { @@ -129,14 +129,14 @@ } } - start = le64_to_cpu(table[indexes - 1]); + start = squash_le64_to_cpu(table[indexes - 1]); if (start >= table_start || (table_start - start) > (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { kfree(table); return ERR_PTR(-EINVAL); } - if (*xattr_table_start >= le64_to_cpu(table[0])) { + if (*xattr_table_start >= squash_le64_to_cpu(table[0])) { kfree(table); return ERR_PTR(-EINVAL); }