diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2010-05-17 06:00:00 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-05-17 06:00:00 -0400 |
commit | 4d92dc0f00a775dc2e1267b0e00befb783902fe7 (patch) | |
tree | 07bb835871dfcc290f5909fe6635ab420ff61420 /fs/ext4/ioctl.c | |
parent | 899ad0cea6ad7ff4ba24b16318edbc3cbbe03fad (diff) |
ext4: Fix compat EXT4_IOC_ADD_GROUP
struct ext4_new_group_input needs to be converted because u64 has
only 32-bit alignment on some 32-bit architectures, notably i386.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 66fa0b030e37..6ddec84846cd 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -373,8 +373,29 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
373 | case EXT4_IOC32_SETRSVSZ: | 373 | case EXT4_IOC32_SETRSVSZ: |
374 | cmd = EXT4_IOC_SETRSVSZ; | 374 | cmd = EXT4_IOC_SETRSVSZ; |
375 | break; | 375 | break; |
376 | case EXT4_IOC_GROUP_ADD: | 376 | case EXT4_IOC32_GROUP_ADD: { |
377 | break; | 377 | struct compat_ext4_new_group_input __user *uinput; |
378 | struct ext4_new_group_input input; | ||
379 | mm_segment_t old_fs; | ||
380 | int err; | ||
381 | |||
382 | uinput = compat_ptr(arg); | ||
383 | err = get_user(input.group, &uinput->group); | ||
384 | err |= get_user(input.block_bitmap, &uinput->block_bitmap); | ||
385 | err |= get_user(input.inode_bitmap, &uinput->inode_bitmap); | ||
386 | err |= get_user(input.inode_table, &uinput->inode_table); | ||
387 | err |= get_user(input.blocks_count, &uinput->blocks_count); | ||
388 | err |= get_user(input.reserved_blocks, | ||
389 | &uinput->reserved_blocks); | ||
390 | if (err) | ||
391 | return -EFAULT; | ||
392 | old_fs = get_fs(); | ||
393 | set_fs(KERNEL_DS); | ||
394 | err = ext4_ioctl(file, EXT4_IOC_GROUP_ADD, | ||
395 | (unsigned long) &input); | ||
396 | set_fs(old_fs); | ||
397 | return err; | ||
398 | } | ||
378 | case EXT4_IOC_MOVE_EXT: | 399 | case EXT4_IOC_MOVE_EXT: |
379 | break; | 400 | break; |
380 | default: | 401 | default: |