• Artem Savkov's avatar
    Make __xfs_xattr_put_listen preperly report errors. · 0312017c
    Artem Savkov authored
    commit 791cc43b36eb1f88166c8505900cad1b43c7fe1a upstream.
    
    Commit 2a6fba6d "xfs: only return -errno or success from attr ->put_listent"
    changes the returnvalue of __xfs_xattr_put_listen to 0 in case when there is
    insufficient space in the buffer assuming that setting context->count to -1
    would be enough, but all of the ->put_listent callers only check seen_enough.
    This results in a failed assertion:
    XFS: Assertion failed: context->count >= 0, file: fs/xfs/xfs_xattr.c, line: 175
    in insufficient buffer size case.
    
    This is only reproducible with at least 2 xattrs and only when the buffer
    gets depleted before the last one.
    
    Furthermore if buffersize is such that it is enough to hold the last xattr's
    name, but not enough to hold the sum of preceeding xattr names listxattr won't
    fail with ERANGE, but will suceed returning last xattr's name without the
    first character. The first character end's up overwriting data stored at
    (context->alist - 1).
    Signed-off-by: default avatarArtem Savkov <asavkov@redhat.com>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    Cc: Eric Sandeen <sandeen@redhat.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    0312017c
Name
Last commit
Last update
..
libxfs Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
kmem.c Loading commit data...
kmem.h Loading commit data...
mrlock.h Loading commit data...
uuid.c Loading commit data...
uuid.h Loading commit data...
xfs.h Loading commit data...
xfs_acl.c Loading commit data...
xfs_acl.h Loading commit data...
xfs_aops.c Loading commit data...
xfs_aops.h Loading commit data...
xfs_attr.h Loading commit data...
xfs_attr_inactive.c Loading commit data...
xfs_attr_list.c Loading commit data...
xfs_bmap_util.c Loading commit data...
xfs_bmap_util.h Loading commit data...
xfs_buf.c Loading commit data...
xfs_buf.h Loading commit data...
xfs_buf_item.c Loading commit data...
xfs_buf_item.h Loading commit data...
xfs_dir2_readdir.c Loading commit data...
xfs_discard.c Loading commit data...
xfs_discard.h Loading commit data...
xfs_dquot.c Loading commit data...
xfs_dquot.h Loading commit data...
xfs_dquot_item.c Loading commit data...
xfs_dquot_item.h Loading commit data...
xfs_error.c Loading commit data...
xfs_error.h Loading commit data...
xfs_export.c Loading commit data...
xfs_export.h Loading commit data...
xfs_extent_busy.c Loading commit data...
xfs_extent_busy.h Loading commit data...
xfs_extfree_item.c Loading commit data...
xfs_extfree_item.h Loading commit data...
xfs_file.c Loading commit data...
xfs_filestream.c Loading commit data...
xfs_filestream.h Loading commit data...
xfs_fsops.c Loading commit data...
xfs_fsops.h Loading commit data...
xfs_globals.c Loading commit data...
xfs_icache.c Loading commit data...
xfs_icache.h Loading commit data...
xfs_icreate_item.c Loading commit data...
xfs_icreate_item.h Loading commit data...
xfs_inode.c Loading commit data...
xfs_inode.h Loading commit data...
xfs_inode_item.c Loading commit data...
xfs_inode_item.h Loading commit data...
xfs_ioctl.c Loading commit data...
xfs_ioctl.h Loading commit data...
xfs_ioctl32.c Loading commit data...
xfs_ioctl32.h Loading commit data...
xfs_iomap.c Loading commit data...
xfs_iomap.h Loading commit data...
xfs_iops.c Loading commit data...
xfs_iops.h Loading commit data...
xfs_itable.c Loading commit data...
xfs_itable.h Loading commit data...
xfs_linux.h Loading commit data...
xfs_log.c Loading commit data...
xfs_log.h Loading commit data...
xfs_log_cil.c Loading commit data...
xfs_log_priv.h Loading commit data...
xfs_log_recover.c Loading commit data...
xfs_message.c Loading commit data...
xfs_message.h Loading commit data...
xfs_mount.c Loading commit data...
xfs_mount.h Loading commit data...
xfs_mru_cache.c Loading commit data...
xfs_mru_cache.h Loading commit data...
xfs_ondisk.h Loading commit data...
xfs_pnfs.c Loading commit data...
xfs_pnfs.h Loading commit data...
xfs_qm.c Loading commit data...
xfs_qm.h Loading commit data...
xfs_qm_bhv.c Loading commit data...
xfs_qm_syscalls.c Loading commit data...
xfs_quota.h Loading commit data...
xfs_quotaops.c Loading commit data...
xfs_rmap_item.c Loading commit data...
xfs_rmap_item.h Loading commit data...
xfs_rtalloc.c Loading commit data...
xfs_rtalloc.h Loading commit data...
xfs_stats.c Loading commit data...
xfs_stats.h Loading commit data...
xfs_super.c Loading commit data...
xfs_super.h Loading commit data...
xfs_symlink.c Loading commit data...
xfs_symlink.h Loading commit data...
xfs_sysctl.c Loading commit data...
xfs_sysctl.h Loading commit data...
xfs_sysfs.c Loading commit data...
xfs_sysfs.h Loading commit data...
xfs_trace.c Loading commit data...
xfs_trace.h Loading commit data...
xfs_trans.c Loading commit data...
xfs_trans.h Loading commit data...
xfs_trans_ail.c Loading commit data...
xfs_trans_buf.c Loading commit data...
xfs_trans_dquot.c Loading commit data...
xfs_trans_extfree.c Loading commit data...
xfs_trans_inode.c Loading commit data...
xfs_trans_priv.h Loading commit data...
xfs_trans_rmap.c Loading commit data...
xfs_xattr.c Loading commit data...