7.3.4-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 1224/1257 apparmor: dont revalidate inherited files under files->file_lock
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georgia Garcia <[email protected]>
[ Upstream commit a913281f600157aa036b7c02afbb18a0ac115187 ]
aa_inherit_files() revalidates inherited files on exec using iterate_fd(), which calls the callback with files->file_lock held, so the revalidation is done with IN_ATOMIC. However the unix socket mediation path can sleep: aa_unix_file_perm() drops a ref on the peer's path with path_put(), and unix_fs_perm() -> aa_path_perm() allocates a buffer with aa_get_buffer(false), resulting in
BUG: sleeping function called from invalid context at fs/dcache.c:1039 ... dput.part.0+0x24/0x180 path_put+0x2c/0x60 aa_unix_file_perm+0x42a/0x17b0 aa_file_perm+0xcd3/0x1060 match_file+0x10b/0x190 iterate_fd+0xe6/0x280 aa_inherit_files+0x250/0x4f0
Only grab a ref on each file under iterate_fd(), and revalidate it after the lock is dropped, so revalidation is done with no locks held and does not need to be atomic. Denied fds are still replaced with /dev/null, or closed if it can not be opened.
--- security/apparmor/file.c | 61 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 30 deletions(-)
security/apparmor/file.c +31 -30
@@ -706,49 +706,50 @@ static void revalidate_tty(const struct cred *subj_cred, struct aa_label *label)no_tty (); } -struct cred_label { -const struct cred *cred; -struct aa_label *label; -}; - -static int match_file (const void *p,struct file *file,unsigned int fd) +/* +* iterate_fd() callback, called with files->file_lock held: grab a ref +* on the next file so it can be revalidated without the lock held. +*/ +static int get_next_file (const void *p,struct file *file,unsigned int fd) { -struct cred_label *cl = (struct cred_label *)p; + *(struct file **)p =get_file (file); -if (aa_file_perm (OP_INHERIT , cl->cred, cl->label, file, -aa_map_file_to_perms (file),IN_ATOMIC )) -return fd +1 ; -return 0 ; +return fd +1 ; } -/* based on selinux's flush_unauthorized_files */ void aa_inherit_files (const struct cred *cred,struct files_struct *files) {struct aa_label *label =aa_get_newest_cred_label (cred); -struct cred_label cl = { - .cred = cred, - .label = label, - }; -struct file *devnull =NULL ; -unsigned int n; +struct file *devnull =NULL , *file; +bool devnull_tried = false; +unsigned int n =0 ;revalidate_tty (cred, label); -/* Revalidate access to inherited open files. */ - n =iterate_fd (files,0 , match_file, &cl); -if (!n)/* none found? */ - goto out; - - devnull =dentry_open (&aa_null,O_RDWR , cred); -if (IS_ERR (devnull)) - devnull =NULL ; -/* replace all the matching ones with this */ -do { +/* +* Revalidate access to inherited open files. Each file is +* revalidated holding only a reference to it, with no locks +* held, as revalidation may sleep (e.g. unix socket mediation +* dropping path refs, or allocating path buffers). +*/ +while ((n =iterate_fd (files, n, get_next_file, &file)) !=0 ) { +int error =aa_file_perm (OP_INHERIT , cred, label, file, +aa_map_file_to_perms (file), false); + +fput (file); +if (!error) +continue ; +if (!devnull_tried) { + devnull_tried = true; + devnull =dentry_open (&aa_null,O_RDWR , cred); +if (IS_ERR (devnull)) + devnull =NULL ; + } +/* replace the denied fd (n - 1) with devnull, or close it */ replace_fd (n -1 , devnull,0 ); - }while ((n =iterate_fd (files, n, match_file, &cl)) !=0 ); + }if (devnull)fput (devnull); -out:aa_put_label (label); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1225/1257 r8152: Use BMSR to detect the link state
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linmao Li <[email protected]>
[ Upstream commit 85b4bc79dde77aadda0929a22f3532b208a3e1f8 ]
r8152 detects carrier from PLA_PHYSTATUS without reading BMSR, so BMSR_LSTATUS can remain latched low after link up. Since commit f6f2e946aa4d ("net: mii: Fix the Speed display when the network cable is not connected"), the first speed query can then report SPEED_UNKNOWN, which applications such as NetworkManager may cache until the next carrier change.
Use BMSR_LSTATUS in set_carrier() so a latched link down can turn carrier off after the link has recovered. If BMSR reports down but PLA_PHYSTATUS reports up, reschedule the link work to read the current state without waiting for another notification.
Tested on an RTL8153B: NetworkManager reported 1000 Mb/s after 3 of 3 rebinds, instead of an unknown speed.
--- drivers/net/usb/r8152.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/usb/r8152.c +6 -4
@@ -6979,11 +6979,8 @@ static void set_carrier(struct r8152 *tp) {struct net_device *netdev = tp->netdev;struct napi_struct *napi = &tp->napi; -u16 speed; - - speed =rtl8152_get_speed (tp); -if (speed &LINK_STATUS ) { +if (r8152_mdio_read (tp,MII_BMSR ) &BMSR_LSTATUS ) {if (!netif_carrier_ok (netdev)) { tp->rtl_ops.enable (tp);netif_stop_queue (netdev);
@@ -7009,6 +7006,11 @@ static void set_carrier(struct r8152 *tp)tasklet_enable (&tp->tx_tl);netif_info (tp, link, netdev,"carrier off\n" ); } + +if (rtl8152_get_speed (tp) &LINK_STATUS ) { +set_bit (RTL8152_LINK_CHG , &tp->flags); +schedule_delayed_work (&tp->schedule,0 ); + } } }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1226/1257 tg3: Invert restart quirk logic to restrict SNP power-down bypass
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Noam D. Eliyahu <[email protected]>
[ Upstream commit d7314b51341c037973ce022f12c6009fd07b021e ]
Commit 9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF") bypassed tg3_power_down() on system restarts to prevent reboot hangs and NMIs on servers where NICs were initialized via SNP (such as Dell PowerEdge R650 and R750).
However, skipping the power-down flow globally causes the ACPI _PTS method to trigger fatal PCIe AER events and hangs on other models. Commit e0efe83ed325 ("tg3: Disable tg3 PCIe AER on system reboot") attempted to mitigate this by adding an AER-disable DMI quirk table. Maintaining a growing list of models for a secondary symptom misses the root cause, leaving systems like the PowerEdge T440 (sharing the BCM5720 NIC) exposed.
Fix this by inverting the quirk logic:
1. Restrict SNP power-down avoidance strictly to tg3_restart_snp_quirk_table for the specific systems requiring it (Dell PowerEdge R650 and R750).
2. Restore standard power-down behavior for all other systems, eliminating the separate AER-disable quirk table.
For systems affected by the original SNP restart issue, their shutdown flow remains completely untouched.
--- drivers/net/ethernet/broadcom/tg3.c | 42 ++++++++--------------------- 1 file changed, 11 insertions(+), 31 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +11 -31
@@ -18188,41 +18188,17 @@ static int tg3_resume(struct device *device) static SIMPLE_DEV_PM_OPS(tg3_pm_ops, tg3_suspend, tg3_resume); -/* Systems where ACPI _PTS (Prepare To Sleep) S5 will result in a fatal -* PCIe AER event on the tg3 device if the tg3 device is not, or cannot -* be, powered down. +/* Systems where powering down a tg3 device on restarts triggers +* NMIs and fatal hangs during reboot if the network adapters were +* initialized under SNP. */ -static const struct dmi_system_id tg3_restart_aer_quirk_table[] = { - { - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R440" ), - }, - }, - { - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R540" ), - }, - }, - { - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R640" ), - }, - }, +static const struct dmi_system_id tg3_restart_snp_quirk_table[] = { { .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ),DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R650" ), }, }, - { - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R740" ), - }, - }, { .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ),
@@ -18246,14 +18222,18 @@ static void tg3_shutdown(struct pci_dev *pdev)if (netif_running (dev))dev_close (dev); -if (system_state ==SYSTEM_POWER_OFF ) +if (!dmi_first_match (tg3_restart_snp_quirk_table) || + system_state ==SYSTEM_POWER_OFF ) {tg3_power_down (tp); -else if (system_state ==SYSTEM_RESTART && -dmi_first_match (tg3_restart_aer_quirk_table) && + }else if (system_state ==SYSTEM_RESTART && pdev->current_state != PCI_D3cold && pdev->current_state !=PCI_UNKNOWN ) {/* Disable PCIe AER on the tg3 to avoid a fatal * error during this system restart. +* Needed since on restarts for systems in +* tg3_restart_snp_quirk_table skipping on powering down the +* tg3 device causes a fatal AER error during ACPI _PTS +* (Prepare To Sleep). */ pcie_capability_clear_word(pdev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_CERE |
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1227/1257 iomap: dont mark unwritten parts of a folio uptodate
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit a4193b4af359db84b2cdf3a040752861984c636b ]
For a buffered write into a hole, an unwritten or new extent, or past EOF __iomap_write_begin() zeroes the parts of the blocks outside of the write and then marks the blocks uptodate. That includes the range of the write itself which still holds whatever was in the folio before. It only becomes valid once the copy from userspace has filled it in.
But the copy can come up short and __iomap_write_end() only rejects a short copy if the folio isn't uptodate. If the zeroed blocks were all that was missing the folio is uptodate by then, the short copy is accepted, and the rest of the range is exposed to readers and can end up on disk. A source buffer that ends in an unmapped page is enough:
ftruncate(fd, 4096);
pwrite(fd, p, 3000, 100); /* 16 bytes at p, then PROT_NONE */
pread(fd, buf, 4096, 0);The write returns 16 and the read returns 2984 bytes of whatever was in that page before. If other blocks of the folio aren't uptodate the short copy is rejected but the zeroed blocks keep their uptodate bits and the retry with the copied length leaves the same bytes behind.
Only mark blocks uptodate in __iomap_write_begin() after reading them. __iomap_write_end() marks the zeroed blocks uptodate once the copy has succeeded and rejects a short copy.
Willy reported this back in 2024 (cf. [1]) and Zhang Yi posted the same fix (cf. [2]) but it never got merged.
[1]: https://lore.kernel.org/all/[email protected]
[2]: https://lore.kernel.org/all/[email protected]
--- fs/iomap/buffered-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/iomap/buffered-io.c +2 -1
@@ -920,6 +920,7 @@ static int __iomap_write_begin(const struct iomap_iter *iter,if (iomap_block_needs_zeroing (iter, block_start)) {if (WARN_ON_ONCE (iter->flags &IOMAP_UNSHARE ))return -EIO ; +/* uptodate once copied, see __iomap_write_end() */ folio_zero_segments (folio, poff, from, to, poff + plen); }else {const struct iomap *iomap =iomap_iter_srcmap (iter);
@@ -943,8 +944,8 @@ static int __iomap_write_begin(const struct iomap_iter *iter,if (iomap->flags &IOMAP_F_ZERO_TAIL )folio_zero_segment (folio, to, poff + plen); +iomap_set_range_uptodate (folio, poff, plen); } -iomap_set_range_uptodate (folio, poff, plen); }while ((block_start += plen) < block_end);return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1228/1257 iomap: keep large chunks from defeating the bio cap
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit eb8ab8c23e71c6ae77dedc45de2a57a61558e5d5 ]
For integrity I/O a bio must not grow beyond max_integrity_io_size() because the integrity buffer is a single allocation of at most 2 MiB. Writeback and buffered reads check that before adding to a bio:
bio->bi_iter.bi_size > iomap_max_bio_size(iomap) - len
The subtraction is done in size_t and wraps if len alone is above the limit. The check then never fires and the bio grows until it runs out of bio_vecs.
That's easy to hit. The limit is also capped by the maximum segment size which is 64 KiB for SCSI hosts that don't set it, such as lpfc and qla2xxx, and XFS uses folios of up to 2 MiB. Writeback of a preallocated 300 MiB file then builds a single bio that needs 4.7 MiB of PI with 512 byte sectors and 8 byte tuples. That's more than kmalloc() can do, so bio_integrity_alloc_buf() falls back to a 2 MiB mempool element and generating the PI writes 2.7 MiB past its end.
Check the length on its own first. A chunk above the limit still gets a bio of its own which is never larger than a folio.
--- fs/iomap/bio.c | 2 +- fs/iomap/internal.h | 9 +++++++++ fs/iomap/ioend.c | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-)
fs/iomap/bio.c +1 -1
@@ -151,7 +151,7 @@ int iomap_bio_read_folio_range(const struct iomap_iter *iter,if (!bio ||bio_end_sector (bio) !=iomap_sector (&iter->iomap, iter->pos) || - bio->bi_iter.bi_size >iomap_max_bio_size (&iter->iomap) - plen || + !iomap_bio_has_room (&iter->iomap, bio, plen) || !bio_add_folio (bio, folio, plen,offset_in_folio (folio, iter->pos)))iomap_read_alloc_bio (iter, ctx, plen);return 0 ;
fs/iomap/internal.h +9 -0
@@ -17,6 +17,15 @@ static inline size_t iomap_max_bio_size(const struct iomap *iomap)return BIO_MAX_SIZE ; } +/* Can @len more bytes go into @bio? */ +static inline bool iomap_bio_has_room (const struct iomap *iomap, +const struct bio *bio,size_t len) +{ +size_t max_size =iomap_max_bio_size (iomap); + +return len <= max_size && bio->bi_iter.bi_size <= max_size - len; +} +u32 iomap_finish_ioend_buffered_read (struct iomap_ioend *ioend);u32 iomap_finish_ioend_direct (struct iomap_ioend *ioend);
fs/iomap/ioend.c +1 -2
@@ -176,8 +176,7 @@ static bool iomap_can_add_to_ioend(struct iomap_writepage_ctx *wpc, loff_t pos, {struct iomap_ioend *ioend = wpc->wb_ctx; -if (ioend->io_bio.bi_iter.bi_size > -iomap_max_bio_size (&wpc->iomap) - map_len) +if (!iomap_bio_has_room (&wpc->iomap, &ioend->io_bio, map_len))return false;if (ioend_flags &IOMAP_IOEND_BOUNDARY )return false;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1229/1257 mount: refuse setns() with a shared fs_struct again
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit 948e604aca8af30490accf7d46d44814ffa26f80 ]
mntns_install() refuses to switch the mount namespace of a task that shares its fs_struct, since root and cwd of the others would move to a namespace they are not in. It looks at nsset->fs for that. If more than the mount namespace is asked for, that is a private copy made by prepare_nsset(), which has one user by definition; commit_nsset() then writes root and cwd of the copy to the fs_struct of the task.
A thread of a process with two threads, pidfd of a task in another mount namespace:
setns(pidfd, CLONE_NEWNS) -EINVAL
setns(pidfd, CLONE_NEWNS | CLONE_NEWUTS) 0
and after the second call the other thread, still in the old mount namespace, has lost its cwd (/tmp became /) and sees the mounts of the other namespace under /.
Look at the fs_struct that is going to be changed. The second call then fails with -EINVAL like the first one.
--- fs/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namespace.c +1 -1
@@ -6720,7 +6720,7 @@ static int mntns_install(struct nsset *nsset, struct ns_common *ns)if (is_anon_ns (mnt_ns))return -EINVAL ; -if (fs->users !=1 ) +if (current->fs->users !=1 )return -EINVAL ;get_mnt_ns (mnt_ns);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1230/1257 userns: dont drop the exec securebits
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit bf5ba73c9bdd5e872eb35e801e429a3b526f8f04 ]
SECBIT_EXEC_RESTRICT_FILE and SECBIT_EXEC_DENY_INTERACTIVE tell script interpreters to only run what AT_EXECVE_CHECK allows and to refuse interactive input. A service manager sets them together with their lock bits so that nothing below it can turn them off again.
But set_cred_user_ns() resets all securebits to SECUREBITS_DEFAULT. So any task that can create a user namespace sheds the locked exec bits with a single unshare(CLONE_NEWUSER) and joining one with setns() does the same. The lock is pointless if anyone who may create a user namespace can drop it, and that is pretty much everyone.
Resetting the other bits is fine. They are about how capabilities are computed and a new user namespace starts out with a full set of capabilities anyway. The exec bits grant nothing though. They are restrictions a task placed on itself, just like no_new_privs which a user namespace doesn't touch either. So keep them and their locks.
Reproducer:
// SPDX-License-Identifier: GPL-2.0
/* Lock the exec securebits, then create a user namespace and look at them again. */
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
#include <sys/prctl.h>
#define SECBIT_EXEC_RESTRICT_FILE (1 << 8)
#define SECBIT_EXEC_RESTRICT_FILE_LOCKED (1 << 9)
#define SECBIT_EXEC_DENY_INTERACTIVE (1 << 10)
#define SECBIT_EXEC_DENY_INTERACTIVE_LOCKED (1 << 11)
int main(void)
{
int bits = SECBIT_EXEC_RESTRICT_FILE | SECBIT_EXEC_RESTRICT_FILE_LOCKED |
SECBIT_EXEC_DENY_INTERACTIVE | SECBIT_EXEC_DENY_INTERACTIVE_LOCKED;
if (prctl(PR_SET_SECUREBITS, bits, 0, 0, 0)) {
perror("PR_SET_SECUREBITS");
return 1;
}
printf("before: 0x%x\n", prctl(PR_GET_SECUREBITS, 0, 0, 0, 0));
printf("clear locked bits: %s\n", prctl(PR_SET_SECUREBITS, 0, 0, 0, 0) ? "refused" : "ALLOWED");
if (unshare(CLONE_NEWUSER)) {
perror("unshare(CLONE_NEWUSER)");
return 1;
}
printf("after unshare(CLONE_NEWUSER): 0x%x\n", prctl(PR_GET_SECUREBITS, 0, 0, 0, 0));
return 0;
}On v7.1 this prints "before: 0xf00", "clear locked bits: refused" and "after unshare(CLONE_NEWUSER): 0x0". With this patch the last line reads 0xf00 as well.
--- Documentation/userspace-api/check_exec.rst | 4 ++++ kernel/user_namespace.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-)
Documentation/userspace-api/check_exec.rst +4 -0
@@ -99,6 +99,10 @@ This secure bit may be set by user session managers, service managers, container runtimes, sandboxer tools... Except for test environments, the related ``SECBIT_EXEC_DENY_INTERACTIVE_LOCKED`` bit should also be set. +Both secure bits and their locks are inherited across :manpage:`fork(2)` and +:manpage:`execve(2)`, and they are kept when a task creates or joins a user +namespace. + Here is the expected behavior for a script interpreter according to combination of any exec securebits:
kernel/user_namespace.c +4 -1
@@ -45,8 +45,11 @@ static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns) {/* Start with the same capabilities as init but useless for doing * anything as the capabilities are bound to the new user namespace. +* The exec securebits grant nothing, they are restrictions the task +* placed on itself. Keep them and their locks. */ - cred->securebits =SECUREBITS_DEFAULT ; + cred->securebits =SECUREBITS_DEFAULT | + (cred->securebits & (SECURE_ALL_UNPRIVILEGED |SECURE_ALL_UNPRIVILEGED <<1 )); cred->cap_inheritable =CAP_EMPTY_SET ; cred->cap_permitted =CAP_FULL_SET ; cred->cap_effective =CAP_FULL_SET ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1231/1257 blk-iocost: abort weight transfer on invalid donation weights
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kunhai Dai <[email protected]>
[ Upstream commit c810ee88cdab27f443c32270dc7c0eaad2cca3f8 ]
transfer_surpluses() warns and then keeps going when the donation calculation produced invalid weights. The following propagation can then divide by a zero hweight_inuse, so the warning is immediately followed by a divide error.
When the check trips, abandon this period's donation transfer and release the walk lists. This trades one period without donation for not crashing; the invalid state is not expected on the normal path.
Developed with assistance from Claude Code (Anthropic): the assistant analysed the failure path, drafted the change and ran the checks listed below. The author reviewed the result and remains responsible for it.
--- block/blk-iocost.c | 2 ++ 1 file changed, 2 insertions(+)
block/blk-iocost.c +2 -0
@@ -1956,6 +1956,7 @@ static void transfer_surpluses(struct list_head *surpluses, struct ioc_now *now)pr_cont (": active=%u donating=%u after=%u\n" , iocg->hweight_active, iocg->hweight_donating, iocg->hweight_after_donation); + goto out; } }
@@ -2054,6 +2055,7 @@ static void transfer_surpluses(struct list_head *surpluses, struct ioc_now *now)__propagate_weights (iocg, iocg->active, inuse, true, now); } +out:/* walk list should be dissolved after use */ list_for_each_entry_safe (iocg, tiocg, &inner_walk, walk_list)list_del_init (&iocg->walk_list);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1232/1257 proc: dont let an entry below /proc/<pid>/net be a mountpoint
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit eeecea75ece2ba894bee4d3c53ed2e40abda8f0e ]
proc_net_d_revalidate() always returns 0 so that a dentry below /proc/<pid>/net is never reused after setns(). So lookup_fast() will end up calling d_invalidate(), which unhashes the dentry and detaches every mount on it, in every mount namespace; including locked mounts.
Then lookup_slow() creates a new dentry for the same entry. So a mount on /proc/<pid>/net/dev succeeds and goes away with the first lookup of the name by anybody with search permission on the directory. Given it's 0555 that's everyone's grandma. A mask on such a name hides nothing as the repro below shows.
Treat those entries like I did fd/, fdinfo/ and map_files/ and refuse to mount on them in the first place. It's nonsensical theater otherwise:
procnet net/dev stat
// SPDX-License-Identifier: GPL-2.0
/*
* procnet: cover an entry of /proc/<pid>/ with a bind mount, lock the mount,
* then look the name up.
*
* The first task stays alive, <pid> is its pid. The "container" task has its
* own mount namespace. There it binds a mask on /proc/<pid>/<name>. It drops to
* uid 1000 and enters a new user namespace with a new mount namespace, so that
* the mask is locked. Then one task looks the name up:
*
* stat the container calls stat() on the name * umount the container calls umount2(MNT_DETACH) on the name * nobody a task with uid 65534 in the first namespaces calls stat()
*
* The container lists its mounts before and after (that does not look the
* name up) and then reads the name. MASK is fine. Anything else means that
* the lookup uncovered the entry.
*
* usage: procnet <name> stat|umount|nobody
* name "status" is the control, "net/dev" is a file below net, "net/stat" is
* a directory below net
*/
#define _GNU_SOURCE
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#define WORK "/run/pn"
static char target[128];
static void die(const char *what)
{
fprintf(stderr, "FATAL %s: %s\n", what, strerror(errno));
exit(2);
}
static void write_str(const char *path, const char *s, int flags)
{
int fd = open(path, O_WRONLY | flags, 0644);
if (fd < 0 || write(fd, s, strlen(s)) < 0)
die(path);
close(fd);
}
/* list the mounts below /proc without a lookup of the target */
static void mounts(const char *when)
{
char line[512];
FILE *f = fopen("/proc/self/mountinfo", "r");
int n = 0;
if (!f)
die("mountinfo");
while (fgets(line, sizeof(line), f)) {
if (!strstr(line, " /proc/"))
continue;
printf("container: %s: mount: %s", when, line);
n++;
}
fclose(f);
if (!n)
printf("container: %s: nothing is mounted below /proc\n", when);
}
static void show(const char *when, int isdir)
{
char buf[48] = "";
int fd;
if (isdir) {
struct dirent *de;
DIR *d = opendir(target);
int hit = 0;
if (!d) {
printf("container: %s: opendir(%s) = %s\n", when, target, strerror(errno));
return;
}
printf("container: %s: readdir(%s) =", when, target);
while ((de = readdir(d))) {
if (de->d_name[0] == '.')
continue;
printf(" %s", de->d_name);
hit |= strcmp(de->d_name, "MASK");
}
closedir(d);
printf("%s\n", hit ? " <-- HIT" : "");
return;
}
fd = open(target, O_RDONLY);
if (fd < 0) {
printf("container: %s: open(%s) = %s\n", when, target, strerror(errno));
return;
}
if (read(fd, buf, sizeof(buf) - 1) < 0)
die("read");
close(fd);
if (strchr(buf, '\n'))
*strchr(buf, '\n') = 0;
printf("container: %s: read(%s) = \"%s\"%s\n", when, target, buf,
strncmp(buf, "MASK", 4) ? " <-- HIT" : "");
}
int main(int argc, char **argv)
{
const char *name = argc > 1 ? argv[1] : "net/dev";
const char *op = argc > 2 ? argv[2] : "stat";
int isdir = !strcmp(name, "net/stat");
int to_host[2], to_cont[2];
struct stat st;
pid_t pid;
char c;
setvbuf(stdout, NULL, _IOLBF, 0);
snprintf(target, sizeof(target), "/proc/%d/%s", getpid(), name);
if (unshare(CLONE_NEWNS) || mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL))
die("unshare");
mkdir(WORK, 0755);
if (mount("W", WORK, "tmpfs", 0, NULL))
die("mount W");
write_str(WORK "/mask", "MASK", O_CREAT);
mkdir(WORK "/maskdir", 0755);
write_str(WORK "/maskdir/MASK", "MASK", O_CREAT);
if (pipe(to_host) || pipe(to_cont))
die("pipe");
pid = fork();
if (pid < 0)
die("fork");
if (!pid) {
if (unshare(CLONE_NEWNS))
die("container unshare");
if (mount(isdir ? WORK "/maskdir" : WORK "/mask", target, NULL, MS_BIND, NULL)) {
printf("container: bind the mask on %s: %s\n", target, strerror(errno));
exit(0);
}
printf("container: bind the mask on %s: ok\n", target);
if (setgid(1000) || setuid(1000) || prctl(PR_SET_DUMPABLE, 1))
die("setuid");
/* lock the mount: a new user namespace with a copy of the tree */
if (unshare(CLONE_NEWUSER | CLONE_NEWNS))
die("container userns");
write_str("/proc/self/setgroups", "deny", 0);
write_str("/proc/self/uid_map", "0 1000 1", 0);
write_str("/proc/self/gid_map", "0 1000 1", 0);
mounts("before");
errno = 0;
if (!strcmp(op, "stat")) {
stat(target, &st);
printf("container: stat(%s): %s\n", target, strerror(errno));
} else if (!strcmp(op, "umount")) {
umount2(target, MNT_DETACH);
printf("container: umount2(%s, MNT_DETACH): %s\n", target, strerror(errno));
} else if (write(to_host[1], "g", 1) != 1 || read(to_cont[0], &c, 1) != 1) {
die("sync");
}
mounts("after");
show("after", isdir);
exit(0);
}
close(to_host[1]);
if (read(to_host[0], &c, 1) == 1) {
pid_t p2 = fork();
if (!p2) {
if (setgid(65534) || setuid(65534))
die("setuid");
errno = 0;
stat(target, &st);
printf("nobody: uid %u: stat(%s): %s\n", getuid(), target, strerror(errno));
exit(0);
}
waitpid(p2, NULL, 0);
if (write(to_cont[1], "g", 1) != 1)
die("sync");
}
waitpid(pid, NULL, 0);
return 0;
}--- fs/proc/generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/proc/generic.c +3 -2
@@ -256,9 +256,10 @@ struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry, inode =proc_get_inode (dir->i_sb, de);if (!inode)return ERR_PTR (-ENOMEM ); +/* never reused and so never a mountpoint for long */ if (de->flags &PROC_ENTRY_FORCE_LOOKUP ) -return d_splice_alias_ops (inode, dentry, - &proc_net_dentry_ops); +return proc_splice_unmountable (inode, dentry, + &proc_net_dentry_ops);return d_splice_alias_ops (inode, dentry, &proc_misc_dentry_ops); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1233/1257 tcp: check congestion control restriction first
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhiling Zou <[email protected]>
[ Upstream commit dda51b73721684637ab8e9bd97c78228b99c4bd2 ]
tcp_set_default_congestion_control() takes a reference to an algorithm before checking whether a non-init network namespace may select it. A rejected request returns -EPERM without dropping the reference.
This affects module-backed algorithms too; BPF is not required. For example, after root loads tcp_bbr, a user with CAP_NET_ADMIN in a non-init network namespace can repeatedly request it as the default although it is not in tcp_allowed_congestion_control. Each rejected write leaks a module reference. Since module->refcnt is an atomic_t, 2^31 such writes can make it negative; later module_put() calls warn, and rmmod can hit the BUG_ON() in try_release_module_ref().
Check the namespace restriction before acquiring the reference, as tcp_set_congestion_control() already does.
--- net/ipv4/tcp_cong.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_cong.c +2 -2
@@ -288,12 +288,12 @@ int tcp_set_default_congestion_control(struct net *net, const char *name) ca =tcp_ca_find_autoload (name);if (!ca) { ret = -ENOENT ; - }else if (!bpf_try_module_get (ca, ca->owner)) { - ret = -EBUSY ; }else if (!net_eq (net, &init_net) && !(ca->flags &TCP_CONG_NON_RESTRICTED )) {/* Only init netns can set default to a restricted algorithm */ ret = -EPERM ; + }else if (!bpf_try_module_get (ca, ca->owner)) { + ret = -EBUSY ; }else { prev =xchg (&net->ipv4.tcp_congestion_control, ca);if (prev)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1234/1257 nstree: dont end listns() at an inactive namespace
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit da29ac46d34a19e8cc328ad17cb88713fd4563fa ]
listns() resumes after the last returned id by looking up the first namespace with a larger id with lookup_ns_id_after(), or with lookup_ns_owner_after() when filtering by owner. Both also take a reference with ns_get_unless_inactive(). If that namespace is inactive, e.g. a network namespace that is only pinned by a socket or a user namespace that is only pinned by a file's credentials, or if it is being torn down, the lookup returns NULL and listns() fails with -ENOENT. Userspace takes that as the end of the list, so every namespace after it is silently missed:
ids 10 (active), 11 (inactive), 12 (active)
listns(ns_id = 0, nr = 1) -> 10
listns(ns_id = 10, nr = 1) -> lookup_ns_id_after(10) -> NULL, -ENOENT 12 is never listed
A call without a cursor doesn't have this problem because the loop just skips the namespaces that legitimize_ns() rejects.
The reference only kept the starting point valid until the RCU walk began. Look it up under rcu_read_lock() instead, without taking a reference. The namespace can't be freed before the RCU read-side section ends, and if it is unlinked in the meantime its ->next still leads back into the list, which the walk already relies on for every other entry. The starting namespace then goes through legitimize_ns() like every other one, and kls->first_ns isn't needed anymore.
--- kernel/nstree.c | 55 +++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 27 deletions(-)
kernel/nstree.c +28 -27
@@ -408,15 +408,12 @@ struct klistns {u32 ns_type;struct user_namespace *user_ns;bool userns_capable; -struct ns_common *first_ns; };static void __free_klistns_free (const struct klistns *kls) {if (kls->user_ns_id !=LISTNS_CURRENT_USER )put_user_ns (kls->user_ns); -if (kls->first_ns && kls->first_ns->ops) - kls->first_ns->ops->put (kls->first_ns); }#define NS_ALL (PID_NS | USER_NS | MNT_NS | UTS_NS | IPC_NS | NET_NS | CGROUP_NS | TIME_NS)
@@ -461,6 +458,9 @@ static inline int prepare_klistns(struct klistns *kls, struct ns_id_req *kreq,/* * Lookup a namespace owned by owner with id > ns_id. * Returns the namespace with the smallest id that is > ns_id. +* +* No reference is taken. The caller must hold rcu_read_lock() and may only +* use the result as the starting point of an RCU list walk. */ static struct ns_common *lookup_ns_owner_after (u64 ns_id,struct ns_common *owner) {
@@ -484,8 +484,6 @@ static struct ns_common *lookup_ns_owner_after(u64 ns_id, struct ns_common *owne } } -if (ret) - ret =ns_get_unless_inactive (ret);return ret; }
@@ -558,25 +556,27 @@ static ssize_t do_listns_userns(struct klistns *kls)return -EINVAL ; kls->user_ns =to_user_ns (ns); -/* -* Use the rbtree to find the first namespace we care about and -* then use it's list entry to iterate from there. -*/ -if (kls->last_ns_id) { - kls->first_ns =lookup_ns_owner_after (kls->last_ns_id, ns); -if (!kls->first_ns) -return -ENOENT ; - first_ns = kls->first_ns; - } - ret =0 ; head = &to_ns_common (kls->user_ns)->ns_owner_root.ns_list_head; kls->userns_capable =may_see_all_namespaces ();rcu_read_lock (); -if (!first_ns) +/* +* Use the rbtree to find the first namespace we care about and +* then use it's list entry to iterate from there. That namespace +* is filtered like any other, so the walk doesn't end early just +* because it is inactive or already dying. +*/ +if (kls->last_ns_id) { + first_ns =lookup_ns_owner_after (kls->last_ns_id, ns); +if (!first_ns) { +rcu_read_unlock (); +return -ENOENT ; + } + }else { first_ns =list_entry_rcu (head->next,typeof (*first_ns), ns_owner_node.ns_list_entry); + } ns = first_ns;list_for_each_entry_from_rcu (ns, head, ns_owner_node.ns_list_entry) {
@@ -613,6 +613,9 @@ static ssize_t do_listns_userns(struct klistns *kls)/* * Lookup a namespace with id > ns_id in either the unified tree or a type-specific tree. * Returns the namespace with the smallest id that is > ns_id. +* +* No reference is taken. The caller must hold rcu_read_lock() and may only +* use the result as the starting point of an RCU list walk. */ static struct ns_common *lookup_ns_id_after (u64 ns_id,int ns_type) {
@@ -649,8 +652,6 @@ static struct ns_common *lookup_ns_id_after(u64 ns_id, int ns_type) } } -if (ret) - ret =ns_get_unless_inactive (ret);return ret; }
@@ -700,13 +701,6 @@ static ssize_t do_listns(struct klistns *kls)return -EINVAL ; } -if (kls->last_ns_id) { - kls->first_ns =lookup_ns_id_after (kls->last_ns_id, ns_type); -if (!kls->first_ns) -return -ENOENT ; - first_ns = kls->first_ns; - } - ret =0 ;if (ns_tree) head = &ns_tree->ns_list_head;
@@ -715,8 +709,15 @@ static ssize_t do_listns(struct klistns *kls)rcu_read_lock (); -if (!first_ns) +if (kls->last_ns_id) { + first_ns =lookup_ns_id_after (kls->last_ns_id, ns_type); +if (!first_ns) { +rcu_read_unlock (); +return -ENOENT ; + } + }else { first_ns =first_ns_common (head, ns_tree); + }for (ns = first_ns; !ns_common_is_head (ns, head, ns_tree) && nr_ns_ids; ns =next_ns_common (ns, ns_tree)) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1235/1257 pidfs: dont let PIDFD_GET_INFO miss a reaped task
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit 172658cf600904ff6121e240f69a0ccb36e65d6b ]
PIDFD_GET_INFO describes the task while there is one, and with PIDFD_INFO_EXIT its exit status once it has been reaped. pidfd_info() looks at the two in the wrong order and can miss both:
pidfd_info() release_task()
PIDFS_ATTR_BIT_EXIT is not set
pidfs_exit()
__unhash_process()
get_pid_task() == NULL
goto copy_outThe ioctl succeeds with neither PIDFD_INFO_PID nor PIDFD_INFO_EXIT in the mask. If the task is unhashed a little later, after get_pid_task(), its pid reads as 0 and the ioctl fails with -ESRCH, although the caller asked for the exit information and it is available by now.
The second case does not even need an exit. When a sub-thread execs, de_thread() hands the leader's pid over to it and releases the old leader. A caller that got hold of the old leader reports the tid of the sub-thread as the pid, or -ESRCH for a process that is alive.
Look up the task first. pidfs_exit() runs before the task is unhashed, so a caller that finds no task finds the exit information; this needs a barrier on both sides because taking tasklist_lock does not order the store in pidfs_exit() against the one in detach_pid(). And start over if the task no longer owns the pid when all the fields have been read: then there is either exit information or another task.
Go by the pid for that check and for the pid we report, not by ->thread_pid of the task. exchange_tids() moves the pid to the exec'ing thread before it updates ->thread_pid of either task. A caller that finds the new leader in between would read the old tid of the sub-thread from ->thread_pid, and a check of ->thread_pid would restart until the exec'ing thread gets to its store. On PREEMPT_RT that thread can be preempted with tasklist_lock held and can't move to another CPU. If the RT task that preempted it calls PIDFD_GET_INFO, the ioctl spins until the exec'ing thread gets the CPU back, and that never happens if the exec'ing thread is an RT task of lower priority.
Christian Brauner <[email protected]> says:
Go by @pid instead of ->thread_pid of the task for the reported pid and for the restart check.
--- fs/pidfs.c | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-)
fs/pidfs.c +37 -6
@@ -362,6 +362,12 @@ static __u32 pidfs_coredump_mask(enum task_dumpable dumpable) PIDFD_INFO_COREDUMP_SIGNAL | \ PIDFD_INFO_COREDUMP_CODE) +static bool pidfs_task_owns_pid (struct task_struct *task,struct pid *pid) +{ +guard (rcu)(); +return pid_task (pid,PIDTYPE_PID ) == task; +} +static long pidfd_info (struct file *file,unsigned int cmd,unsigned long arg) {struct pidfd_info __user *uinfo = (struct pidfd_info __user *)arg;
@@ -392,6 +398,16 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)return -EREMOTE ; attr =READ_ONCE (pid->attr); +again: +/* +* Look for the task first. pidfs_exit() records the exit information +* before the task is unhashed, so if the task is gone the information +* is there. +*/ + task =get_pid_task (pid,PIDTYPE_PID ); +if (!task) +smp_rmb ();/* pairs with smp_mb__after_atomic() in pidfs_exit() */ +if (mask &PIDFD_INFO_EXIT ) {if (test_bit (PIDFS_ATTR_BIT_EXIT , &attr->attr_mask)) {smp_rmb ();
@@ -414,7 +430,6 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg) } } - task =get_pid_task (pid,PIDTYPE_PID );if (!task) {/* * If the task has already been reaped, only exit
@@ -468,16 +483,27 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)* task might return as soon as the copy_to_user finishes, but that's ok * and userspace expects that might happen and can act accordingly, so * this is just best-effort. What we can do however is checking that all -* the fields are set correctly, or return ESRCH to avoid providing -* incomplete information. */ +* the fields are set correctly, to avoid providing incomplete +* information. +*/ kinfo.ppid =task_ppid_vnr (task); kinfo.tgid =task_tgid_vnr (task); - kinfo.pid =task_pid_vnr (task); + kinfo.pid =pid_vnr (pid); kinfo.mask |=PIDFD_INFO_PID ; -if (kinfo.pid ==0 || kinfo.tgid ==0 ) -return -ESRCH ; +/* +* The task was reaped, or lost @pid to a sub-thread that called exec, +* while we were looking at it. Start over: there is exit information +* now, or a new task. Don't go by ->thread_pid, exchange_tids() +* updates it only after it has moved @pid. +*/ +if (!pidfs_task_owns_pid (task, pid) || kinfo.tgid ==0 ) { +put_task_struct (task); + task =NULL ; +memset (&kinfo,0 ,sizeof (kinfo)); + goto again; + } copy_out:if (mask &PIDFD_INFO_SUPPORTED_MASK ) {
@@ -790,6 +816,11 @@ void pidfs_exit(struct task_struct *tsk)/* Ensure that PIDFD_GET_INFO sees either all or nothing. */ smp_wmb ();set_bit (PIDFS_ATTR_BIT_EXIT , &attr->attr_mask); +/* +* Whoever sees that the task is unhashed must see the bit, see +* pidfd_info(). Taking tasklist_lock does not order the two stores. +*/ +smp_mb__after_atomic (); }#ifdef CONFIG_COREDUMP
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1236/1257 apparmor: fix refcount leak in aa_get_newest_profile()
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Johansen <[email protected]>
[ Upstream commit 33ed50716251d5b2875706c40d0c8082d46be0b1 ]
The labels_profile() macro is evaluating its argument twice
#define labels_profile(X) ((X)->vec[(X)->size - 1])
unfortunately aa_get_newest_profile() passes
aa_get_newest_label(&p->label)
so every call to aa_get_newest_profile results in 2 refcounts being taken with one being leaked.
There is no need for labels_profile() to be a macro. Convert it to an inline fn, which ensures all uses are passing the correct struct and removes the double evaluation.
--- security/apparmor/include/label.h | 6 +++++- security/apparmor/label.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-)
security/apparmor/include/label.h +5 -1
@@ -162,7 +162,11 @@ do { \#define labels_ns (X ) (vec_ns(&((X)->vec[0]), (X)->size))#define labels_set (X ) (&labels_ns(X)->labels)#define labels_view (X ) labels_ns(X) -#define labels_profile (X ) ((X)->vec[(X)->size - 1]) + +static inline struct aa_profile *labels_profile (const struct aa_label *label) +{ +return label->vec[label->size -1 ]; +}int aa_label_next_confined (const struct aa_label *l,int i);
security/apparmor/label.c +0 -1
@@ -387,7 +387,6 @@ void aa_label_kref(struct kref *kref)label_free_switch (label);return ; } -/* TODO: update labels_profile macro so it works here */ AA_BUG (label_isprofile (label) &&on_list_rcu (&label->vec[0 ]->base.profiles)); AA_BUG(label_isprofile(label) &&
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1237/1257 apparmor: avoid potential double free when remapping DFA tables
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <[email protected]>
[ Upstream commit 7ccd884a5e5386f4c7d98625113f4924f70286b4 ]
When unpacking a DFA, aa_dfa_unpack() stores a table in dfa->tables before attempting to remap a 16-bit table to 32-bit.
However, remap_data16_to_data32() frees the original table when allocation of the new table fails. This leaves the corresponding dfa->tables entry pointing to freed memory. If the unpacking then fails, dfa_free() attempts to free the same table again.
Only publish the table to dfa->tables after any required remapping has completed successfully, so that dfa->tables never contains a pointer to a table that has already been freed.
--- security/apparmor/match.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
security/apparmor/match.c +1 -2
@@ -397,7 +397,6 @@ struct aa_dfa *aa_dfa_unpack(const void *blob, size_t size, int flags)/* check for duplicate table entry */ if (dfa->tables[table->td_id]) goto fail; - dfa->tables[table->td_id] = table; data +=table_size (table->td_lolen, table->td_flags); size -=table_size (table->td_lolen, table->td_flags);
@@ -414,9 +413,9 @@ struct aa_dfa *aa_dfa_unpack(const void *blob, size_t size, int flags)if (!table) goto fail; } - dfa->tables[table->td_id] = table;break ; } + dfa->tables[table->td_id] = table; table =NULL ; } error =verify_table_headers (dfa->tables, flags);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1238/1257 apparmor: check accept index + 1 is in bounds
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanglei Zhu <[email protected]>
[ Upstream commit afe5d5a747393cb3d00795db31d7fce5108a766a ]
aa_lookup_condperms() returns perms[index + 1] when an accept entry has ACCEPT_FLAG_OWNER set and the subject uid does not match the file uid, so such an entry consumes two slots in the perms table. But verify_dfa_accept_index() only checks that index is within the perms table, so a policy that sets the owner flag on the last entry is accepted, and the runtime lookup then reads perms[index + 1] one entry past the end of the table.
The perms table is allocated by unpack_perms_table() with a u16 size read from the policy blob, so a crafted policy can place the owner flag at index size - 1 to reach the out-of-bounds read.
Check that index + 1 is also in bounds when the owner flag is set.
--- security/apparmor/policy_unpack.c | 9 +++++++++ 1 file changed, 9 insertions(+)
security/apparmor/policy_unpack.c +9 -0
@@ -1489,6 +1489,15 @@ static bool verify_dfa_accept_index(const struct aa_dfa *dfa, int table_size)for (i =0 ; i < dfa->tables[YYTD_ID_ACCEPT ]->td_lolen; i++) {if (ACCEPT_TABLE (dfa)[i] >= table_size)return false; +/* +* Accept indexes for owner-conditional permissions come in +* pairs, so the non-owner entry at index + 1 must also be +* in bounds. +*/ +if (dfa->tables[YYTD_ID_ACCEPT2 ] && + (ACCEPT_TABLE2 (dfa)[i] &ACCEPT_FLAG_OWNER ) && +ACCEPT_TABLE (dfa)[i] +1 >= table_size) +return false; }return true; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1239/1257 net/packet: check TX_RING fragments before memory accounting
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <[email protected]>
[ Upstream commit dc4dd12f80e499dc034710cd8195489abcf0b059 ]
tpacket_fill_skb() adds the full non-linear payload length to skb->truesize and sk_wmem_alloc before checking MAX_SKB_FRAGS. With PACKET_VNET_HDR, userspace can submit a ring-sized frame even when it greatly exceeds the device MTU.
A near-INT_MAX frame can saturate sk_wmem_alloc before the fragment loop rejects it. A subsequent refcount_add(0x40000001) can temporarily turn REFCOUNT_SATURATED into 1. A concurrent TX completion can then drop that apparent last reference and free the still-live packet socket before refcount_warn_saturate() restores the counter.
Check that the remaining payload fits in MAX_SKB_FRAGS pages before accounting it. Include the initial page offset in the calculation, and move the existing -EFAULT handling out of the fragment loop. This preserves the accepted packet sizes and error code while preventing an invalid frame from injecting an oversized byte charge.
--- net/packet/af_packet.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/packet/af_packet.c +6 -6
@@ -2647,6 +2647,12 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, } offset =offset_in_page (data); +if (unlikely (to_write >MAX_SKB_FRAGS *PAGE_SIZE - offset)) { +net_warn_ratelimited ("Packet exceed the number of skb frags(%u)\n" , + (unsigned int )MAX_SKB_FRAGS ); +return -EFAULT ; + } + len_max =PAGE_SIZE - offset; len = ((to_write > len_max) ? len_max : to_write);
@@ -2658,12 +2664,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,while (likely (to_write)) { nr_frags =skb_shinfo (skb)->nr_frags; -if (unlikely (nr_frags >=MAX_SKB_FRAGS )) { -pr_err ("Packet exceed the number of skb frags(%u)\n" , - (unsigned int )MAX_SKB_FRAGS ); -return -EFAULT ; - } - page =pgv_to_page (data); data += len;flush_dcache_page (page);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1240/1257 tcp: fix reordering addition overflow in MTU probing
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <[email protected]>
[ Upstream commit c1df9c0c0536393de43310f84ca4f8b217271a00 ]
Commit efb8763d7bbb ("net: ipv4: bound TCP reordering sysctl writes and MTU probe sizes") widened size_needed and the MSS multiplication, but tp->reordering + 1 is still evaluated as u32. RTAX_REORDERING accepts an unrestricted u32, and tcp_init_metrics() can install U32_MAX.
In that case the extra-data requirement becomes zero. A write queue with probe_size - 1 data bytes and a FIN satisfies the sequence-space check. The coalescing walk can pass the queue head to tcp_skb_can_collapse(), and tcp_clone_payload() can produce an skb whose advertised payload exceeds the data in its fragments. Local delivery followed by TCP_ZEROCOPY_RECEIVE can then walk beyond the fragment array. KASAN reports a slab-out-of-bounds read in can_map_frag().
Cast reordering before incrementing it so the arithmetic handles the entire u32 metric range. For U32_MAX, the required size exceeds the 32-bit queue and window limits, so the existing checks skip the probe. The calculation is unchanged for all other reordering values.
--- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_output.c +1 -1
@@ -2712,7 +2712,7 @@ static int tcp_mtu_probe(struct sock *sk) mss_now =tcp_current_mss (sk); probe_size =tcp_mtu_to_mss (sk, (icsk->icsk_mtup.search_high + icsk->icsk_mtup.search_low) >>1 ); - size_needed = probe_size + (tp->reordering +1 ) * (u64 )tp->mss_cache; + size_needed = probe_size + ((u64 )tp->reordering +1 ) * tp->mss_cache; interval = icsk->icsk_mtup.search_high - icsk->icsk_mtup.search_low;/* When misfortune happens, we are reprobing actively, * and then reprobe timer has expired. We stick with current
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1241/1257 apparmor: fix query_data() output overlapping the lookup key
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft) <[email protected]>
[ Upstream commit d30844001360a403a511cf24fc75ecaa6a7a7544 ]
In query_data(), buf and query point into the same multi_transaction
buffer: buf at the start, query a few bytes in, and the lookup key right after the label string that query points to. Reusing the buffer is by design and is safe as long as the query is fully parsed before buf is written to, but the key is not: it is dereferenced on every iteration of label_for_each_confined(), after output has already been written. So when the label has more than one profile with a data table, the data of the first matching profile is written to buf while the key is still needed, and overwrites it if the data is large enough. The later lookups then run on a corrupted key. Besides, if the data has no NUL byte from the key's position to the end of the allocation, strhash() -> strlen() -> jhash() reads past the 4096-byte slab object, triggering an out-of-bound read:
BUG: KASAN: slab-out-of-bounds in jhash+0x595/0x5e0 Read of size 1 at addr ff1100001159d000 by task exploit/155 CPU: 0 UID: 1000 PID: 155 Comm: exploit Not tainted 7.3.0-rc7 #1 Call Trace: jhash+0x595/0x5e0 aa_write_access+0x880/0x1400 vfs_write+0x26f/0xd20 ksys_write+0x115/0x210
Writing to the .access file is unprivileged (0666), but triggering this requires loaded profiles that carry a data table, which needs CAP_MAC_ADMIN and is not the case on default distribution policies.
Fix by copying the key with kstrdup() before writing any output to buf, so the key stays valid across all loop iterations regardless of what gets written to the overlapping buffer.
--- security/apparmor/apparmorfs.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
security/apparmor/apparmorfs.c +12 -3
@@ -919,7 +919,7 @@ static void profile_query_cb(const struct aa_profile *profile,static ssize_t query_data (char *buf,size_t buf_len,char *query,size_t query_len) { -char *out; +char *out, *keydup;const char *key;struct label_it i;struct aa_label *label, *curr;
@@ -941,11 +941,18 @@ static ssize_t query_data(char *buf, size_t buf_len,if (buf_len <sizeof (bytes) +sizeof (blocks))return -EINVAL ;/* not enough space */ +/* buf overlaps query, keep a copy of the key for the later lookups */ + keydup =kstrdup (key,GFP_KERNEL ); +if (!keydup) +return -ENOMEM ; + curr =begin_current_label_crit_section (&needput); label =aa_label_parse (curr, query,GFP_KERNEL , false, false);end_current_label_crit_section (curr, needput); -if (IS_ERR (label)) +if (IS_ERR (label)) { +kfree (keydup);return PTR_ERR (label); + }/* We are going to leave space for two numbers. The first is the total * number of bytes we are writing after the first number. This is so
@@ -963,13 +970,14 @@ static ssize_t query_data(char *buf, size_t buf_len,if (!profile->data)continue ; - data =rhashtable_lookup_fast (profile->data, &key, + data =rhashtable_lookup_fast (profile->data, &keydup, profile->data->p);if (data) {if (out +sizeof (outle32) + data->size > buf + buf_len) {aa_put_label (label); +kfree (keydup);return -EINVAL ;/* not enough space */ } outle32 =__cpu_to_le32 (data->size);
@@ -981,6 +989,7 @@ static ssize_t query_data(char *buf, size_t buf_len, } }aa_put_label (label); +kfree (keydup); outle32 =__cpu_to_le32 (out - buf -sizeof (bytes));memcpy (buf, &outle32,sizeof (outle32));
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1242/1257 apparmor: remove fs entries created by a failed policy load
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georgia Garcia <[email protected]>
[ Upstream commit 6ec46f8f1977d218bf2494ce276152b2d01424af ]
aa_replace_profiles() creates the raw_data/<rev> directory for the loaddata and the profile directories for new profiles before the last checks that can fail. When one of those checks fails, the fail path releases the ns lock without removing what this load created.
The raw_data directory is named after the current ns revision, and the revision is only bumped by a successful load. The stale directory is only removed once the loaddata's last profile reference is dropped, from a workqueue. Until then, every load fails to create raw_data/<rev> with -EEXIST. If the new profiles are never freed, which is the case when their dents are left behind pinning the proxy, that never happens and no policy can be loaded until reboot.
While still holding the ns lock in the fail path, remove the profile directories of the new profiles and, if this load created it, the raw_data directory.
--- security/apparmor/policy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
security/apparmor/policy.c +14 -0
@@ -1191,6 +1191,7 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,struct aa_loaddata *rawdata_ent;const char *op;ssize_t count, error; +bool rawdata_created = false;LIST_HEAD (lh); op = mask &AA_MAY_REPLACE_POLICY ?OP_PROF_REPL :OP_PROF_LOAD ;
@@ -1330,6 +1331,7 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label, ent =NULL ; goto fail_lock; } + rawdata_created = true; }list_for_each_entry (ent, &lh, list) {if (!ent->old) {
@@ -1425,6 +1427,18 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,return udata_sz; fail_lock: +/* +* Remove fs entries created by this load. Nothing else references +* them yet, and leaving them behind would leak the new profiles +* (their dents pin the proxy) and make the next load at the same, +* unbumped ns revision fail with -EEXIST on its raw_data dir. +*/ +list_for_each_entry (tmp, &lh, list) { +if (!tmp->old) +__aafs_profile_rmdir (tmp->new); + } +if (rawdata_created) +__aa_fs_remove_rawdata (udata);mutex_unlock (&ns->lock);/* audit cause of failure */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1243/1257 apparmor: fix profile leak when a policy load fails
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georgia Garcia <[email protected]>
[ Upstream commit ce94927fa4173fcc1eca27bdc65a140064c8f1e6 ]
The error paths of aa_replace_profiles() and aa_unpack() do not break the refcount cycle between label and proxy. They just aa_put_profile() the new profiles, which drops the label refcount from 2 to 1, and the proxy keeps the profile alive. Every failed atomic policy load (e.g. "profile can not be replaced", or a later profile in the blob failing to unpack) leaks every new profile in the set, along with its proxy, rules and its loaddata reference.
The leak is usually not visible from userspace, because the raw_data directory for a failed load is not created, but it becomes visible when the blob is deduplicated onto an existing loaddata, which then keeps its policy/raw_data/<rev> directory forever.
Add aa_put_unpublished_profile(), which drops the profile's own proxy before putting the profile, and use it on those error paths. The proxy of an unpacked profile is always freshly allocated and not referenced by anything else before the profile is published, so putting it is safe.
--- security/apparmor/include/policy.h | 20 ++++++++++++++++++++ security/apparmor/policy.c | 3 +++ security/apparmor/policy_unpack.c | 4 +++- 3 files changed, 26 insertions(+), 1 deletion(-)
security/apparmor/include/policy.h +20 -0
@@ -436,6 +436,26 @@ static inline void aa_put_profile(struct aa_profile *p)kref_put (&p->label.count.count, aa_label_kref); } +/** +* aa_put_unpublished_profile - put a profile that was never made visible +* @p: profile (MAYBE NULL) +* +* A newly allocated profile and its proxy reference each other +* (proxy->label holds a label refcount). That cycle is normally broken +* when the profile is replaced or removed, which redirects the proxy. +* A profile that is discarded before being added to the policy tree +* never goes through either path, so break the cycle here, otherwise +* the profile, its proxy and its rawdata are leaked. +*/ +static inline void aa_put_unpublished_profile (struct aa_profile *p) +{ +if (p && p->label.proxy) { +aa_put_proxy (p->label.proxy); + p->label.proxy =NULL ; + } +aa_put_profile (p); +} +static inline int AUDIT_MODE (const struct aa_profile *profile) {if (aa_g_audit !=AUDIT_NORMAL )
security/apparmor/policy.c +3 -0
@@ -1460,6 +1460,9 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label, }list_for_each_entry_safe (ent, tmp, &lh, list) {list_del_init (&ent->list); +/* new was never added to the policy tree */ +aa_put_unpublished_profile (ent->new); + ent->new =NULL ;aa_load_ent_free (ent); }
security/apparmor/policy_unpack.c +3 -1
@@ -1816,13 +1816,15 @@ int aa_unpack(struct aa_loaddata *udata, struct list_head *lh, fail_profile:kfree (ns_name); -aa_put_profile (profile); +aa_put_unpublished_profile (profile); fail:if (compressed_data)kvfree (compressed_data);list_for_each_entry_safe (ent, tmp, lh, list) {list_del_init (&ent->list); +aa_put_unpublished_profile (ent->new); + ent->new =NULL ;aa_load_ent_free (ent); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1244/1257 arm64/gcs: release GCS on failed fork
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iván Ezequiel Rodriguez <[email protected]>
[ Upstream commit 078e122f3bf000dd45965997b66deac10ee580fa ]
copy_thread() can map a CLONE_VM GCS and still return 0. A later copy_process() failure calls exit_thread(), but arm64 did not implement it, so the VMA stayed in the parent's mm. Wire HAVE_EXIT_THREAD to gcs_free().
Kernel threads created with CLONE_VM (io_uring and vhost workers) inherit the parent's gcs_base/gcs_size from arch_dup_task_struct() without allocating their own GCS. When such a thread exits, exit_mm() -> mm_release() -> deactivate_mm() -> gcs_free() unmaps the parent's GCS. With the new exit_thread(), a failed copy_process() for one of these threads would do the same. Clear these fields in copy_thread().
--- arch/arm64/Kconfig | 1 + arch/arm64/kernel/process.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+)
arch/arm64/Kconfig +1 -0
@@ -198,6 +198,7 @@ config ARM64 select HAVE_SAMPLE_FTRACE_DIRECT_MULTI select HAVE_BUILDTIME_MCOUNT_SORT select HAVE_EFFICIENT_UNALIGNED_ACCESS + select HAVE_EXIT_THREAD select HAVE_GUP_FAST select HAVE_FTRACE_GRAPH_FUNC select HAVE_FUNCTION_TRACER
arch/arm64/kernel/process.c +17 -0
@@ -320,9 +320,18 @@ static int copy_thread_gcs(struct task_struct *p, return 0; } +static void gcs_reset_thread (struct task_struct *task) +{ + task->thread.gcs_base =0 ; + task->thread.gcs_size =0 ; + task->thread.gcspr_el0 =0 ; +} +#else static void flush_gcs (void ) { } +static void gcs_reset_thread (struct task_struct *task) { } +static int copy_thread_gcs (struct task_struct *p,const struct kernel_clone_args *args) {
@@ -341,6 +350,12 @@ void flush_thread(void)flush_gcs (); } +void exit_thread (struct task_struct *tsk) +{ +/* Failed fork after copy_thread(); deactivate_mm() does not run. */ +gcs_free (tsk); +} +void arch_release_task_struct (struct task_struct *tsk) {fpsimd_release_task (tsk);
@@ -503,6 +518,8 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) p->thread.cpu_context.x19 = (unsigned long )args->fn; p->thread.cpu_context.x20 = (unsigned long )args->fn_arg; +/* Kernel threads sharing the parent's mm must not free its GCS. */ +gcs_reset_thread (p);if (system_supports_poe ()) p->thread.por_el0 =POR_EL0_INIT ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1245/1257 aio: fix NULL deref when a fault races ring truncation
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <[email protected]>
[ Upstream commit d53b5aa5cfae27e4d236fc0ab9581085d27f7d33 ]
The aio ring lives in a file on the aio pseudo filesystem and the ring VMA uses filemap_fault(). aio_ctx_aops doesn't have a ->read_folio because aio_setup_ring() puts all folios of the ring into the page cache. So a fault on the ring only works as long as it finds its folio in the page cache. If it doesn't, filemap_fault() calls ->read_folio without checking and we jump to NULL.
We already fixed this twice this year. A forked child could inherit the ring mapping, fixed by commit c03ce4173c7b ("fs: aio: set VMA_DONTCOPY_BIT in mmap to fix NULL-pointer-dereference error"). And a partial mremap() could leave part of the ring mapped, fixed by commit 3adf7ae18bf4 ("fs: aio: reject partial mremap to avoid Null-pointer-dereference error"). Both times a VMA outlived the ring and the ring file was truncated under it.
There's a third way to get there. kill_ioctx() and the error path of ioctx_alloc() unmap the ring with vm_munmap() and ignore the return value. If vm_munmap() has to wait for mmap_lock and a fatal signal is pending it returns -EINTR and the VMA stays. free_ioctx() then calls put_aio_ring_file() which truncates the ring file to zero. A fault that passed the i_size check in filemap_fault() before that doesn't find its folio anymore, allocates a new one and calls ->read_folio:
fault on the ring io_destroy() with SIGKILL pending
================= =================================
vm_munmap() returns -EINTR
filemap_fault()
i_size check passes
free_ioctx()
put_aio_ring_file()
truncate_setsize(inode, 0)
no folio, allocate a new one
filemap_read_folio()
->read_folio == NULL
All that's needed is a second process that shares the mm. If a CLONE_VM child calls io_destroy() and gets SIGKILLed while it waits for mmap_lock the ring stays mapped for the threads of the parent. Any user can do that.
Instead of plugging the routes one by one give the ring a ->read_folio that unlocks the folio and returns -EIO. All folios of a live ring are in the page cache so a fault can only end up there if the ring was truncated. The fault now gets SIGBUS. Nothing else reads the ring file and the aio filesystem uses noop_backing_dev_info so there's no readahead either.
Making vm_munmap() unkillable in those two places would only close this one route and bring back what commit ae7987835643 ("mm: make vm_munmap killable") fixed.
--- fs/aio.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
fs/aio.c +11 -0
@@ -528,7 +528,18 @@ static int aio_migrate_folio(struct address_space *mapping, struct folio *dst,#define aio_migrate_folio NULL#endif +/* +* filemap_fault() reads a folio that it did not find in the page cache. All +* folios of a live ring are there, so the ring was truncated under the fault. +*/ +static int aio_read_folio (struct file *file,struct folio *folio) +{ +folio_unlock (folio); +return -EIO ; +} +static const struct address_space_operations aio_ctx_aops = { + .read_folio = aio_read_folio, .dirty_folio = noop_dirty_folio, .migrate_folio = aio_migrate_folio, };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1246/1257 backing-file: enforce append-only and immutable backing inodes
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit 19b18e01d0361ce495be153ecce80b581086ab3f ]
FUSE passthrough opens the backing file anew whenever the FUSE file is opened. fuse_passthrough_open() passes the flags of that open to backing_file_open() which opens the backing file with vfs_open() and the credentials of the server. But vfs_open() doesn't go through may_open(). So the backing inode is never checked for S_APPEND and S_IMMUTABLE. The checks that did run were done on the FUSE inode and that one never has either flag.
So anyone who may open the FUSE file for writing can overwrite an append-only backing file anywhere or write to an immutable one. The server only has to register the file and a read-only or even an O_PATH file descriptor is enough for that. Registering requires CAP_SYS_ADMIN but the writer can be any user that the server lets open the file.
The FUSE inode is checked instead of the backing inode in a few more places:
- do_mmap() refuses a shared mapping of an append-only file that was opened for writing. A FUSE file opened with O_RDWR | O_APPEND passes the open check and can then be mapped shared and written to at any offset.
- fcntl(F_SETFL) and RWF_NOAPPEND refuse to take append mode away from a file on an append-only inode. On the FUSE file both succeed. A synchronous write still appends because the backing file was opened with O_APPEND. But an asynchronous write is submitted with the flags of the user's kiocb and lands at the given offset.
Do the checks on the backing inode. backing_file_open() refuses to open an immutable inode for writing and an append-only inode for writing without O_APPEND, just like may_open(). backing_file_mmap() refuses a shared mapping of an append-only inode, just like do_mmap(). And writes and splices to a backing file in append mode fail if append mode was taken away from the user file.
A FUSE file that was opened before the backing file became append-only can still write anywhere. That's what happens on the native filesystem as well and the backing file of such a file isn't in append mode. Two differences remain. F_SETFL succeeds and the next write fails. And FUSE reports EIO for a refused open because it turns every error from opening the backing file into EIO.
overlayfs uses the same helpers but it mirrors S_APPEND and S_IMMUTABLE in its own inode and a chattr through the overlay never sets them on the upper inode. So for overlayfs this only changes something if the upper inode is changed behind the overlay's back.
--- fs/backing-file.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
fs/backing-file.c +28 -0
@@ -36,9 +36,21 @@ struct file *backing_file_open(const struct file *user_file, int flags, const struct cred *cred) {const struct path *user_path =file_user_path (user_file); +struct inode *real_inode =d_inode (real_path->dentry);struct file *f;int error; +/* +* may_open() checked the inode of the user file, which need not carry +* S_APPEND and S_IMMUTABLE of the backing inode. +*/ +if ((flags &O_ACCMODE ) !=O_RDONLY ) { +if (IS_IMMUTABLE (real_inode)) +return ERR_PTR (-EPERM ); +if (IS_APPEND (real_inode) && !(flags &O_APPEND )) +return ERR_PTR (-EPERM ); + } + f =alloc_empty_backing_file (flags, cred, user_file);if (IS_ERR (f))return f;
@@ -263,6 +275,14 @@ ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter,if (!iov_iter_count (iter))return 0 ; +/* +* F_SETFL and RWF_NOAPPEND can take append mode away from the user +* file. They checked its inode, not the backing one. +*/ +if ((file->f_flags &O_APPEND ) && !(flags &IOCB_APPEND ) && +IS_APPEND (file_inode (file))) +return -EPERM ; + ret =file_remove_privs (iocb->ki_filp);if (ret)return ret;
@@ -309,6 +329,10 @@ ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,if (!out->f_op->splice_write)return -EINVAL ; +/* splice refuses a user file in append mode, so F_SETFL cleared it */ +if ((out->f_flags &O_APPEND ) &&IS_APPEND (file_inode (out))) +return -EPERM ; + ret =file_remove_privs (iocb->ki_filp);if (ret)return ret;
@@ -338,6 +362,10 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,if (!can_mmap_file (file))return -ENODEV ; +/* do_mmap() checked the inode of the user file */ +if ((vma->vm_flags &VM_SHARED ) &&IS_APPEND (file_inode (file))) +return -EACCES ; +vma_set_file (vma, file); scoped_with_creds(ctx->cred) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1247/1257 iov_iter: fix NULL deref in iov_iter_alignment()
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <[email protected]>
[ Upstream commit a290a9e5cf5fbba05d6c59b94b36d00f4fc15ef2 ]
Since commit 111a12b422a8 ("io_uring/rsrc: reject zero-length fixed buffer import") io_import_fixed() hands out an empty ITER_BVEC for a zero-length request. Its count is 0 and its bvec array is NULL.
iov_iter_alignment() only checks the count for ITER_UBUF. For ITER_BVEC it calls iov_iter_alignment_bvec() and the do-while loop in there reads bvec->bv_len before it looks at the count. So it dereferences NULL.
btrfs checks the alignment of a direct read with iov_iter_alignment() before it looks at the count and f2fs does the same. So any user that can open a file on btrfs can oops the kernel with a single zero-length IORING_OP_READ_FIXED on an O_DIRECT file descriptor. With IOSQE_ASYNC the oops happens in an io-wq worker. The dead worker stays on the worker list and when the task that submitted the request exits io-wq writes to the freed task_struct of the worker. That's just fallout from the oops though.
Empty iterators with a NULL array aren't unusual. afs, tls and tipc create them as well. So leave io_uring alone and make iov_iter_alignment() return 0 for an empty iterator of any type.
--- lib/iov_iter.c | 4 ++++ 1 file changed, 4 insertions(+)
lib/iov_iter.c +4 -0
@@ -848,6 +848,10 @@ unsigned long iov_iter_alignment(const struct iov_iter *i)return 0 ; } +/* An empty iterator may have no segment array at all. */ +if (!i->count) +return 0 ; +/* iovec and kvec have identical layouts */ if (likely (iter_is_iovec (i) ||iov_iter_is_kvec (i)))return iov_iter_alignment_iovec (i);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1248/1257 backing-file: always end a queued write
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <[email protected]>
[ Upstream commit 627cdcbc2a2eceb0452078a0c14370f9f1f17a91 ]
Writes to a loop device with direct I/O on an overlay file make the next freeze of the upper filesystem hang for ever.
Every kiocb_start_write() needs a kiocb_end_write(). For a write that is queued, vfs_iocb_iter_write() leaves the end to the completion, and backing_aio_rw_complete() only calls kiocb_end_write() when IOCB_WRITE is set in the flags copied from the submitter. In-kernel submitters such as loop do not set that flag, so each queued write keeps the freeze protection of the backing filesystem.
Direct writes to a loop device with direct I/O backed by an overlay file left fsfreeze of the ext4 upper filesystem, and a later touch there, blocked in D state. It takes write access to the node of the loop device, which root has by default, to attach the file and to write.
The fix used here is to mark a write in struct backing_aio and to call kiocb_end_write() on completion of every marked write.
Reproduced under qemu without KVM, on v7.3-rc6-21-g602042bf29f6 with earlier fixes of this series applied, with and without this change, once each. The kernel was not changed for the run. With this change fsfreeze finished in about a second. Not run: the nvmet and LIO file backends, which do not set IOCB_WRITE either, FUSE passthrough, and an xfs upper filesystem.
--- fs/backing-file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/backing-file.c +4 -1
@@ -96,6 +96,7 @@ struct backing_aio {refcount_t ref;struct kiocb *orig_iocb;/* used for aio completion */ +bool is_write;void (*end_write)(struct kiocb *iocb,ssize_t );struct work_struct work;long res;
@@ -136,7 +137,8 @@ static void backing_aio_rw_complete(struct kiocb *iocb, long res) struct backing_aio *aio = container_of(iocb, struct backing_aio, iocb);struct kiocb *orig_iocb = aio->orig_iocb; -if (iocb->ki_flags &IOCB_WRITE ) +/* Pairs with kiocb_start_write() in vfs_iocb_iter_write() */ +if (aio->is_write)kiocb_end_write (iocb);backing_aio_cleanup (aio, res);
@@ -251,6 +253,7 @@ static int do_backing_file_write_iter(struct file *file, struct iov_iter *iter,return -ENOMEM ; aio->orig_iocb = iocb; + aio->is_write = true; aio->end_write = end_write;kiocb_clone (&aio->iocb, iocb,get_file (file)); aio->iocb.ki_flags = flags;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1249/1257 splice: avoid stale f_pos writeback on error
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <[email protected]>
[ Upstream commit 79b496ebe382866e3a05090b7dc9ae95e85e65b2 ]
do_splice() snapshots an implicit file position before calling the splice helper. Since splice does not take f_pos_lock, another operation on the same open file description can update f_pos while the helper is blocked. If the helper then fails, the unconditional writeback restores the stale snapshot.
For a directory without ->splice_read, a file-to-pipe splice fails with -EINVAL. A concurrent directory mutation and getdents() call can advance f_pos and refresh the filesystem's revalidation cookie before that failure restores only the old position. The next ext2 readdir can then trust an offset inside a directory entry and copy data from the adjacent page to userspace.
Only update an implicit file position when splice returns a non-negative result, matching read and write. Keep explicit offset updates unchanged.
--- fs/splice.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
fs/splice.c +6 -6
@@ -1349,10 +1349,10 @@ ssize_t do_splice(struct file *in, loff_t *off_in, struct file *out, ret =do_splice_from (ipipe, out, &offset, len, flags);file_end_write (out); -if (!off_out) - out->f_pos = offset; -else +if (off_out) *off_out = offset; +else if (ret >=0 ) + out->f_pos = offset; }else if (opipe) {if (off_out)return -ESPIPE ;
@@ -1373,10 +1373,10 @@ ssize_t do_splice(struct file *in, loff_t *off_in, struct file *out, ret =splice_file_to_pipe (in, opipe, &offset, len, flags); -if (!off_in) - in->f_pos = offset; -else +if (off_in) *off_in = offset; +else if (ret >=0 ) + in->f_pos = offset; }else { ret = -EINVAL ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1250/1257 fs: let backing files inherit FMODE_NONOTIFY from the user file
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edvard Conrad <[email protected]>
[ Upstream commit c3d355f427cea70fbe31b49e21f1915dbf37f2e6 ]
When fanotify reports a permission event, copy_event_to_user() creates the event fd with dentry_open_nonotify(), so that the listener's use of that fd does not generate further events. If the event's path is on a stacked filesystem, the stacked filesystem's ->open() opens the real file with backing_file_open(). Since commit ebe559609d78 ("fs: get rid of __FMODE_NONOTIFY kludge"), FMODE_NONOTIFY lives in f_mode only and the backing file does not inherit it: it is allocated with the default fsnotify mode, and fsnotify_open_perm_and_set_mode() raises FS_OPEN_PERM on the real path if the backing filesystem has permission event watchers.
Before that commit __FMODE_NONOTIFY travelled in f_flags, and overlayfs copies the user file's f_flags into the backing open (ovl_open_realfile()), so the backing file was exempt implicitly. Commit bc2473c90fca ("ovl: enable fsnotify events on underlying real files") relied on that when it dropped FMODE_NONOTIFY from OVL_OPEN_FLAGS.
The nested event is queued to the same group, from inside the listener's read(2), and can only be answered by another reader thread of that group. A listener holding filesystem marks on both the stacked and the backing filesystem therefore deadlocks as soon as all of its reader threads are inside such a read(2) at the same time, and every other task that touches a marked filesystem queues up behind it.
Observed with a commercial anti-malware agent (16 reader threads) on an ostree/composefs host: / is an overlayfs whose data layer is the ostree object store on the same btrfs that holds /etc and /home, and a systemd-sysext overlay sits on /usr. Every on-demand scan of /usr wedged the whole machine until the group was killed. Stack of a blocked reader thread on 7.2.7:
fanotify_get_response
fanotify_handle_event
send_to_group
fsnotify
__fsnotify_parent
do_dentry_open
vfs_open
backing_file_open
ovl_open_realfile [overlay]
ovl_open [overlay]
do_dentry_open
vfs_open
backing_file_open
ovl_open_realfile [overlay]
ovl_open [overlay]
do_dentry_open
vfs_open
dentry_open_nonotify
copy_event_to_user
fanotify_read
vfs_read
ksys_read
Userspace cannot avoid this: the backing open happens while the kernel builds the fd, before the event is reported, and fid reporting is not available for permission event classes.
Make a backing file inherit FMODE_NONOTIFY when the user file it is opened for must not generate events. This restores the pre-6.14 behaviour for the fds that fanotify creates (and for any other FMODE_NONOTIFY file), while ordinary opens through a stacked filesystem keep generating events on the real path, as intended by bc2473c90fca.
Verified with a self-contained reproducer (private tmpfs lower layers, an overlayfs over them, FAN_OPEN_PERM filesystem marks on the overlay and on one lower layer, a child opening a file through the overlay) in a qemu VM on this tree built with defconfig plus OVERLAY_FS, FANOTIFY and FANOTIFY_ACCESS_PERMISSIONS: without this patch the listener's read(2) never returns and the child's open is released only by the listener's death; with it read(2) returns, the event is answered and the open completes.
backing_tmpfile_open() is left alone: its only caller is ovl_create_tmpfile(), whose user file is a regular overlayfs file.
--- fs/backing-file.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
fs/backing-file.c +11 -0
@@ -55,6 +55,17 @@ struct file *backing_file_open(const struct file *user_file, int flags,if (IS_ERR (f))return f; +/* +* A user file that must not generate fsnotify events (e.g. the fd +* that fanotify creates for a permission event with +* dentry_open_nonotify()) must not generate them through its backing +* file either. Otherwise a listener watching the backing filesystem +* gets a nested permission event from its own read(2), which only +* another reader of the same group can answer. +*/ +if (FMODE_FSNOTIFY_NONE (user_file->f_mode)) +file_set_fsnotify_mode (f,FMODE_NONOTIFY ); +path_get (user_path);backing_file_set_user_path (f, user_path); error =vfs_open (real_path, f);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1251/1257 fs: skip copy_file_range write limits when there is no data
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hungyu Lin <[email protected]>
[ Upstream commit 81dfa035891f0502674332ee97db348a16486de0 ]
generic_copy_file_checks() reduces count to zero for a source offset at or beyond EOF, but still checks the destination write limits. If pos_out is at RLIMIT_FSIZE, this sends SIGXFSZ and returns -EFBIG even though there is no data to write.
For example, GNU cat copying a 1024-byte regular file to another regular file with RLIMIT_FSIZE=1024 copies all bytes and is then killed by its next copy_file_range() call at EOF. A zero-length request can fail in the same way.
Check write limits only when count is nonzero, as the ordinary write checks already do. Keep the other copy validation in place.
--- fs/read_write.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/read_write.c +5 -3
@@ -1531,9 +1531,11 @@ static int generic_copy_file_checks(struct file *file_in, loff_t pos_in,else count =min (count, size_in - (uint64_t )pos_in); - ret =generic_write_check_limits (file_out, pos_out, &count); -if (ret) -return ret; +if (count) { + ret =generic_write_check_limits (file_out, pos_out, &count); +if (ret) +return ret; + }/* Don't allow overlapped copying within the same file. */ if (inode_in == inode_out &&
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1252/1257 ns: dont add init_ipc_ns and init_net without namespace support
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <[email protected]>
[ Upstream commit 82f1c815aaef1905c5c6c386c8a0d74f6ff70a54 ]
When CONFIG_IPC_NS or CONFIG_NET_NS are turned off we still add the initial ipc and network namespace to the namespace trees. ipc_ns_init() calls ns_tree_add(&init_ipc_ns) whenever CONFIG_SYSVIPC is set and setup_net() calls ns_tree_add_raw() on init_net whenever CONFIG_NET is set.
But without CONFIG_IPC_NS and CONFIG_NET_NS these aren't namespaces userspace can do anything with. They don't have proc_ns_operations so there's no /proc/<pid>/ns/{ipc,net} for them, nsfs_fh_to_dentry() refuses them with -EOPNOTSUPP, and since ns->ops is NULL __ns_tree_add_raw() doesn't add them to the owner list of init_user_ns either. So they end up half registered. That's also not how we treat any of the other namespace types. Without CONFIG_UTS_NS, CONFIG_PID_NS, CONFIG_TIME_NS or CONFIG_USER_NS the initial namespace is never added to the tree.
listns() walks the unified tree and calls is_current_namespace() for every namespace it finds via may_list_ns(). But is_current_namespace() only knows about CLONE_NEWIPC and CLONE_NEWNET if CONFIG_IPC_NS and CONFIG_NET_NS are set. Otherwise we end up in the default case and its VFS_WARN_ON_ONCE(). Any unprivileged caller can trigger that with a plain listns() call:
WARNING: CPU: 0 PID: 526 at fs/nsfs.c:508 is_current_namespace+0x12f/0x440 Call Trace: legitimize_ns+0x25f/0x4c0 do_listns+0x185/0x5c0 __do_sys_listns+0x13b/0x300
Instead of teaching is_current_namespace() about namespaces that can't be opened, only add the initial namespaces to the tree if their namespace type is enabled. Move the registration of init_ipc_ns into ipc/namespace.c which is only built with CONFIG_IPC_NS. That also fixes CONFIG_SYSVIPC=n, CONFIG_POSIX_MQUEUE=y, CONFIG_IPC_NS=y where ipc/shm.c isn't built and init_ipc_ns was never added at all. For the network namespace only call ns_tree_add_raw() if CONFIG_NET_NS is set. Without CONFIG_NET_NS cleanup_net() isn't built and init_net is never removed so there's nothing to balance.
--- ipc/namespace.c | 7 +++++++ ipc/shm.c | 2 -- net/core/net_namespace.c | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-)
ipc/namespace.c +7 -0
@@ -255,3 +255,10 @@ const struct proc_ns_operations ipcns_operations = { .install = ipcns_install, .owner = ipcns_owner, }; + +static int __init ipc_ns_tree_init (void ) +{ +ns_tree_add (&init_ipc_ns); +return 0 ; +} +pure_initcall (ipc_ns_tree_init);
ipc/shm.c +0 -2
@@ -45,7 +45,6 @@#include <linux/mount.h> #include <linux/ipc_namespace.h> #include <linux/rhashtable.h> -#include <linux/nstree.h> #include <linux/uaccess.h>
@@ -149,7 +148,6 @@ void shm_exit_ns(struct ipc_namespace *ns)static int __init ipc_ns_init (void ) {shm_init_ns (&init_ipc_ns); -ns_tree_add (&init_ipc_ns);return 0 ; }
net/core/net_namespace.c +3 -1
@@ -447,7 +447,9 @@ static __net_init int setup_net(struct net *net)down_write (&net_rwsem);list_add_tail_rcu (&net->list, &net_namespace_list);up_write (&net_rwsem); -ns_tree_add_raw (net); +/* Without CONFIG_NET_NS init_net isn't exposed as a namespace. */ +if (IS_ENABLED (CONFIG_NET_NS )) +ns_tree_add_raw (net); out:return error;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1253/1257 fs: dont fail __d_obtain_alias() for unlinked inodes
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <[email protected]>
[ Upstream commit a522dd871024a0f065bfa7638afdb929607f58fc ]
Commit 669bb5af15d4 ("fs: make sure to call fsnotify_inoderemove() only once when inode is dead") did two things. It made dentry_unlink_inode() call fsnotify_inoderemove() only once the inode has neither links nor aliases left. And it made __d_obtain_alias() fail with -ESTALE for an inode in that state so that open_by_handle_at() can't create a new alias after FS_DELETE_SELF has been reported and the inode marks are gone.
The second part is wrong for network filesystems. __d_obtain_alias() backs d_obtain_alias() and d_obtain_root(). Those are what the ->fh_to_dentry() and ->get_parent() methods use to turn the inode they looked up into a dentry for exportfs_decode_fh_raw(), i.e., for open_by_handle_at() and for nfsd file handle decoding.
For a local filesystem an in-core inode without links and aliases is an orphan that goes away on the final iput(). For a network filesystem that's not true. i_nlink is just the link count the server last reported and whether the object is still reachable through its file handle is up to the server. If a file is unlinked while it is still open elsewhere, e.g., by another NFSv4 client or by a process on the server, the server keeps the object alive and its file handle stays valid. nfs_fh_to_dentry() fetches the attributes for such a handle, nfs_fhget() sets i_nlink to 0 from them, the new inode has no aliases yet and so __d_obtain_alias() now fails with -ESTALE. The same applies to fuse_get_dentry() which takes i_nlink from the fuse server. Filesystems that care about unlinked inodes already make that decision themselves in ->fh_to_dentry(), e.g., ceph's __fh_to_dentry() fetches the link count with CEPH_CAP_LINK_SHARED and only refuses an unlinked inode if it isn't open.
Note that on a network filesystem i_nlink drops to zero through attribute updates when another client unlinks the file. So the inode might never have gone through dentry_unlink_inode() with i_nlink == 0, i.e., fsnotify_inoderemove() might never have been called for it and there's nothing for the -ESTALE to protect.
So drop the two checks from __d_obtain_alias() again and go back to the unconditional alias lookup. While at it, update the comment above inode_notify_dead() since it no longer blocks new aliases.
Amir sent this as v3 to replace 669bb5af15d4 but that commit was already in mainline by then. So do it as a fix on top. The resulting code is identical to v3.
This means open_by_handle_at() can again create a new alias for an unlinked inode after FS_DELETE_SELF has been reported. Closing that file reports a second FS_DELETE_SELF and the file has none of the inode marks that were torn down. That's what Daehyeon's open_by_handle_at() LTP test checks so it is expected to fail again. This needs to be handled separately. A mark that is added through such a file while fsnotify_destroy_marks() is still running is rejected with -ENOENT since 36ebddca56b9 ("fsnotify: prevent mark additions during connector teardown") so it can't end up on a detached connector.
Christian Brauner <[email protected]> says:
Amir's v3 replaced 669bb5af15d4 as a whole. I turned it into an incremental fix on top of mainline and wrote a new commit message. Jan's Reviewed-by was given on v3 and the resulting code is identical.
--- fs/dcache.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
fs/dcache.c +5 -14
@@ -451,10 +451,9 @@ static void dentry_free(struct dentry *dentry) }/* -* If inode is unlinked and doesn't have any aliases (i.e., all fds pointing to -* it are closed), it is pretty much dead. Except that file handle lookup could -* still revive it which causes issues to fsnotify. So once inode reaches this -* state we make sure to block creating any new aliases. +* When inode is unlinked and doesn't have any aliases (i.e., all fds pointing +* to it are closed) we report FS_DELETE_SELF to fsnotify and cleanup all inode +* marks. */ static bool inode_notify_dead (struct inode *inode) {
@@ -2256,12 +2255,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, bool disconnected) sb = inode->i_sb; -spin_lock (&inode->i_lock); -if (!inode_notify_dead (inode)) - res =__d_find_any_alias (inode);/* existing alias? */ -else - res =ERR_PTR (-ESTALE ); -spin_unlock (&inode->i_lock); + res =d_find_any_alias (inode);/* existing alias? */ if (res) goto out;
@@ -2273,10 +2267,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, bool disconnected)security_d_instantiate (new, inode);spin_lock (&inode->i_lock); -if (!inode_notify_dead (inode)) - res =__d_find_any_alias (inode);/* recheck under lock */ -else - res =ERR_PTR (-ESTALE ); + res =__d_find_any_alias (inode);/* recheck under lock */ if (likely (!res)) {/* still no alias, attach a disconnected dentry */ unsigned add_flags =d_flags_for_inode (inode);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1254/1257 init/bootconfig: pass init arguments in documented order
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <[email protected]>
[ Upstream commit 278b2abf660a3e0991eb9f16f11bd9e9514a286d ]
start_kernel() appends command-line init arguments before bootconfig init arguments, while setup_command_line() places them in the opposite order. As a result, the arguments passed to init do not match the saved command line, reversing the intended precedence of options.
Parse extra_init_args before after_dashes so command-line init arguments are passed last.
--- init/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
init/main.c +3 -3
@@ -1028,12 +1028,12 @@ void start_kernel(void) __stop___param - __start___param, -1, -1, NULL, &unknown_bootoption);print_unknown_bootoptions (); -if (!IS_ERR_OR_NULL (after_dashes)) -parse_args ("Setting init args" , after_dashes,NULL ,0 ,-1 ,-1 , -NULL , set_init_arg);if (extra_init_args)parse_args ("Setting extra init args" , extra_init_args,NULL ,0 ,-1 ,-1 ,NULL , set_init_arg); +if (!IS_ERR_OR_NULL (after_dashes)) +parse_args ("Setting init args" , after_dashes,NULL ,0 ,-1 ,-1 , +NULL , set_init_arg);/* Architectural and non-timekeeping rng init, before allocator init */ random_init_early (command_line);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1255/1257 ocfs2: read the xattr entry hash before defragmenting the bucket
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <[email protected]>
[ Upstream commit f48151da595e74efdc23d83d8d6d142207b8c731 ]
Patch series "ocfs2: fix stale xattr entry pointers and empty header reads", v1.
Five defects in the ocfs2 extended attribute code, plus one robustness measure that belongs with them, all on the paths that move entries between a block, a bucket and an index tree. They fall into two groups.
Stale entry pointers (patches 1 to 3)
ocfs2_xa_set() writes through a pointer into xh_entries[] that two of its callers invalidate first. Defragmenting a bucket ends in a sort() on xe_name_hash, and lib/sort.c is an unstable heapsort, so entries that share a hash can trade slots. Copying a block into a bucket changes the order outright, since a block holds its entries in insertion order while a bucket holds them by hash, yet ocfs2_xattr_update_xattr_search() relocates the search by the index the entry had in the block. Neither path compares the entry's name with the one being set, so setxattr() can replace a neighbouring attribute's value and still report success, or trip ocfs2_xa_reuse_entry()'s BUG_ON. Patch 1 takes the hash before the sort; patches 2 and 3 look the entry up again afterwards.
Reads of an empty entry array (patches 4 to 6)
A block and a bucket may both hold no entries: ocfs2_xa_remove_entry() keeps the last slot when it removes the only one, so an empty bucket still carries the hash it is keyed by. Three sites index xh_entries[] without checking xh_count and so read xh_entries[-1], which lands on the header and comes back as xh_count | xh_free_start << 16. Nothing faults, but the value is acted on: the collision check reports no collision for an empty bucket, the divide commits a sentinel hash that hides part of the key space from ocfs2_xattr_bucket_find(), and the block to bucket copy claims storage the bucket does not hold. Patches 4 to 6 guard each site and keep the one read of xh_entries[0] that ocfs2_xa_remove_entry() documents as intentional.
This patch (of 6):
ocfs2_xattr_set_entry_index_block() takes the hash a bucket split has to work with out of xs->here, but only after ocfs2_xattr_set_entry_bucket() has tried and failed to fit the entry. That call defragments the bucket when it runs out of room, and ocfs2_defrag_xattr_bucket() finishes by sorting the entry array by name hash. lib/sort.c is not stable, so two entries sharing a hash may trade slots and xs->here is left naming an entry other than the one the search found.
The hash value itself survives the permutation -- the array is already sorted, so a slot can only exchange with an equal-hash neighbour -- but there is no reason to depend on that. Pick the hash up before the set, where xs->here is unambiguously the entry the search landed on.
No functional change intended.
--- fs/ocfs2/xattr.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
fs/ocfs2/xattr.c +16 -10
@@ -5921,6 +5921,22 @@ static int ocfs2_xattr_set_entry_index_block(struct inode *inode,trace_ocfs2_xattr_set_entry_index_block (xi->xi_name); +/* +* An existing entry keeps the hash it was stored under, and that is +* the hash a split has to work with. A new entry is stored under the +* unsigned one, which is what ocfs2_xa_add_entry() will write. +* +* Read it before the set below. Filling the bucket may defragment it, +* and ocfs2_defrag_xattr_bucket() re-sorts the entry array, so +* afterwards xs->here only denotes whichever entry the sort left in +* that slot. +*/ +if (xs->not_found) + name_hash =ocfs2_xattr_name_hash (inode, xi->xi_name, + xi->xi_name_len); +else + name_hash =le32_to_cpu (xs->here->xe_name_hash); + ret =ocfs2_xattr_set_entry_bucket (inode, xi, xs, ctxt);if (!ret) goto out;
@@ -5936,17 +5952,7 @@ static int ocfs2_xattr_set_entry_index_block(struct inode *inode,* the maximum number of collisions we will allow for then is * one bucket's worth, so check it here whether we need to * add a new bucket for the insert. -* -* An existing entry keeps the hash it was stored under, and that is -* the hash a split has to work with. A new entry is stored under the -* unsigned one, which is what ocfs2_xa_add_entry() will write. */ -if (xs->not_found) - name_hash =ocfs2_xattr_name_hash (inode, xi->xi_name, - xi->xi_name_len); -else - name_hash =le32_to_cpu (xs->here->xe_name_hash); - ret =ocfs2_check_xattr_bucket_collision (xs->bucket, name_hash);if (ret) {mlog_errno (ret);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1256/1257 apparmor: fix uninitialized variable warning in aa_inherit_files
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Johansen <[email protected]>
[ Upstream commit ed35bbe7d06e6505401eff3f3c7a36bd1f167a17 ]
Fix the following warning
All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
security/apparmor/file.c:737:53: warning: variable 'file' is uninitialized when used here [-Wuninitialized]
737 | int error = aa_file_perm(OP_INHERIT, cred, label, file,
| ^~~~
security/apparmor/file.c:724:36: note: initialize the variable 'file' to silence this warning
724 | struct file *devnull = NULL, *file;
| ^
| = NULL1 warning generated.
vim +/file +737 security/apparmor/file.c
719
720 /* based on selinux's flush_unauthorized_files */
721 void aa_inherit_files(const struct cred *cred, struct files_struct *files)
722 {
723 struct aa_label *label = aa_get_newest_cred_label(cred);
724 struct file *devnull = NULL, *file;
725 bool devnull_tried = false;
726 unsigned int n = 0;
727
728 revalidate_tty(cred, label);
729
730 /*
731 * Revalidate access to inherited open files. Each file is
732 * revalidated holding only a reference to it, with no locks
733 * held, as revalidation may sleep (e.g. unix socket mediation
734 * dropping path refs, or allocating path buffers).
735 */
736 while ((n = iterate_fd(files, n, get_next_file, &file)) != 0) {
Quoted 1 line
737 int error = aa_file_perm(OP_INHERIT, cred, label, file,
--- security/apparmor/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/apparmor/file.c +1 -1
@@ -721,7 +721,7 @@ static int get_next_file(const void *p, struct file *file, unsigned int fd)void aa_inherit_files (const struct cred *cred,struct files_struct *files) {struct aa_label *label =aa_get_newest_cred_label (cred); -struct file *devnull =NULL , *file; +struct file *devnull =NULL , *file =NULL ;bool devnull_tried = false;unsigned int n =0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1257/1257 apparmor: on failed load ensure profile files are removed before parent
In reply to Greg Kroah-Hartman7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Johansen <[email protected]>
[ Upstream commit 97ba44a2aa4c7ab011a93ce94cb595200fe4ea4f ]
The load interface does not guarantee the order profiles are loaded. When a parent is loaded after its child, and the load fails, the current code will issue a warning, and leak a dentry.
For the loaded set of profiles, ensure that on failure list is ordered is traversed in reverse so any children processed after their parent is freed first. We do not need to deal with the cases where the children are processed before their parent, because either a parent outside the list already exists or a dummy parent outside of the list is created, and the list walk will not put those parents before their children.
--- security/apparmor/policy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
security/apparmor/policy.c +3 -1
@@ -1432,8 +1432,10 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,* them yet, and leaving them behind would leak the new profiles * (their dents pin the proxy) and make the next load at the same, * unbumped ns revision fail with -EEXIST on its raw_data dir. +* ensure children (which are at the end of the list are removed +* before their parent */ -list_for_each_entry (tmp, &lh, list) { +list_for_each_entry_reverse (tmp, &lh, list) {if (!tmp->old)__aafs_profile_rmdir (tmp->new); }
Signature · 1 line
2.53.0
Hi
kernel build / boot test on x86_64 (Intel).
I need to revert (here)
1564da6afd7ce5297ba24f2d1e61d6a79a9ff6db
otherwise I get:
In file included from kernel/sched/build_policy.c:71:kernel/sched/ext/ext.c: In function ‘check_rq_for_timeouts’:kernel/sched/ext/ext.c:3852:41: error: implicit declaration of function ‘scx_exec_sched’; did you mean ‘scx_prog_sched’? [-Wimplicit-function-declaration]
3852 | struct scx_sched *sch =
scx_exec_sched(scx_task_sched(p), cpu_of(rq));
| ^~~~~~~~~~~~~~
| scx_prog_schedkernel/sched/ext/ext.c:3852:41: error: initialization of ‘struct scx_sched *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] make[4]: *** [scripts/Makefile.build:290: kernel/sched/build_policy.o] Error 1
make[3]: *** [scripts/Makefile.build:551: kernel/sched] Error 2
make[2]: *** [scripts/Makefile.build:551: kernel] Error 2
make[2]: *** Waiting for unfinished jobs....
apart from that no regression
same .config:
https://marc.info/?l=linux-kernel&m=179390956799135&w=4
Thanks
Quoted 6 lines · Ronald Warsow
kernel build / boot test on
x86_64(Intel).I need to revert (here)
1564da6afd7ce5297ba24f2d1e61d6a79a9ff6db
FWIW, that is "sched_ext: Fix the stall watchdog testing and blaming the wrong sched under bypass". Ran into the same problem; Pascal (now CCed) did so earlier (even before the new -rc was out afaics), too:
https://lore.kernel.org/all/[email protected]/
Ciao, Thorsten
Quoted 29 lines
otherwise I get:
In file included from
kernel/sched/build_policy.c:71:kernel/sched/ext/ext.c: In function ‘check_rq_for_timeouts’:kernel/sched/ext/ext.c:3852:41: error: implicit declaration of function ‘scx_exec_sched’; did you mean ‘scx_prog_sched’? [-Wimplicit-function- declaration]
3852 | structscx_sched*sch =scx_exec_sched(scx_task_sched(p), cpu_of(rq));
| ^~~~~~~~~~~~~~ |scx_prog_schedkernel/sched/ext/ext.c:3852:41: error: initialization of ‘structscx_sched*’ from ‘int’ makes pointer from integer without a cast [- Wint-conversion]
make[4]: *** [scripts/Makefile.build:290:kernel/sched/build_policy.o] Error 1
make[3]: *** [scripts/Makefile.build:551: kernel/sched] Error 2 make[2]: *** [scripts/Makefile.build:551: kernel] Error 2 make[2]: *** Waiting for unfinished jobs....apart from that no regression
same .config:
https://marc.info/?l=linux-kernel&m=179390956799135&w=4Thanks
Tested-by Ronald Warsow <[email protected]>
Am 07.11.2026 um 16:34 schrieb Ronald Warsow:
Quoted 11 lines
Hi
kernel build / boot test on
x86_64(Intel).I need to revert (here)
1564da6afd7ce5297ba24f2d1e61d6a79a9ff6dbotherwise I get:
Quoted 11 lines
In file included from
kernel/sched/build_policy.c:71:kernel/sched/ext/ext.c: In function ‘check_rq_for_timeouts’:kernel/sched/ext/ext.c:3852:41: error: implicit declaration of function ‘scx_exec_sched’; did you mean ‘scx_prog_sched’? [-Wimplicit-function-declaration]
3852 | structscx_sched*sch =scx_exec_sched(scx_task_sched(p), cpu_of(rq));
| ^~~~~~~~~~~~~~
|scx_prog_schedkernel/sched/ext/ext.c:3852:41: error: initialization of ‘structscx_sched*’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] make[4]: *** [scripts/Makefile.build:290:kernel/sched/build_policy.o] Error 1
make[3]: *** [scripts/Makefile.build:551: kernel/sched] Error 2
make[2]: *** [scripts/Makefile.build:551: kernel] Error 2
make[2]: *** Waiting for unfinished jobs....
I do see the same build error on my machine (2-socket Ivy Bridge Xeon E5-2697v2 server), and the same revert helps.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Sasha Levin
maintainerQuoted 3 lines
I need to revert (here)
1564da6afd7ce5297ba24f2d1e61d6a79a9ff6db
Thanks for the reports (to Ronald, and to Pascal, Thorsten, Peter, Joungmin and Takeshi who hit the same thing).
"sched_ext: Fix the stall watchdog testing and blaming the wrong sched under bypass" is dropped from the 7.3 queue. It needs 30fb2b1e4d41 ("sched_ext: Fix the running task keeping its protection into bypass") and 5809f749fbdb ("sched_ext: Fix a bypassed task stalling on a cpu its scheduler has no caps on"), which provide scx_exec_sched().
Signature · 2 lines
Thanks, Sasha
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
7.3.4-rc1 compiles on x86_64 (Xeon E5-1620 v2, Slackware64-15.0), and boots & runs on x86_64 (AMD Ryzen 5 7520U, Slackware64-current). No regressions observed during boot & my custom tests.
I did not observe the build error already reported in this thread.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.3.y
and the diffstat can be found below.thanks,
greg k-h
7.3.4-rc1, 6.18.63-rc1, and 6.12.117-rc1 are all giving me the same build error with clang that I previously had with 7.3.2-rc1 and 6.18.61-rc1, due to the same xfs patch as before ("xfs: cross-reference the primary superblock"):
fs/xfs/scrub/agheader.c:123:6: error: variable 'error' is used uninitialized
whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
123 | if (agno == 0)
| ^~~~~~~~~
fs/xfs/scrub/agheader.c:435:9: note: uninitialized use occurs here
435 | return error;
| ^~~~~
fs/xfs/scrub/agheader.c:123:2: note: remove the 'if' if its condition is always
false
123 | if (agno == 0)
| ^~~~~~~~~~~~~~
124 | goto out_xref;
| ~~~~~~~~~~~~~
fs/xfs/scrub/agheader.c:111:13: note: initialize the variable 'error' to silence
this warning
111 | int error;
| ^
| = 01 error generated.
make[4]: *** [scripts/Makefile.build:287: fs/xfs/scrub/agheader.o] Error 1
I sent an email about this earlier today, before the -rc was sent out:
https://lore.kernel.org/stable/[email protected]/
Reverting this patch fixes the build, or the minimal fix I proposed in that email also fixes the build:
fs/xfs/scrub/agheader.c +1 -1
@@ -108,7 +108,7 @@ xchk_superblock(xfs_agnumber_t agno = sc->sm->sm_agno;uint32_t v2_ok;__be32 features_mask; -int error; +int error =0 ;__be16 vernum_mask;/*
So far I've only tried building a minimal test config. Later today or tomorrow I'll do testing with my normal configs, but (to make a long story short) I will probably experience temporary health problems for the next few days, so that will probably slow down my testing.
Signature · 1 line
-Barry K. Nathan <[email protected]>
Quoted 63 lines · Barry K. Nathan
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-7.3.y and the diffstat can be found below.Quoted 3 lines
thanks,
greg k-h
7.3.4-rc1, 6.18.63-rc1, and 6.12.117-rc1 are all giving me the same build error with clang that I previously had with 7.3.2-rc1 and 6.18.61-rc1, due to the same xfs patch as before ("xfs: cross-reference the primary superblock"):
fs/xfs/scrub/agheader.c:123:6: error: variable 'error' is used uninitialized
whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 123 | if (agno == 0)
| ^~~~~~~~~fs/xfs/scrub/agheader.c:435:9: note: uninitialized use occurs here
435 | return error;
| ^~~~~fs/xfs/scrub/agheader.c:123:2: note: remove the 'if' if its condition is always
false
123 | if (agno == 0)
| ^~~~~~~~~~~~~~
124 | gotoout_xref;
| ~~~~~~~~~~~~~fs/xfs/scrub/agheader.c:111:13: note: initialize the variable 'error' to silence
this warning
111 | int error;
| ^
| = 0
1 error generated.
make[4]: *** [scripts/Makefile.build:287:fs/xfs/scrub/agheader.o] Error 1I sent an email about this earlier today, before the -rc was sent out:
https://lore.kernel.org/stable/[email protected]/Reverting this patch fixes the build, or the minimal fix I proposed in that email also fixes the build:
fs/xfs/scrub/agheader.c 2026-11-06 22:45:59.898908897 -0800 renamed from fs/xfs/scrub/agheader.c 2026-11-06 22:42:57.147299404 -0800 +1
-1@@ -108,7 +108,7 @@ xchk_superblock( xfs_agnumber_t agno = sc->sm->sm_agno; uint32_t v2_ok; __be32 features_mask; - int error; + int error = 0; __be16 vernum_mask; /*
Quoted 4 lines
So far I've only tried building a minimal test config. Later today or tomorrow I'll do testing with my normal configs, but (to make a long story short) I will probably experience temporary health problems for the next few days, so that will probably slow down my testing.
I took 7.3.4-rc1, reverted "sched_ext: Fix the stall watchdog testing and blaming the wrong sched under bypass", and added the fix to initialize error to 0 in xchk_superblock() in fs/xfs/scrub/agheader.c (quoted above).
The resulting kernel is running well on 3 different amd64 systems and an arm64 virtual machine, with no regressions observed. (This includes a successful XFS scrub on one of the amd64 systems.)
Signature · 1 line
-Barry K. Nathan <[email protected]>
Sasha Levin
maintainerQuoted 9 lines
Quoted 4 lines
7.3.4-rc1, 6.18.63-rc1, and 6.12.117-rc1 are all giving me the same build error with clang that I previously had with 7.3.2-rc1 and 6.18.61-rc1, due to the same xfs patch as before ("xfs: cross-reference the primary superblock"):
I took 7.3.4-rc1, reverted "
sched_ext: Fix the stall watchdog testing and blaming the wrong sched under bypass", and added the fix to initialize error to 0 inxchk_superblock()infs/xfs/scrub/agheader.c(quoted above).
Thanks for testing. Both problems are now dropped: the sched_ext patch from 7.3, and "xfs: cross-reference the primary superblock" from 7.3, 6.18 and 6.12 (it had come back after the earlier drop).
The xfs build error can't be fixed with a local "error = 0" change, since stable only takes upstream commits, so the patch is dropped instead.
Signature · 2 lines
Thanks, Sasha
Barry K. Nathan
Tested-byQuoted 5 lines · Sasha Levin
Quoted 4 lines
Quoted 4 lines
7.3.4-rc1, 6.18.63-rc1, and 6.12.117-rc1 are all giving me the same build error with clang that I previously had with 7.3.2-rc1 and 6.18.61-rc1, due to the same xfs patch as before ("xfs: cross-reference the primary superblock"):
Quoted 8 lines
Quoted 4 lines
I took 7.3.4-rc1, reverted "
sched_ext: Fix the stall watchdog testing and blaming the wrong sched under bypass", and added the fix to initialize error to 0 inxchk_superblock()infs/xfs/scrub/agheader.c(quoted above).Thanks for testing. Both problems are now dropped: the
sched_extpatch from 7.3, and "xfs: cross-reference the primary superblock" from 7.3, 6.18 and 6.12 (it had come back after the earlier drop).
I took 7.3.3 and applied stable-queue as of commit 39e32a361d2fca269cec12e8669e2bd3b84844d9 ("drop 24 patches based on RC review feedback"), and retested on 2 of my amd64 systems and my arm64 virtual machine.
It's now building successfully and working well, with no regressions observed.
Signature · 1 line
-Barry K. Nathan <[email protected]>
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.3.y
and the diffstat can be found below.thanks,
greg k-h
Hi, Greg:
7.3.4-rc1 successfully built and booted in my system once the commit 1564da6afd7ce5297ba24f2d1e61d6a79a9ff6db was reverted.
The error Barry encountered was not noticed.
Distribution: Gentoo Linux
Architecture: x86_64 (ASUS Zenbook UM3504DA)
CPU: AMD Ryzen 7 7735U
iGPU: AMD Radeon 680M
[ 0.000000] Linux version 7.3.4-rc1-900-myllvm+
(user1@gentoo-zenbook) (clang version 23.1.5, LLD 23.1.5) #1 SMP PREEMPT_DYNAMIC Sun Nov 8 10:04:35 KST 2026
Hi Greg
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.3.y
and the diffstat can be found below.thanks,
greg k-h
Linux version 7.3.4-rc1 tested.
Build error
The previously reported issue has recurred.
Built successfully and confirmed startup following the procedure reported by the previous user.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)
Quoted 8 lines · On Sat, 07 Nov 2026 08:38:16 -0500 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested for loongarch64 and arm32:
In loongarch64, I still see the XFS issue:
https://lore.kernel.org/stable/[email protected]/
Thanks!
Cheers,
Miguel
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.3.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 (with the reverted problematic patch) against the Fedora build system (aarch64, ppc64le, s390x,x86_64), and boot tested x86_64. No regressions noted.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.3.y
and the diffstat can be found below.thanks,
greg k-h
Built (with CONFIG_SCHED_CLASS_EXT=n) and booted successfully on RISC-V RV64 (HiFive Unmatched).
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-7.3.y
Best regards,
Pavel
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.3.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 7.3.4 release. There are 1257 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 09 Nov 2026 13:46:08 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.3.4-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-7.3.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested with BMIPS_GENERIC:
Signature · 1 line
Florian