Skip to content

Commit e238e49

Browse files
committed
Merge tag 'vfs-6.15-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull vfs fixes from Christian Brauner: - Ensure that simple_xattr_list() always includes security.* xattrs - Fix eventpoll busy loop optimization when combined with timeouts - Disable swapon() for devices with block sizes greater than page sizes - Don't call errseq_set() twice during mark_buffer_write_io_error(). Just use mapping_set_error() which takes care to not deference unconditionally * tag 'vfs-6.15-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: Remove redundant errseq_set call in mark_buffer_write_io_error. swapfile: disable swapon for bs > ps devices fs/eventpoll: fix endless busy loop after timeout has expired fs/xattr.c: fix simple_xattr_list to always include security.* xattrs
2 parents 627277b + 04679f3 commit e238e49

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

fs/buffer.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,10 +1220,8 @@ void mark_buffer_write_io_error(struct buffer_head *bh)
12201220
/* FIXME: do we need to set this in both places? */
12211221
if (bh->b_folio && bh->b_folio->mapping)
12221222
mapping_set_error(bh->b_folio->mapping, -EIO);
1223-
if (bh->b_assoc_map) {
1223+
if (bh->b_assoc_map)
12241224
mapping_set_error(bh->b_assoc_map, -EIO);
1225-
errseq_set(&bh->b_assoc_map->host->i_sb->s_wb_err, -EIO);
1226-
}
12271225
}
12281226
EXPORT_SYMBOL(mark_buffer_write_io_error);
12291227

fs/eventpoll.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,9 +2111,10 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
21112111

21122112
write_unlock_irq(&ep->lock);
21132113

2114-
if (!eavail && ep_schedule_timeout(to))
2115-
timed_out = !schedule_hrtimeout_range(to, slack,
2116-
HRTIMER_MODE_ABS);
2114+
if (!eavail)
2115+
timed_out = !ep_schedule_timeout(to) ||
2116+
!schedule_hrtimeout_range(to, slack,
2117+
HRTIMER_MODE_ABS);
21172118
__set_current_state(TASK_RUNNING);
21182119

21192120
/*

fs/xattr.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,15 @@ static bool xattr_is_trusted(const char *name)
14281428
return !strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN);
14291429
}
14301430

1431+
static bool xattr_is_maclabel(const char *name)
1432+
{
1433+
const char *suffix = name + XATTR_SECURITY_PREFIX_LEN;
1434+
1435+
return !strncmp(name, XATTR_SECURITY_PREFIX,
1436+
XATTR_SECURITY_PREFIX_LEN) &&
1437+
security_ismaclabel(suffix);
1438+
}
1439+
14311440
/**
14321441
* simple_xattr_list - list all xattr objects
14331442
* @inode: inode from which to get the xattrs
@@ -1460,6 +1469,17 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
14601469
if (err)
14611470
return err;
14621471

1472+
err = security_inode_listsecurity(inode, buffer, remaining_size);
1473+
if (err < 0)
1474+
return err;
1475+
1476+
if (buffer) {
1477+
if (remaining_size < err)
1478+
return -ERANGE;
1479+
buffer += err;
1480+
}
1481+
remaining_size -= err;
1482+
14631483
read_lock(&xattrs->lock);
14641484
for (rbp = rb_first(&xattrs->rb_root); rbp; rbp = rb_next(rbp)) {
14651485
xattr = rb_entry(rbp, struct simple_xattr, rb_node);
@@ -1468,6 +1488,10 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
14681488
if (!trusted && xattr_is_trusted(xattr->name))
14691489
continue;
14701490

1491+
/* skip MAC labels; these are provided by LSM above */
1492+
if (xattr_is_maclabel(xattr->name))
1493+
continue;
1494+
14711495
err = xattr_list_one(&buffer, &remaining_size, xattr->name);
14721496
if (err)
14731497
break;

mm/swapfile.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,6 +3331,15 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
33313331
goto bad_swap_unlock_inode;
33323332
}
33333333

3334+
/*
3335+
* The swap subsystem needs a major overhaul to support this.
3336+
* It doesn't work yet so just disable it for now.
3337+
*/
3338+
if (mapping_min_folio_order(mapping) > 0) {
3339+
error = -EINVAL;
3340+
goto bad_swap_unlock_inode;
3341+
}
3342+
33343343
/*
33353344
* Read the swap header.
33363345
*/

0 commit comments

Comments
 (0)