Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs fixes from Al Viro:
"A couple of regression fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fix iov_iter_advance() for ITER_PIPE
xattr: Fix setting security xattrs on sockfs

+32 -9
+14 -8
fs/xattr.c
··· 170 170 const void *value, size_t size, int flags) 171 171 { 172 172 struct inode *inode = dentry->d_inode; 173 - int error = -EOPNOTSUPP; 173 + int error = -EAGAIN; 174 174 int issec = !strncmp(name, XATTR_SECURITY_PREFIX, 175 175 XATTR_SECURITY_PREFIX_LEN); 176 176 ··· 183 183 security_inode_post_setxattr(dentry, name, value, 184 184 size, flags); 185 185 } 186 - } else if (issec) { 187 - const char *suffix = name + XATTR_SECURITY_PREFIX_LEN; 188 - 186 + } else { 189 187 if (unlikely(is_bad_inode(inode))) 190 188 return -EIO; 191 - error = security_inode_setsecurity(inode, suffix, value, 192 - size, flags); 193 - if (!error) 194 - fsnotify_xattr(dentry); 189 + } 190 + if (error == -EAGAIN) { 191 + error = -EOPNOTSUPP; 192 + 193 + if (issec) { 194 + const char *suffix = name + XATTR_SECURITY_PREFIX_LEN; 195 + 196 + error = security_inode_setsecurity(inode, suffix, value, 197 + size, flags); 198 + if (!error) 199 + fsnotify_xattr(dentry); 200 + } 195 201 } 196 202 197 203 return error;
+3 -1
lib/iov_iter.c
··· 683 683 struct pipe_inode_info *pipe = i->pipe; 684 684 struct pipe_buffer *buf; 685 685 int idx = i->idx; 686 - size_t off = i->iov_offset; 686 + size_t off = i->iov_offset, orig_sz; 687 687 688 688 if (unlikely(i->count < size)) 689 689 size = i->count; 690 + orig_sz = size; 690 691 691 692 if (size) { 692 693 if (off) /* make it relative to the beginning of buffer */ ··· 714 713 pipe->nrbufs--; 715 714 } 716 715 } 716 + i->count -= orig_sz; 717 717 } 718 718 719 719 void iov_iter_advance(struct iov_iter *i, size_t size)
+15
net/socket.c
··· 341 341 .get = sockfs_xattr_get, 342 342 }; 343 343 344 + static int sockfs_security_xattr_set(const struct xattr_handler *handler, 345 + struct dentry *dentry, struct inode *inode, 346 + const char *suffix, const void *value, 347 + size_t size, int flags) 348 + { 349 + /* Handled by LSM. */ 350 + return -EAGAIN; 351 + } 352 + 353 + static const struct xattr_handler sockfs_security_xattr_handler = { 354 + .prefix = XATTR_SECURITY_PREFIX, 355 + .set = sockfs_security_xattr_set, 356 + }; 357 + 344 358 static const struct xattr_handler *sockfs_xattr_handlers[] = { 345 359 &sockfs_xattr_handler, 360 + &sockfs_security_xattr_handler, 346 361 NULL 347 362 }; 348 363