Loading fs/xfs/linux-2.6/xfs_ioctl.c +7 −16 Original line number Diff line number Diff line Loading @@ -489,17 +489,12 @@ xfs_attrmulti_attr_set( if (len > XATTR_SIZE_MAX) return EINVAL; kbuf = kmalloc(len, GFP_KERNEL); if (!kbuf) return ENOMEM; if (copy_from_user(kbuf, ubuf, len)) goto out_kfree; kbuf = memdup_user(ubuf, len); if (IS_ERR(kbuf)) return PTR_ERR(kbuf); error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags); out_kfree: kfree(kbuf); return error; } Loading Loading @@ -540,20 +535,16 @@ xfs_attrmulti_by_handle( if (!size || size > 16 * PAGE_SIZE) goto out_dput; error = ENOMEM; ops = kmalloc(size, GFP_KERNEL); if (!ops) ops = memdup_user(am_hreq.ops, size); if (IS_ERR(ops)) { error = PTR_ERR(ops); goto out_dput; error = EFAULT; if (copy_from_user(ops, am_hreq.ops, size)) goto out_kfree_ops; } attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL); if (!attr_name) goto out_kfree_ops; error = 0; for (i = 0; i < am_hreq.opcount; i++) { ops[i].am_error = strncpy_from_user(attr_name, Loading fs/xfs/linux-2.6/xfs_ioctl32.c +4 −8 Original line number Diff line number Diff line Loading @@ -427,20 +427,16 @@ xfs_compat_attrmulti_by_handle( if (!size || size > 16 * PAGE_SIZE) goto out_dput; error = ENOMEM; ops = kmalloc(size, GFP_KERNEL); if (!ops) ops = memdup_user(compat_ptr(am_hreq.ops), size); if (IS_ERR(ops)) { error = PTR_ERR(ops); goto out_dput; error = EFAULT; if (copy_from_user(ops, compat_ptr(am_hreq.ops), size)) goto out_kfree_ops; } attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL); if (!attr_name) goto out_kfree_ops; error = 0; for (i = 0; i < am_hreq.opcount; i++) { ops[i].am_error = strncpy_from_user(attr_name, Loading Loading
fs/xfs/linux-2.6/xfs_ioctl.c +7 −16 Original line number Diff line number Diff line Loading @@ -489,17 +489,12 @@ xfs_attrmulti_attr_set( if (len > XATTR_SIZE_MAX) return EINVAL; kbuf = kmalloc(len, GFP_KERNEL); if (!kbuf) return ENOMEM; if (copy_from_user(kbuf, ubuf, len)) goto out_kfree; kbuf = memdup_user(ubuf, len); if (IS_ERR(kbuf)) return PTR_ERR(kbuf); error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags); out_kfree: kfree(kbuf); return error; } Loading Loading @@ -540,20 +535,16 @@ xfs_attrmulti_by_handle( if (!size || size > 16 * PAGE_SIZE) goto out_dput; error = ENOMEM; ops = kmalloc(size, GFP_KERNEL); if (!ops) ops = memdup_user(am_hreq.ops, size); if (IS_ERR(ops)) { error = PTR_ERR(ops); goto out_dput; error = EFAULT; if (copy_from_user(ops, am_hreq.ops, size)) goto out_kfree_ops; } attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL); if (!attr_name) goto out_kfree_ops; error = 0; for (i = 0; i < am_hreq.opcount; i++) { ops[i].am_error = strncpy_from_user(attr_name, Loading
fs/xfs/linux-2.6/xfs_ioctl32.c +4 −8 Original line number Diff line number Diff line Loading @@ -427,20 +427,16 @@ xfs_compat_attrmulti_by_handle( if (!size || size > 16 * PAGE_SIZE) goto out_dput; error = ENOMEM; ops = kmalloc(size, GFP_KERNEL); if (!ops) ops = memdup_user(compat_ptr(am_hreq.ops), size); if (IS_ERR(ops)) { error = PTR_ERR(ops); goto out_dput; error = EFAULT; if (copy_from_user(ops, compat_ptr(am_hreq.ops), size)) goto out_kfree_ops; } attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL); if (!attr_name) goto out_kfree_ops; error = 0; for (i = 0; i < am_hreq.opcount; i++) { ops[i].am_error = strncpy_from_user(attr_name, Loading