diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 7b26cc2fd284..699b60cbab9c 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -527,6 +527,10 @@ xfs_attrmulti_by_handle( | |||
527 | if (copy_from_user(&am_hreq, arg, sizeof(xfs_fsop_attrmulti_handlereq_t))) | 527 | if (copy_from_user(&am_hreq, arg, sizeof(xfs_fsop_attrmulti_handlereq_t))) |
528 | return -XFS_ERROR(EFAULT); | 528 | return -XFS_ERROR(EFAULT); |
529 | 529 | ||
530 | /* overflow check */ | ||
531 | if (am_hreq.opcount >= INT_MAX / sizeof(xfs_attr_multiop_t)) | ||
532 | return -E2BIG; | ||
533 | |||
530 | dentry = xfs_handlereq_to_dentry(parfilp, &am_hreq.hreq); | 534 | dentry = xfs_handlereq_to_dentry(parfilp, &am_hreq.hreq); |
531 | if (IS_ERR(dentry)) | 535 | if (IS_ERR(dentry)) |
532 | return PTR_ERR(dentry); | 536 | return PTR_ERR(dentry); |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index 593c05b4df8d..9287135e9bfc 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c | |||
@@ -420,6 +420,10 @@ xfs_compat_attrmulti_by_handle( | |||
420 | sizeof(compat_xfs_fsop_attrmulti_handlereq_t))) | 420 | sizeof(compat_xfs_fsop_attrmulti_handlereq_t))) |
421 | return -XFS_ERROR(EFAULT); | 421 | return -XFS_ERROR(EFAULT); |
422 | 422 | ||
423 | /* overflow check */ | ||
424 | if (am_hreq.opcount >= INT_MAX / sizeof(compat_xfs_attr_multiop_t)) | ||
425 | return -E2BIG; | ||
426 | |||
423 | dentry = xfs_compat_handlereq_to_dentry(parfilp, &am_hreq.hreq); | 427 | dentry = xfs_compat_handlereq_to_dentry(parfilp, &am_hreq.hreq); |
424 | if (IS_ERR(dentry)) | 428 | if (IS_ERR(dentry)) |
425 | return PTR_ERR(dentry); | 429 | return PTR_ERR(dentry); |