Skip to content

Commit 055f213

Browse files
committed
Merge tag 'vfs-6.17-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull vfs fixes from Christian Brauner: - Fix two memory leaks in pidfs - Prevent changing the idmapping of an already idmapped mount without OPEN_TREE_CLONE through open_tree_attr() - Don't fail listing extended attributes in kernfs when no extended attributes are set - Fix the return value in coredump_parse() - Fix the error handling for unbuffered writes in netfs - Fix broken data integrity guarantees for O_SYNC writes via iomap - Fix UAF in __mark_inode_dirty() - Keep inode->i_blkbits constant in fuse - Fix coredump selftests - Fix get_unused_fd_flags() usage in do_handle_open() - Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES - Fix use-after-free in bh_read() - Fix incorrect lflags value in the move_mount() syscall * tag 'vfs-6.17-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: signal: Fix memory leak for PIDFD_SELF* sentinels kernfs: don't fail listing extended attributes coredump: Fix return value in coredump_parse() fs/buffer: fix use-after-free when call bh_read() helper pidfs: Fix memory leak in pidfd_info() netfs: Fix unbuffered write error handling fhandle: do_handle_open() should get FD with user flags module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES fs: fix incorrect lflags value in the move_mount syscall selftests/coredump: Remove the read() that fails the test fuse: keep inode->i_blkbits constant iomap: Fix broken data integrity guarantees for O_SYNC writes selftests/mount_setattr: add smoke tests for open_tree_attr(2) bug open_tree_attr: do not allow id-mapping changes without OPEN_TREE_CLONE fs: writeback: fix use-after-free in __mark_inode_dirty()
2 parents be48bcf + a2c1f82 commit 055f213

File tree

21 files changed

+138
-68
lines changed

21 files changed

+138
-68
lines changed

Documentation/core-api/symbol-namespaces.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,21 @@ unit as preprocessor statement. The above example would then read::
7676
within the corresponding compilation unit before the #include for
7777
<linux/export.h>. Typically it's placed before the first #include statement.
7878

79-
Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro
80-
-----------------------------------------------
79+
Using the EXPORT_SYMBOL_FOR_MODULES() macro
80+
-------------------------------------------
8181

8282
Symbols exported using this macro are put into a module namespace. This
83-
namespace cannot be imported.
83+
namespace cannot be imported. These exports are GPL-only as they are only
84+
intended for in-tree modules.
8485

8586
The macro takes a comma separated list of module names, allowing only those
8687
modules to access this symbol. Simple tail-globs are supported.
8788

8889
For example::
8990

90-
EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
91+
EXPORT_SYMBOL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
9192

92-
will limit usage of this symbol to modules whoes name matches the given
93+
will limit usage of this symbol to modules whose name matches the given
9394
patterns.
9495

9596
How to use Symbols exported in Namespaces

drivers/tty/serial/8250/8250_rsa.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void rsa_enable(struct uart_8250_port *up)
147147
if (up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16)
148148
serial_out(up, UART_RSA_FRR, 0);
149149
}
150-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_enable, "8250_base");
150+
EXPORT_SYMBOL_FOR_MODULES(rsa_enable, "8250_base");
151151

152152
/*
153153
* Attempts to turn off the RSA FIFO and resets the RSA board back to 115kbps compat mode. It is
@@ -179,7 +179,7 @@ void rsa_disable(struct uart_8250_port *up)
179179
up->port.uartclk = SERIAL_RSA_BAUD_BASE_LO * 16;
180180
uart_port_unlock_irq(&up->port);
181181
}
182-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_disable, "8250_base");
182+
EXPORT_SYMBOL_FOR_MODULES(rsa_disable, "8250_base");
183183

184184
void rsa_autoconfig(struct uart_8250_port *up)
185185
{
@@ -192,7 +192,7 @@ void rsa_autoconfig(struct uart_8250_port *up)
192192
if (__rsa_enable(up))
193193
up->port.type = PORT_RSA;
194194
}
195-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_autoconfig, "8250_base");
195+
EXPORT_SYMBOL_FOR_MODULES(rsa_autoconfig, "8250_base");
196196

197197
void rsa_reset(struct uart_8250_port *up)
198198
{
@@ -201,7 +201,7 @@ void rsa_reset(struct uart_8250_port *up)
201201

202202
serial_out(up, UART_RSA_FRR, 0);
203203
}
204-
EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_reset, "8250_base");
204+
EXPORT_SYMBOL_FOR_MODULES(rsa_reset, "8250_base");
205205

206206
#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS
207207
#ifndef MODULE

fs/anon_inodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *n
129129
}
130130
return inode;
131131
}
132-
EXPORT_SYMBOL_GPL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
132+
EXPORT_SYMBOL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
133133

134134
static struct file *__anon_inode_getfile(const char *name,
135135
const struct file_operations *fops,

fs/buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ static void __end_buffer_read_notouch(struct buffer_head *bh, int uptodate)
157157
*/
158158
void end_buffer_read_sync(struct buffer_head *bh, int uptodate)
159159
{
160-
__end_buffer_read_notouch(bh, uptodate);
161160
put_bh(bh);
161+
__end_buffer_read_notouch(bh, uptodate);
162162
}
163163
EXPORT_SYMBOL(end_buffer_read_sync);
164164

