commit:     d89b7b70ccefe56028a258075397ad66e474e665
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  2 16:12:04 2022 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Sat Jul  2 16:12:04 2022 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d89b7b70

Linux patch 5.18.9

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README             |   4 +
 1008_linux-5.18.9.patch | 283 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 287 insertions(+)

diff --git a/0000_README b/0000_README
index b676cc58..e3668eda 100644
--- a/0000_README
+++ b/0000_README
@@ -75,6 +75,10 @@ Patch:  1007_linux-5.18.8.patch
 From:   http://www.kernel.org
 Desc:   Linux 5.18.8
 
+Patch:  1008_linux-5.18.9.patch
+From:   http://www.kernel.org
+Desc:   Linux 5.18.9
+
 Patch:  1500_XATTR_USER_PREFIX.patch
 From:   https://bugs.gentoo.org/show_bug.cgi?id=470644
 Desc:   Support for namespace user.pax.* on tmpfs.

diff --git a/1008_linux-5.18.9.patch b/1008_linux-5.18.9.patch
new file mode 100644
index 00000000..0716a3e2
--- /dev/null
+++ b/1008_linux-5.18.9.patch
@@ -0,0 +1,283 @@
+diff --git a/Makefile b/Makefile
+index 6ac3335f65aff..751cfd786c8c0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0
+ VERSION = 5
+ PATCHLEVEL = 18
+-SUBLEVEL = 8
++SUBLEVEL = 9
+ EXTRAVERSION =
+ NAME = Superb Owl
+ 
+diff --git a/arch/powerpc/include/asm/ftrace.h 
b/arch/powerpc/include/asm/ftrace.h
+index d83758acd1c7c..44a37a2b6a1cf 100644
+--- a/arch/powerpc/include/asm/ftrace.h
++++ b/arch/powerpc/include/asm/ftrace.h
+@@ -86,7 +86,7 @@ static inline bool arch_syscall_match_sym_name(const char 
*sym, const char *name
+ #endif /* PPC64_ELF_ABI_v1 */
+ #endif /* CONFIG_FTRACE_SYSCALLS */
+ 
+-#ifdef CONFIG_PPC64
++#if defined(CONFIG_PPC64) && defined(CONFIG_FUNCTION_TRACER)
+ #include <asm/paca.h>
+ 
+ static inline void this_cpu_disable_ftrace(void)
+@@ -110,11 +110,13 @@ static inline u8 this_cpu_get_ftrace_enabled(void)
+       return get_paca()->ftrace_enabled;
+ }
+ 
++void ftrace_free_init_tramp(void);
+ #else /* CONFIG_PPC64 */
+ static inline void this_cpu_disable_ftrace(void) { }
+ static inline void this_cpu_enable_ftrace(void) { }
+ static inline void this_cpu_set_ftrace_enabled(u8 ftrace_enabled) { }
+ static inline u8 this_cpu_get_ftrace_enabled(void) { return 1; }
++static inline void ftrace_free_init_tramp(void) { }
+ #endif /* CONFIG_PPC64 */
+ #endif /* !__ASSEMBLY__ */
+ 
+diff --git a/arch/powerpc/kernel/trace/ftrace.c 
b/arch/powerpc/kernel/trace/ftrace.c
+index 4ee04aacf9f13..a778f2ae1f3f5 100644
+--- a/arch/powerpc/kernel/trace/ftrace.c
++++ b/arch/powerpc/kernel/trace/ftrace.c
+@@ -306,9 +306,7 @@ static int setup_mcount_compiler_tramp(unsigned long tramp)
+ 
+       /* Is this a known long jump tramp? */
+       for (i = 0; i < NUM_FTRACE_TRAMPS; i++)
+-              if (!ftrace_tramps[i])
+-                      break;
+-              else if (ftrace_tramps[i] == tramp)
++              if (ftrace_tramps[i] == tramp)
+                       return 0;
+ 
+       /* Is this a known plt tramp? */
+@@ -863,6 +861,17 @@ void arch_ftrace_update_code(int command)
+ 
+ extern unsigned int ftrace_tramp_text[], ftrace_tramp_init[];
+ 
++void ftrace_free_init_tramp(void)
++{
++      int i;
++
++      for (i = 0; i < NUM_FTRACE_TRAMPS && ftrace_tramps[i]; i++)
++              if (ftrace_tramps[i] == (unsigned long)ftrace_tramp_init) {
++                      ftrace_tramps[i] = 0;
++                      return;
++              }
++}
++
+ int __init ftrace_dyn_arch_init(void)
+ {
+       int i;
+diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
+index 4d221d033804e..149635e5c1653 100644
+--- a/arch/powerpc/mm/mem.c
++++ b/arch/powerpc/mm/mem.c
+@@ -22,6 +22,7 @@
+ #include <asm/kasan.h>
+ #include <asm/svm.h>
+ #include <asm/mmzone.h>
++#include <asm/ftrace.h>
+ 
+ #include <mm/mmu_decl.h>
+ 
+@@ -312,6 +313,7 @@ void free_initmem(void)
+       ppc_md.progress = ppc_printk_progress;
+       mark_initmem_nx();
+       free_initmem_default(POISON_FREE_INITMEM);
++      ftrace_free_init_tramp();
+ }
+ 
+ /*
+diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
+index 1589ae7d5abb6..8182ff2d12fe1 100644
+--- a/drivers/clocksource/Kconfig
++++ b/drivers/clocksource/Kconfig
+@@ -80,7 +80,7 @@ config IXP4XX_TIMER
+       bool "Intel XScale IXP4xx timer driver" if COMPILE_TEST
+       depends on HAS_IOMEM
+       select CLKSRC_MMIO
+-      select TIMER_OF if OF
++      select TIMER_OF
+       help
+         Enables support for the Intel XScale IXP4xx SoC timer.
+ 
+diff --git a/drivers/clocksource/timer-ixp4xx.c 
b/drivers/clocksource/timer-ixp4xx.c
+index cbb184953510b..720ed70a2964f 100644
+--- a/drivers/clocksource/timer-ixp4xx.c
++++ b/drivers/clocksource/timer-ixp4xx.c
+@@ -19,8 +19,6 @@
+ #include <linux/of_address.h>
+ #include <linux/of_irq.h>
+ #include <linux/platform_device.h>
+-/* Goes away with OF conversion */
+-#include <linux/platform_data/timer-ixp4xx.h>
+ 
+ /*
+  * Constants to make it easy to access Timer Control/Status registers
+@@ -263,28 +261,6 @@ static struct platform_driver ixp4xx_timer_driver = {
+ };
+ builtin_platform_driver(ixp4xx_timer_driver);
+ 
+-/**
+- * ixp4xx_timer_setup() - Timer setup function to be called from boardfiles
+- * @timerbase: physical base of timer block
+- * @timer_irq: Linux IRQ number for the timer
+- * @timer_freq: Fixed frequency of the timer
+- */
+-void __init ixp4xx_timer_setup(resource_size_t timerbase,
+-                             int timer_irq,
+-                             unsigned int timer_freq)
+-{
+-      void __iomem *base;
+-
+-      base = ioremap(timerbase, 0x100);
+-      if (!base) {
+-              pr_crit("IXP4xx: can't remap timer\n");
+-              return;
+-      }
+-      ixp4xx_timer_register(base, timer_irq, timer_freq);
+-}
+-EXPORT_SYMBOL_GPL(ixp4xx_timer_setup);
+-
+-#ifdef CONFIG_OF
+ static __init int ixp4xx_of_timer_init(struct device_node *np)
+ {
+       void __iomem *base;
+@@ -315,4 +291,3 @@ out_unmap:
+       return ret;
+ }
+ TIMER_OF_DECLARE(ixp4xx, "intel,ixp4xx-timer", ixp4xx_of_timer_init);
+-#endif
+diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
+index 2362bb8ef6d19..e136d6edc1ed6 100644
+--- a/drivers/md/bcache/btree.c
++++ b/drivers/md/bcache/btree.c
+@@ -2017,6 +2017,7 @@ int bch_btree_check(struct cache_set *c)
+       if (c->root->level == 0)
+               return 0;
+ 
++      memset(&check_state, 0, sizeof(struct btree_check_state));
+       check_state.c = c;
+       check_state.total_threads = bch_btree_chkthread_nr();
+       check_state.key_idx = 0;
+diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
+index 75b71199800dc..d138a2d732406 100644
+--- a/drivers/md/bcache/writeback.c
++++ b/drivers/md/bcache/writeback.c
+@@ -950,6 +950,7 @@ void bch_sectors_dirty_init(struct bcache_device *d)
+               return;
+       }
+ 
++      memset(&state, 0, sizeof(struct bch_dirty_init_state));
+       state.c = c;
+       state.d = d;
+       state.total_threads = bch_btre_dirty_init_thread_nr();
+diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c 
b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c
+index 60ae8bfc5f69a..1749d26f4befc 100644
+--- a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c
++++ b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c
+@@ -43,9 +43,7 @@ static bool check_image_valid(struct hinic_devlink_priv 
*priv, const u8 *buf,
+ 
+       for (i = 0; i < fw_image->fw_info.fw_section_cnt; i++) {
+               len += fw_image->fw_section_info[i].fw_section_len;
+-              memcpy(&host_image->image_section_info[i],
+-                     &fw_image->fw_section_info[i],
+-                     sizeof(struct fw_section_info_st));
++              host_image->image_section_info[i] = 
fw_image->fw_section_info[i];
+       }
+ 
+       if (len != fw_image->fw_len ||
+diff --git a/fs/io_uring.c b/fs/io_uring.c
+index e4186635aaa8d..7c190e8853404 100644
+--- a/fs/io_uring.c
++++ b/fs/io_uring.c
+@@ -3187,6 +3187,21 @@ static int io_prep_rw(struct io_kiocb *req, const 
struct io_uring_sqe *sqe)
+       int ret;
+ 
+       kiocb->ki_pos = READ_ONCE(sqe->off);
++      /* used for fixed read/write too - just read unconditionally */
++      req->buf_index = READ_ONCE(sqe->buf_index);
++      req->imu = NULL;
++
++      if (req->opcode == IORING_OP_READ_FIXED ||
++          req->opcode == IORING_OP_WRITE_FIXED) {
++              struct io_ring_ctx *ctx = req->ctx;
++              u16 index;
++
++              if (unlikely(req->buf_index >= ctx->nr_user_bufs))
++                      return -EFAULT;
++              index = array_index_nospec(req->buf_index, ctx->nr_user_bufs);
++              req->imu = ctx->user_bufs[index];
++              io_req_set_rsrc_node(req, ctx, 0);
++      }
+ 
+       ioprio = READ_ONCE(sqe->ioprio);
+       if (ioprio) {
+@@ -3199,11 +3214,9 @@ static int io_prep_rw(struct io_kiocb *req, const 
struct io_uring_sqe *sqe)
+               kiocb->ki_ioprio = get_current_ioprio();
+       }
+ 
+-      req->imu = NULL;
+       req->rw.addr = READ_ONCE(sqe->addr);
+       req->rw.len = READ_ONCE(sqe->len);
+       req->rw.flags = READ_ONCE(sqe->rw_flags);
+-      req->buf_index = READ_ONCE(sqe->buf_index);
+       return 0;
+ }
+ 
+@@ -3335,20 +3348,9 @@ static int __io_import_fixed(struct io_kiocb *req, int 
rw, struct iov_iter *iter
+ static int io_import_fixed(struct io_kiocb *req, int rw, struct iov_iter 
*iter,
+                          unsigned int issue_flags)
+ {
+-      struct io_mapped_ubuf *imu = req->imu;
+-      u16 index, buf_index = req->buf_index;
+-
+-      if (likely(!imu)) {
+-              struct io_ring_ctx *ctx = req->ctx;
+-
+-              if (unlikely(buf_index >= ctx->nr_user_bufs))
+-                      return -EFAULT;
+-              io_req_set_rsrc_node(req, ctx, issue_flags);
+-              index = array_index_nospec(buf_index, ctx->nr_user_bufs);
+-              imu = READ_ONCE(ctx->user_bufs[index]);
+-              req->imu = imu;
+-      }
+-      return __io_import_fixed(req, rw, iter, imu);
++      if (WARN_ON_ONCE(!req->imu))
++              return -EFAULT;
++      return __io_import_fixed(req, rw, iter, req->imu);
+ }
+ 
+ static void io_ring_submit_unlock(struct io_ring_ctx *ctx, bool needs_lock)
+diff --git a/include/linux/platform_data/timer-ixp4xx.h 
b/include/linux/platform_data/timer-ixp4xx.h
+deleted file mode 100644
+index ee92ae7edaed7..0000000000000
+--- a/include/linux/platform_data/timer-ixp4xx.h
++++ /dev/null
+@@ -1,11 +0,0 @@
+-/* SPDX-License-Identifier: GPL-2.0 */
+-#ifndef __TIMER_IXP4XX_H
+-#define __TIMER_IXP4XX_H
+-
+-#include <linux/ioport.h>
+-
+-void __init ixp4xx_timer_setup(resource_size_t timerbase,
+-                             int timer_irq,
+-                             unsigned int timer_freq);
+-
+-#endif
+diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
+index d257721c68b8f..cd296da509c96 100644
+--- a/kernel/time/tick-sched.c
++++ b/kernel/time/tick-sched.c
+@@ -526,7 +526,6 @@ void __init tick_nohz_full_setup(cpumask_var_t cpumask)
+       cpumask_copy(tick_nohz_full_mask, cpumask);
+       tick_nohz_full_running = true;
+ }
+-EXPORT_SYMBOL_GPL(tick_nohz_full_setup);
+ 
+ static int tick_nohz_cpu_down(unsigned int cpu)
+ {

Reply via email to