fs/coredump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static bool coredump_parse(struct core_name *cn, struct coredump_params *cprm,
345345
was_space = false;
346346
err = cn_printf(cn, "%c", '\0');
347347
if (err)
348-
return err;
348+
return false;
349349
(*argv)[(*argc)++] = cn->used;
350350
}
351351
}

fs/fhandle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static long do_handle_open(int mountdirfd, struct file_handle __user *ufh,
402402
if (retval)
403403
return retval;
404404

405-
CLASS(get_unused_fd, fd)(O_CLOEXEC);
405+
CLASS(get_unused_fd, fd)(open_flag);
406406
if (fd < 0)
407407
return fd;
408408

fs/fs-writeback.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,10 +2608,6 @@ void __mark_inode_dirty(struct inode *inode, int flags)
26082608
wakeup_bdi = inode_io_list_move_locked(inode, wb,
26092609
dirty_list);
26102610

2611-
spin_unlock(&wb->list_lock);
2612-
spin_unlock(&inode->i_lock);
2613-
trace_writeback_dirty_inode_enqueue(inode);
2614-
26152611
/*
26162612
* If this is the first dirty inode for this bdi,
26172613
* we have to wake-up the corresponding bdi thread
@@ -2621,6 +2617,11 @@ void __mark_inode_dirty(struct inode *inode, int flags)
26212617
if (wakeup_bdi &&
26222618
(wb->bdi->capabilities & BDI_CAP_WRITEBACK))
26232619
wb_wakeup_delayed(wb);
2620+
2621+
spin_unlock(&wb->list_lock);
2622+
spin_unlock(&inode->i_lock);
2623+
trace_writeback_dirty_inode_enqueue(inode);
2624+
26242625
return;
26252626
}
26262627
}

fs/fuse/inode.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,6 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr,
289289
}
290290
}
291291

292-
if (attr->blksize != 0)
293-
inode->i_blkbits = ilog2(attr->blksize);
294-
else
295-
inode->i_blkbits = inode->i_sb->s_blocksize_bits;
296-
297292
/*
298293
* Don't set the sticky bit in i_mode, unless we want the VFS
299294
* to check permissions. This prevents failures due to the

fs/iomap/direct-io.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,14 @@ static int iomap_dio_bio_iter(struct iomap_iter *iter, struct iomap_dio *dio)
363363
if (iomap->flags & IOMAP_F_SHARED)
364364
dio->flags |= IOMAP_DIO_COW;
365365

366-
if (iomap->flags & IOMAP_F_NEW) {
366+
if (iomap->flags & IOMAP_F_NEW)
367367
need_zeroout = true;
368-
} else if (iomap->type == IOMAP_MAPPED) {
369-
if (iomap_dio_can_use_fua(iomap, dio))
370-
bio_opf |= REQ_FUA;
371-
else
372-
dio->flags &= ~IOMAP_DIO_WRITE_THROUGH;
373-
}
368+
else if (iomap->type == IOMAP_MAPPED &&
369+
iomap_dio_can_use_fua(iomap, dio))
370+
bio_opf |= REQ_FUA;
371+
372+
if (!(bio_opf & REQ_FUA))
373+
dio->flags &= ~IOMAP_DIO_WRITE_THROUGH;
374374

375375
/*
376376
* We can only do deferred completion for pure overwrites that

fs/kernfs/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ ssize_t kernfs_iop_listxattr(struct dentry *dentry, char *buf, size_t size)
142142
struct kernfs_node *kn = kernfs_dentry_node(dentry);
143143
struct kernfs_iattrs *attrs;
144144

145-
attrs = kernfs_iattrs_noalloc(kn);
145+
attrs = kernfs_iattrs(kn);
146146
if (!attrs)
147-
return -ENODATA;
147+
return -ENOMEM;
148148

149149
return simple_xattr_list(d_inode(dentry), &attrs->xattrs, buf, size);
150150
}

0 commit comments

Comments
 (0)