All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT pull] irq/urgent for v5.15-rc3
@ 2021-09-26 10:30 Thomas Gleixner
  2021-09-26 10:30 ` [GIT pull] timers/urgent " Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Thomas Gleixner @ 2021-09-26 10:30 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest irq/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-urgent-2021-09-26

up to:  f9bfed3ad5b1: Merge tag 'irqchip-fixes-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent


A set of fixes for interrupt chip drivers:

 - Work around a bad GIC integration on a Renesas platform which can't
   handle byte-sized MMIO access

 - Plug a potential memory leak in the GICv4 driver

 - Fix a regression in the Armada 370-XP IPI code which was caused by
   issuing EOI instack of ACK.

 - A couple of small fixes here and there

Thanks,

	tglx

------------------>
Bixuan Cui (1):
      irqdomain: Change the type of 'size' in __irq_domain_add() to be consistent

Geert Uytterhoeven (1):
      irqchip/renesas-rza1: Use semicolons instead of commas

Kaige Fu (1):
      irqchip/gic-v3-its: Fix potential VPE leak on error

Marc Zyngier (3):
      Documentation: Fix irq-domain.rst build warning
      irqchip/armada-370-xp: Fix ack/eoi breakage
      irqchip/gic: Work around broken Renesas integration

Randy Dunlap (2):
      irqchip/mbigen: Repair non-kernel-doc notation
      irqchip/goldfish-pic: Select GENERIC_IRQ_CHIP to fix build


 Documentation/core-api/irq/irq-domain.rst |  5 +--
 drivers/irqchip/Kconfig                   |  1 +
 drivers/irqchip/irq-armada-370-xp.c       |  4 +--
 drivers/irqchip/irq-gic-v3-its.c          |  2 +-
 drivers/irqchip/irq-gic.c                 | 52 ++++++++++++++++++++++++++++++-
 drivers/irqchip/irq-mbigen.c              |  6 ++--
 drivers/irqchip/irq-renesas-rza1.c        | 12 +++----
 include/linux/irqdomain.h                 |  2 +-
 kernel/irq/irqdomain.c                    |  2 +-
 9 files changed, 69 insertions(+), 17 deletions(-)

diff --git a/Documentation/core-api/irq/irq-domain.rst b/Documentation/core-api/irq/irq-domain.rst
index 6979b4af2c1f..9c0e8758037a 100644
--- a/Documentation/core-api/irq/irq-domain.rst
+++ b/Documentation/core-api/irq/irq-domain.rst
@@ -175,9 +175,10 @@ for IRQ numbers that are passed to struct device registrations.  In that
 case the Linux IRQ numbers cannot be dynamically assigned and the legacy
 mapping should be used.
 
-As the name implies, the *_legacy() functions are deprecated and only
+As the name implies, the \*_legacy() functions are deprecated and only
 exist to ease the support of ancient platforms. No new users should be
-added.
+added. Same goes for the \*_simple() functions when their use results
+in the legacy behaviour.
 
 The legacy map assumes a contiguous range of IRQ numbers has already
 been allocated for the controller and that the IRQ number can be
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 4d5924e9f766..aca7b595c4c7 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -409,6 +409,7 @@ config MESON_IRQ_GPIO
 config GOLDFISH_PIC
        bool "Goldfish programmable interrupt controller"
        depends on MIPS && (GOLDFISH || COMPILE_TEST)
+       select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN
        help
          Say yes here to enable Goldfish interrupt controller driver used
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 7557ab551295..53e0fb0562c1 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -359,16 +359,16 @@ static void armada_370_xp_ipi_send_mask(struct irq_data *d,
 		ARMADA_370_XP_SW_TRIG_INT_OFFS);
 }
 
-static void armada_370_xp_ipi_eoi(struct irq_data *d)
+static void armada_370_xp_ipi_ack(struct irq_data *d)
 {
 	writel(~BIT(d->hwirq), per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
 }
 
 static struct irq_chip ipi_irqchip = {
 	.name		= "IPI",
+	.irq_ack	= armada_370_xp_ipi_ack,
 	.irq_mask	= armada_370_xp_ipi_mask,
 	.irq_unmask	= armada_370_xp_ipi_unmask,
-	.irq_eoi	= armada_370_xp_ipi_eoi,
 	.ipi_send_mask	= armada_370_xp_ipi_send_mask,
 };
 
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 7f40dca8cda5..eb0882d15366 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -4501,7 +4501,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
 
 	if (err) {
 		if (i > 0)
-			its_vpe_irq_domain_free(domain, virq, i - 1);
+			its_vpe_irq_domain_free(domain, virq, i);
 
 		its_lpi_free(bitmap, base, nr_ids);
 		its_free_prop_table(vprop_page);
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index d329ec3d64d8..5f22c9d65e57 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -107,6 +107,8 @@ static DEFINE_RAW_SPINLOCK(cpu_map_lock);
 
 #endif
 
+static DEFINE_STATIC_KEY_FALSE(needs_rmw_access);
+
 /*
  * The GIC mapping of CPU interfaces does not necessarily match
  * the logical CPU numbering.  Let's use a mapping as returned
@@ -774,6 +776,25 @@ static int gic_pm_init(struct gic_chip_data *gic)
 #endif
 
 #ifdef CONFIG_SMP
+static void rmw_writeb(u8 bval, void __iomem *addr)
+{
+	static DEFINE_RAW_SPINLOCK(rmw_lock);
+	unsigned long offset = (unsigned long)addr & 3UL;
+	unsigned long shift = offset * 8;
+	unsigned long flags;
+	u32 val;
+
+	raw_spin_lock_irqsave(&rmw_lock, flags);
+
+	addr -= offset;
+	val = readl_relaxed(addr);
+	val &= ~GENMASK(shift + 7, shift);
+	val |= bval << shift;
+	writel_relaxed(val, addr);
+
+	raw_spin_unlock_irqrestore(&rmw_lock, flags);
+}
+
 static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 			    bool force)
 {
@@ -788,7 +809,10 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 	if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
 		return -EINVAL;
 
-	writeb_relaxed(gic_cpu_map[cpu], reg);
+	if (static_branch_unlikely(&needs_rmw_access))
+		rmw_writeb(gic_cpu_map[cpu], reg);
+	else
+		writeb_relaxed(gic_cpu_map[cpu], reg);
 	irq_data_update_effective_affinity(d, cpumask_of(cpu));
 
 	return IRQ_SET_MASK_OK_DONE;
@@ -1375,6 +1399,30 @@ static bool gic_check_eoimode(struct device_node *node, void __iomem **base)
 	return true;
 }
 
+static bool gic_enable_rmw_access(void *data)
+{
+	/*
+	 * The EMEV2 class of machines has a broken interconnect, and
+	 * locks up on accesses that are less than 32bit. So far, only
+	 * the affinity setting requires it.
+	 */
+	if (of_machine_is_compatible("renesas,emev2")) {
+		static_branch_enable(&needs_rmw_access);
+		return true;
+	}
+
+	return false;
+}
+
+static const struct gic_quirk gic_quirks[] = {
+	{
+		.desc		= "broken byte access",
+		.compatible	= "arm,pl390",
+		.init		= gic_enable_rmw_access,
+	},
+	{ },
+};
+
 static int gic_of_setup(struct gic_chip_data *gic, struct device_node *node)
 {
 	if (!gic || !node)
@@ -1391,6 +1439,8 @@ static int gic_of_setup(struct gic_chip_data *gic, struct device_node *node)
 	if (of_property_read_u32(node, "cpu-offset", &gic->percpu_offset))
 		gic->percpu_offset = 0;
 
+	gic_enable_of_quirks(node, gic_quirks, gic);
+
 	return 0;
 
 error:
diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index f565317a3da3..12df2162108e 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -25,7 +25,7 @@
 /* The maximum IRQ pin number of mbigen chip(start from 0) */
 #define MAXIMUM_IRQ_PIN_NUM		1407
 
-/**
+/*
  * In mbigen vector register
  * bit[21:12]:	event id value
  * bit[11:0]:	device id
@@ -39,14 +39,14 @@
 /* offset of vector register in mbigen node */
 #define REG_MBIGEN_VEC_OFFSET		0x200
 
-/**
+/*
  * offset of clear register in mbigen node
  * This register is used to clear the status
  * of interrupt
  */
 #define REG_MBIGEN_CLEAR_OFFSET		0xa000
 
-/**
+/*
  * offset of interrupt type register
  * This register is used to configure interrupt
  * trigger type
diff --git a/drivers/irqchip/irq-renesas-rza1.c b/drivers/irqchip/irq-renesas-rza1.c
index b0d46ac42b89..72c06e883d1c 100644
--- a/drivers/irqchip/irq-renesas-rza1.c
+++ b/drivers/irqchip/irq-renesas-rza1.c
@@ -223,12 +223,12 @@ static int rza1_irqc_probe(struct platform_device *pdev)
 		goto out_put_node;
 	}
 
-	priv->chip.name = "rza1-irqc",
-	priv->chip.irq_mask = irq_chip_mask_parent,
-	priv->chip.irq_unmask = irq_chip_unmask_parent,
-	priv->chip.irq_eoi = rza1_irqc_eoi,
-	priv->chip.irq_retrigger = irq_chip_retrigger_hierarchy,
-	priv->chip.irq_set_type = rza1_irqc_set_type,
+	priv->chip.name = "rza1-irqc";
+	priv->chip.irq_mask = irq_chip_mask_parent;
+	priv->chip.irq_unmask = irq_chip_unmask_parent;
+	priv->chip.irq_eoi = rza1_irqc_eoi;
+	priv->chip.irq_retrigger = irq_chip_retrigger_hierarchy;
+	priv->chip.irq_set_type = rza1_irqc_set_type;
 	priv->chip.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE;
 
 	priv->irq_domain = irq_domain_add_hierarchy(parent, 0, IRQC_NUM_IRQ,
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 23e4ee523576..9ee238ad29ce 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -251,7 +251,7 @@ static inline struct fwnode_handle *irq_domain_alloc_fwnode(phys_addr_t *pa)
 }
 
 void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
-struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
+struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, unsigned int size,
 				    irq_hw_number_t hwirq_max, int direct_max,
 				    const struct irq_domain_ops *ops,
 				    void *host_data);
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 19e83e9b723c..4d8fc65cf38f 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -136,7 +136,7 @@ EXPORT_SYMBOL_GPL(irq_domain_free_fwnode);
  * Allocates and initializes an irq_domain structure.
  * Returns pointer to IRQ domain, or NULL on failure.
  */
-struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
+struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, unsigned int size,
 				    irq_hw_number_t hwirq_max, int direct_max,
 				    const struct irq_domain_ops *ops,
 				    void *host_data)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [GIT pull] timers/urgent for v5.15-rc3
  2021-09-26 10:30 [GIT pull] irq/urgent for v5.15-rc3 Thomas Gleixner
@ 2021-09-26 10:30 ` Thomas Gleixner
  2021-09-26 17:27   ` pr-tracker-bot
  2021-09-26 10:30 ` [GIT pull] x86/urgent " Thomas Gleixner
  2021-09-26 17:27 ` [GIT pull] irq/urgent " pr-tracker-bot
  2 siblings, 1 reply; 17+ messages in thread
From: Thomas Gleixner @ 2021-09-26 10:30 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest timers/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2021-09-26

up to:  8cd9da85d2bd: posix-cpu-timers: Prevent spuriously armed 0-value itimer


A single fix for the recently introduced regression in posix CPU timers
which failed to stop the timer when requested. That caused unexpected
signals to be sent to the process/thread causing malfunction.

Thanks,

	tglx

------------------>
Frederic Weisbecker (1):
      posix-cpu-timers: Prevent spuriously armed 0-value itimer


 kernel/time/posix-cpu-timers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index ee736861b18f..643d412ac623 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -1404,7 +1404,8 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clkid,
 			}
 		}
 
-		*newval += now;
+		if (*newval)
+			*newval += now;
 	}
 
 	/*


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [GIT pull] x86/urgent for v5.15-rc3
  2021-09-26 10:30 [GIT pull] irq/urgent for v5.15-rc3 Thomas Gleixner
  2021-09-26 10:30 ` [GIT pull] timers/urgent " Thomas Gleixner
@ 2021-09-26 10:30 ` Thomas Gleixner
  2021-09-26 17:21   ` Linus Torvalds
  2021-09-26 17:27   ` [GIT pull] x86/urgent for v5.15-rc3 pr-tracker-bot
  2021-09-26 17:27 ` [GIT pull] irq/urgent " pr-tracker-bot
  2 siblings, 2 replies; 17+ messages in thread
From: Thomas Gleixner @ 2021-09-26 10:30 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest x86/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2021-09-26

up to:  5ba1071f7554: x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses


A set of fixes for X86:

 - Prevent sending the wrong signal when protection keys are enabled and
   the kernel handles a fault in the vsyscall emulation.

 - Invoke early_reserve_memory() before invoking e820_memory_setup() which
   is required to make the Xen dom0 e820 hooks work correctly.

 - Use the correct data type for the SETZ operand in the EMQCMDS
   instruction wrapper.

 - Prevent undefined behaviour to the potential unaligned accesss in the
   instroction decoder library.

Thanks,

	tglx

------------------>
Jiashuo Liang (1):
      x86/fault: Fix wrong signal when vsyscall fails with pkey

Juergen Gross (1):
      x86/setup: Call early_reserve_memory() earlier

Kees Cook (1):
      x86/asm: Fix SETZ size enqcmds() build failure

Numfor Mbiziwo-Tiapo (1):
      x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses


 arch/x86/include/asm/pkeys.h         |  2 --
 arch/x86/include/asm/special_insns.h |  2 +-
 arch/x86/kernel/setup.c              | 26 ++++++++++++++------------
 arch/x86/lib/insn.c                  |  4 ++--
 arch/x86/mm/fault.c                  | 26 ++++++++++++++++++--------
 include/linux/pkeys.h                |  2 ++
 tools/arch/x86/lib/insn.c            |  4 ++--
 7 files changed, 39 insertions(+), 27 deletions(-)

diff --git a/arch/x86/include/asm/pkeys.h b/arch/x86/include/asm/pkeys.h
index 5c7bcaa79623..1d5f14aff5f6 100644
--- a/arch/x86/include/asm/pkeys.h
+++ b/arch/x86/include/asm/pkeys.h
@@ -2,8 +2,6 @@
 #ifndef _ASM_X86_PKEYS_H
 #define _ASM_X86_PKEYS_H
 
-#define ARCH_DEFAULT_PKEY	0
-
 /*
  * If more than 16 keys are ever supported, a thorough audit
  * will be necessary to ensure that the types that store key
diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
index f3fbb84ff8a7..68c257a3de0d 100644
--- a/arch/x86/include/asm/special_insns.h
+++ b/arch/x86/include/asm/special_insns.h
@@ -275,7 +275,7 @@ static inline int enqcmds(void __iomem *dst, const void *src)
 {
 	const struct { char _[64]; } *__src = src;
 	struct { char _[64]; } __iomem *__dst = dst;
-	int zf;
+	bool zf;
 
 	/*
 	 * ENQCMDS %(rdx), rax
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 79f164141116..40ed44ead063 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -830,6 +830,20 @@ void __init setup_arch(char **cmdline_p)
 
 	x86_init.oem.arch_setup();
 
+	/*
+	 * Do some memory reservations *before* memory is added to memblock, so
+	 * memblock allocations won't overwrite it.
+	 *
+	 * After this point, everything still needed from the boot loader or
+	 * firmware or kernel text should be early reserved or marked not RAM in
+	 * e820. All other memory is free game.
+	 *
+	 * This call needs to happen before e820__memory_setup() which calls the
+	 * xen_memory_setup() on Xen dom0 which relies on the fact that those
+	 * early reservations have happened already.
+	 */
+	early_reserve_memory();
+
 	iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
 	e820__memory_setup();
 	parse_setup_data();
@@ -876,18 +890,6 @@ void __init setup_arch(char **cmdline_p)
 
 	parse_early_param();
 
-	/*
-	 * Do some memory reservations *before* memory is added to
-	 * memblock, so memblock allocations won't overwrite it.
-	 * Do it after early param, so we could get (unlikely) panic from
-	 * serial.
-	 *
-	 * After this point everything still needed from the boot loader or
-	 * firmware or kernel text should be early reserved or marked not
-	 * RAM in e820. All other memory is free game.
-	 */
-	early_reserve_memory();
-
 #ifdef CONFIG_MEMORY_HOTPLUG
 	/*
 	 * Memory used by the kernel cannot be hot-removed because Linux
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index 058f19b20465..c565def611e2 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -37,10 +37,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r = *(t*)((insn)->next_byte + n); leXX_to_cpu(t, r); })
+	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index b2eefdefc108..84a2c8c4af73 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -710,7 +710,8 @@ page_fault_oops(struct pt_regs *regs, unsigned long error_code,
 
 static noinline void
 kernelmode_fixup_or_oops(struct pt_regs *regs, unsigned long error_code,
-			 unsigned long address, int signal, int si_code)
+			 unsigned long address, int signal, int si_code,
+			 u32 pkey)
 {
 	WARN_ON_ONCE(user_mode(regs));
 
@@ -735,8 +736,12 @@ kernelmode_fixup_or_oops(struct pt_regs *regs, unsigned long error_code,
 
 			set_signal_archinfo(address, error_code);
 
-			/* XXX: hwpoison faults will set the wrong code. */
-			force_sig_fault(signal, si_code, (void __user *)address);
+			if (si_code == SEGV_PKUERR) {
+				force_sig_pkuerr((void __user *)address, pkey);
+			} else {
+				/* XXX: hwpoison faults will set the wrong code. */
+				force_sig_fault(signal, si_code, (void __user *)address);
+			}
 		}
 
 		/*
@@ -798,7 +803,8 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
 	struct task_struct *tsk = current;
 
 	if (!user_mode(regs)) {
-		kernelmode_fixup_or_oops(regs, error_code, address, pkey, si_code);
+		kernelmode_fixup_or_oops(regs, error_code, address,
+					 SIGSEGV, si_code, pkey);
 		return;
 	}
 
@@ -930,7 +936,8 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
 {
 	/* Kernel mode? Handle exceptions or die: */
 	if (!user_mode(regs)) {
-		kernelmode_fixup_or_oops(regs, error_code, address, SIGBUS, BUS_ADRERR);
+		kernelmode_fixup_or_oops(regs, error_code, address,
+					 SIGBUS, BUS_ADRERR, ARCH_DEFAULT_PKEY);
 		return;
 	}
 
@@ -1396,7 +1403,8 @@ void do_user_addr_fault(struct pt_regs *regs,
 		 */
 		if (!user_mode(regs))
 			kernelmode_fixup_or_oops(regs, error_code, address,
-						 SIGBUS, BUS_ADRERR);
+						 SIGBUS, BUS_ADRERR,
+						 ARCH_DEFAULT_PKEY);
 		return;
 	}
 
@@ -1416,7 +1424,8 @@ void do_user_addr_fault(struct pt_regs *regs,
 		return;
 
 	if (fatal_signal_pending(current) && !user_mode(regs)) {
-		kernelmode_fixup_or_oops(regs, error_code, address, 0, 0);
+		kernelmode_fixup_or_oops(regs, error_code, address,
+					 0, 0, ARCH_DEFAULT_PKEY);
 		return;
 	}
 
@@ -1424,7 +1433,8 @@ void do_user_addr_fault(struct pt_regs *regs,
 		/* Kernel mode? Handle exceptions or die: */
 		if (!user_mode(regs)) {
 			kernelmode_fixup_or_oops(regs, error_code, address,
-						 SIGSEGV, SEGV_MAPERR);
+						 SIGSEGV, SEGV_MAPERR,
+						 ARCH_DEFAULT_PKEY);
 			return;
 		}
 
diff --git a/include/linux/pkeys.h b/include/linux/pkeys.h
index 6beb26b7151d..86be8bf27b41 100644
--- a/include/linux/pkeys.h
+++ b/include/linux/pkeys.h
@@ -4,6 +4,8 @@
 
 #include <linux/mm.h>
 
+#define ARCH_DEFAULT_PKEY	0
+
 #ifdef CONFIG_ARCH_HAS_PKEYS
 #include <asm/pkeys.h>
 #else /* ! CONFIG_ARCH_HAS_PKEYS */
diff --git a/tools/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
index c41f95815480..797699462cd8 100644
--- a/tools/arch/x86/lib/insn.c
+++ b/tools/arch/x86/lib/insn.c
@@ -37,10 +37,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r = *(t*)((insn)->next_byte + n); leXX_to_cpu(t, r); })
+	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-26 10:30 ` [GIT pull] x86/urgent " Thomas Gleixner
@ 2021-09-26 17:21   ` Linus Torvalds
  2021-09-26 18:15     ` Borislav Petkov
  2021-09-26 17:27   ` [GIT pull] x86/urgent for v5.15-rc3 pr-tracker-bot
  1 sibling, 1 reply; 17+ messages in thread
From: Linus Torvalds @ 2021-09-26 17:21 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linux Kernel Mailing List, the arch/x86 maintainers

On Sun, Sep 26, 2021 at 3:30 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
>  - Prevent undefined behaviour to the potential unaligned accesss in the
>    instroction decoder library.

What a horrible fix that is.

This is why we have "get_unaligned()". It might use memcpy()
internally on some architectures (it doesn't really any more - Arnd
cleaned it all up and now it uses a pointer that is marked unaligned),
but more importantly it explains _why_ something is done the way it's
done, rather than be an odd memcpy().

Oh well. The memcpy works, and compilers will do the right thing for
it, but it's ugly.

In this case, it's actually *doubly* ugly, though, because we
literally have functions to "load unaligned data in little-endian
format".

So instead of doing a "memcpy()", followed by a magic special macro
that does a "switch (sizeof(t))" and does a "le*_to_cpu()" on the
result, the code could  literally have used the functions that do this
all for them.

Ugh. Pulled. But it's ugly.

           Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-26 10:30 ` [GIT pull] x86/urgent " Thomas Gleixner
  2021-09-26 17:21   ` Linus Torvalds
@ 2021-09-26 17:27   ` pr-tracker-bot
  1 sibling, 0 replies; 17+ messages in thread
From: pr-tracker-bot @ 2021-09-26 17:27 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linus Torvalds, linux-kernel, x86

The pull request you sent on Sun, 26 Sep 2021 12:30:09 +0200 (CEST):

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2021-09-26

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5bb7b2107f8c8e97750a36a723f3f74f819f6ff1

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] timers/urgent for v5.15-rc3
  2021-09-26 10:30 ` [GIT pull] timers/urgent " Thomas Gleixner
@ 2021-09-26 17:27   ` pr-tracker-bot
  0 siblings, 0 replies; 17+ messages in thread
From: pr-tracker-bot @ 2021-09-26 17:27 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linus Torvalds, linux-kernel, x86

The pull request you sent on Sun, 26 Sep 2021 12:30:07 +0200 (CEST):

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2021-09-26

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/3a398acc56dd7592eba081ce1ea356151ab90e2d

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] irq/urgent for v5.15-rc3
  2021-09-26 10:30 [GIT pull] irq/urgent for v5.15-rc3 Thomas Gleixner
  2021-09-26 10:30 ` [GIT pull] timers/urgent " Thomas Gleixner
  2021-09-26 10:30 ` [GIT pull] x86/urgent " Thomas Gleixner
@ 2021-09-26 17:27 ` pr-tracker-bot
  2 siblings, 0 replies; 17+ messages in thread
From: pr-tracker-bot @ 2021-09-26 17:27 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Linus Torvalds, linux-kernel, x86

The pull request you sent on Sun, 26 Sep 2021 12:30:06 +0200 (CEST):

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-urgent-2021-09-26

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/dc0f97c2613d09734719ef89d99d06417d92337d

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-26 17:21   ` Linus Torvalds
@ 2021-09-26 18:15     ` Borislav Petkov
  2021-09-26 19:10       ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Borislav Petkov @ 2021-09-26 18:15 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

On Sun, Sep 26, 2021 at 10:21:18AM -0700, Linus Torvalds wrote:
> On Sun, Sep 26, 2021 at 3:30 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> >  - Prevent undefined behaviour to the potential unaligned accesss in the
> >    instroction decoder library.
> 
> What a horrible fix that is.
> 
> This is why we have "get_unaligned()". It might use memcpy()
> internally on some architectures (it doesn't really any more - Arnd
> cleaned it all up and now it uses a pointer that is marked unaligned),
> but more importantly it explains _why_ something is done the way it's
> done, rather than be an odd memcpy().
> 
> Oh well. The memcpy works, and compilers will do the right thing for
> it, but it's ugly.
> 
> In this case, it's actually *doubly* ugly, though, because we
> literally have functions to "load unaligned data in little-endian
> format".
> 
> So instead of doing a "memcpy()", followed by a magic special macro
> that does a "switch (sizeof(t))" and does a "le*_to_cpu()" on the
> result, the code could  literally have used the functions that do this
> all for them.
> 
> Ugh. Pulled. But it's ugly.

Yeah, that came up during review:

https://lore.kernel.org/lkml/CAP-5=fU2XBoOa2=00VCuWYqsLUzMSMzUXY63ZJt9rz-NJ+vYwA@mail.gmail.com/

and the follow-on messages and AFAICT the only hurdle to using
get_unaligned() is exporting it into tools/ for use by the version of
the insn decoder there in tools/arch/x86/lib/insn.c.

There's this other rather "theoretical" thing of Intel PT
decoding being done on any arch but get_unaligned() from
include/asm-generic/unaligned.h looks as generic and as arch-agnostic as
they get, to me...

But let me add the gents to Cc.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-26 18:15     ` Borislav Petkov
@ 2021-09-26 19:10       ` Linus Torvalds
  2021-09-28 17:56         ` Borislav Petkov
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Torvalds @ 2021-09-26 19:10 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

On Sun, Sep 26, 2021 at 11:15 AM Borislav Petkov <bp@alien8.de> wrote:
>
> There's this other rather "theoretical" thing of Intel PT
> decoding being done on any arch but get_unaligned() from
> include/asm-generic/unaligned.h looks as generic and as arch-agnostic as
> they get, to me...

It does now. It used to be a mess where every architecture did their
own thing, including nothing (x86) or lots of inline asm (several).

Arnd cleaned it all up fairly recently.

It turns out doing nothing is wrong - not because of architecture
issues, but because of compiler issues - and doing inline asms is
counter-productive because the compilers will handle the unaligned
case for us.

So every architecture uses that <asm-generic/unaligned.h> and is happy about it.

A couple of architectures still have their own <asm/unaligned.h>, but
that's just because they have some additional stuff for legacy reasons
there. They still use the generic header for the actual unaligned
handling.

               Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-26 19:10       ` Linus Torvalds
@ 2021-09-28 17:56         ` Borislav Petkov
  2021-09-28 20:13           ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Borislav Petkov @ 2021-09-28 17:56 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

On Sun, Sep 26, 2021 at 12:10:50PM -0700, Linus Torvalds wrote:
> So every architecture uses that <asm-generic/unaligned.h> and is happy
> about it.

Ok, how does that look?

It looks pretty straight-forward to me but WTH do I know?!

Anyway, it builds and boots fine in a guest here so it must be perfect.

---
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index c565def611e2..d49ea843b915 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -13,34 +13,22 @@
 #endif
 #include <asm/inat.h> /*__ignore_sync_check__ */
 #include <asm/insn.h> /* __ignore_sync_check__ */
+#include <asm/unaligned.h> /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
 
 #include <asm/emulate_prefix.h> /* __ignore_sync_check__ */
 
-#define leXX_to_cpu(t, r)						\
-({									\
-	__typeof__(t) v;						\
-	switch (sizeof(t)) {						\
-	case 4: v = le32_to_cpu(r); break;				\
-	case 2: v = le16_to_cpu(r); break;				\
-	case 1:	v = r; break;						\
-	default:							\
-		BUILD_BUG(); break;					\
-	}								\
-	v;								\
-})
-
 /* Verify next sizeof(t) bytes can be on the same instruction */
 #define validate_next(t, insn, n)	\
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); r; })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ get_unaligned((t *)(insn)->next_byte + n); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
index 797699462cd8..be59e17e75dc 100644
--- a/tools/arch/x86/lib/insn.c
+++ b/tools/arch/x86/lib/insn.c
@@ -13,34 +13,22 @@
 #endif
 #include "../include/asm/inat.h" /* __ignore_sync_check__ */
 #include "../include/asm/insn.h" /* __ignore_sync_check__ */
+#include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
 
 #include "../include/asm/emulate_prefix.h" /* __ignore_sync_check__ */
 
-#define leXX_to_cpu(t, r)						\
-({									\
-	__typeof__(t) v;						\
-	switch (sizeof(t)) {						\
-	case 4: v = le32_to_cpu(r); break;				\
-	case 2: v = le16_to_cpu(r); break;				\
-	case 1:	v = r; break;						\
-	default:							\
-		BUILD_BUG(); break;					\
-	}								\
-	v;								\
-})
-
 /* Verify next sizeof(t) bytes can be on the same instruction */
 #define validate_next(t, insn, n)	\
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); r; })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ get_unaligned((t *)(insn)->next_byte + n); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/include/asm-generic/unaligned.h b/tools/include/asm-generic/unaligned.h
new file mode 100644
index 000000000000..47387c607035
--- /dev/null
+++ b/tools/include/asm-generic/unaligned.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copied from the kernel sources to tools/perf/:
+ */
+
+#ifndef __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+#define __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+
+#define __get_unaligned_t(type, ptr) ({						\
+	const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);	\
+	__pptr->x;								\
+})
+
+#define __put_unaligned_t(type, val, ptr) do {					\
+	struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);		\
+	__pptr->x = (val);							\
+} while (0)
+
+#define get_unaligned(ptr)	__get_unaligned_t(typeof(*(ptr)), (ptr))
+#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr))
+
+#endif /* __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H */
+
-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-28 17:56         ` Borislav Petkov
@ 2021-09-28 20:13           ` Linus Torvalds
  2021-09-28 20:41             ` Borislav Petkov
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Torvalds @ 2021-09-28 20:13 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

On Tue, Sep 28, 2021 at 10:56 AM Borislav Petkov <bp@alien8.de> wrote:
>
> Ok, how does that look?

Well, cleaner.

You lost the leXX_to_cpu() part, so now it does the wrong thing if you
were to cross-build the tooling side on a BE architecture.

The actual kernel side is fine, of course, since it runs on x86 by definition.

So it's purely the tool side - I assume this instruction decoding is
used for objtool or something.

I'm not sure that matters. BE is dead, nobody would ever cross-build
tooling that way. But maybe a compile-time error, at least, so that
the problem is obvious.

            Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-28 20:13           ` Linus Torvalds
@ 2021-09-28 20:41             ` Borislav Petkov
  2021-09-28 22:44               ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Borislav Petkov @ 2021-09-28 20:41 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

On Tue, Sep 28, 2021 at 01:13:49PM -0700, Linus Torvalds wrote:
> Well, cleaner.
> 
> You lost the leXX_to_cpu() part, so now it does the wrong thing if you
> were to cross-build the tooling side on a BE architecture.

Bah, I got carried away with the axe...

And looka here: 1d509f2a6ebc ("x86/insn: Support big endian cross-compiles")
 
> I'm not sure that matters. BE is dead, nobody would ever cross-build
> tooling that way. But maybe a compile-time error, at least, so that
> the problem is obvious.

Yeah, lemme re-add those conversion things - looks like we do use them.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [GIT pull] x86/urgent for v5.15-rc3
  2021-09-28 20:41             ` Borislav Petkov
@ 2021-09-28 22:44               ` Linus Torvalds
  2021-09-29 18:10                 ` [PATCH] x86/insn: Use get_unaligned() instead of memcpy() Borislav Petkov
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Torvalds @ 2021-09-28 22:44 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

On Tue, Sep 28, 2021 at 1:41 PM Borislav Petkov <bp@alien8.de> wrote:
>
> Bah, I got carried away with the axe...
>
> And looka here: 1d509f2a6ebc ("x86/insn: Support big endian cross-compiles")

Ahh. s390. For some reason I thought they were LE too, clearly
incorrectly. So yeah, there still are serious big BE machines that you
might want to cross-compile from.

             Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] x86/insn: Use get_unaligned() instead of memcpy()
  2021-09-28 22:44               ` Linus Torvalds
@ 2021-09-29 18:10                 ` Borislav Petkov
  2021-09-30  0:00                   ` Masami Hiramatsu
                                     ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Borislav Petkov @ 2021-09-29 18:10 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

From: Borislav Petkov <bp@suse.de>

Use get_unaligned() instead of memcpy() to access potentially unaligned
memory, which, when accessed through a pointer, leads to undefined
behavior. get_unaligned() describes much better what is happening there
anyway even if memcpy() does the job.

No functional changes.

Fixes: 5ba1071f7554 ("x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/lib/insn.c                   |  5 +++--
 tools/arch/x86/lib/insn.c             |  5 +++--
 tools/include/asm-generic/unaligned.h | 23 +++++++++++++++++++++++
 3 files changed, 29 insertions(+), 4 deletions(-)
 create mode 100644 tools/include/asm-generic/unaligned.h

diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index c565def611e2..55e371cc69fd 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -13,6 +13,7 @@
 #endif
 #include <asm/inat.h> /*__ignore_sync_check__ */
 #include <asm/insn.h> /* __ignore_sync_check__ */
+#include <asm/unaligned.h> /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
@@ -37,10 +38,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
index 797699462cd8..8fd63a067308 100644
--- a/tools/arch/x86/lib/insn.c
+++ b/tools/arch/x86/lib/insn.c
@@ -13,6 +13,7 @@
 #endif
 #include "../include/asm/inat.h" /* __ignore_sync_check__ */
 #include "../include/asm/insn.h" /* __ignore_sync_check__ */
+#include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
@@ -37,10 +38,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/include/asm-generic/unaligned.h b/tools/include/asm-generic/unaligned.h
new file mode 100644
index 000000000000..47387c607035
--- /dev/null
+++ b/tools/include/asm-generic/unaligned.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copied from the kernel sources to tools/perf/:
+ */
+
+#ifndef __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+#define __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+
+#define __get_unaligned_t(type, ptr) ({						\
+	const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);	\
+	__pptr->x;								\
+})
+
+#define __put_unaligned_t(type, val, ptr) do {					\
+	struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);		\
+	__pptr->x = (val);							\
+} while (0)
+
+#define get_unaligned(ptr)	__get_unaligned_t(typeof(*(ptr)), (ptr))
+#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr))
+
+#endif /* __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H */
+
-- 
2.29.2


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH] x86/insn: Use get_unaligned() instead of memcpy()
  2021-09-29 18:10                 ` [PATCH] x86/insn: Use get_unaligned() instead of memcpy() Borislav Petkov
@ 2021-09-30  0:00                   ` Masami Hiramatsu
  2021-10-04  9:48                   ` [tip: x86/misc] " tip-bot2 for Borislav Petkov
  2021-10-06 10:02                   ` tip-bot2 for Borislav Petkov
  2 siblings, 0 replies; 17+ messages in thread
From: Masami Hiramatsu @ 2021-09-30  0:00 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Linus Torvalds, Thomas Gleixner, Linux Kernel Mailing List,
	the arch/x86 maintainers, Masami Hiramatsu, Adrian Hunter,
	Ian Rogers

On Wed, 29 Sep 2021 20:10:42 +0200
Borislav Petkov <bp@alien8.de> wrote:

> From: Borislav Petkov <bp@suse.de>
> 
> Use get_unaligned() instead of memcpy() to access potentially unaligned
> memory, which, when accessed through a pointer, leads to undefined
> behavior. get_unaligned() describes much better what is happening there
> anyway even if memcpy() does the job.
> 
> No functional changes.

Thank you very much to fix this! This looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>


> 
> Fixes: 5ba1071f7554 ("x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses")
> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  arch/x86/lib/insn.c                   |  5 +++--
>  tools/arch/x86/lib/insn.c             |  5 +++--
>  tools/include/asm-generic/unaligned.h | 23 +++++++++++++++++++++++
>  3 files changed, 29 insertions(+), 4 deletions(-)
>  create mode 100644 tools/include/asm-generic/unaligned.h
> 
> diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
> index c565def611e2..55e371cc69fd 100644
> --- a/arch/x86/lib/insn.c
> +++ b/arch/x86/lib/insn.c
> @@ -13,6 +13,7 @@
>  #endif
>  #include <asm/inat.h> /*__ignore_sync_check__ */
>  #include <asm/insn.h> /* __ignore_sync_check__ */
> +#include <asm/unaligned.h> /* __ignore_sync_check__ */
>  
>  #include <linux/errno.h>
>  #include <linux/kconfig.h>
> @@ -37,10 +38,10 @@
>  	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
>  
>  #define __get_next(t, insn)	\
> -	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
> +	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
>  
>  #define __peek_nbyte_next(t, insn, n)	\
> -	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
> +	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
>  
>  #define get_next(t, insn)	\
>  	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
> diff --git a/tools/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
> index 797699462cd8..8fd63a067308 100644
> --- a/tools/arch/x86/lib/insn.c
> +++ b/tools/arch/x86/lib/insn.c
> @@ -13,6 +13,7 @@
>  #endif
>  #include "../include/asm/inat.h" /* __ignore_sync_check__ */
>  #include "../include/asm/insn.h" /* __ignore_sync_check__ */
> +#include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */
>  
>  #include <linux/errno.h>
>  #include <linux/kconfig.h>
> @@ -37,10 +38,10 @@
>  	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
>  
>  #define __get_next(t, insn)	\
> -	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
> +	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
>  
>  #define __peek_nbyte_next(t, insn, n)	\
> -	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
> +	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
>  
>  #define get_next(t, insn)	\
>  	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
> diff --git a/tools/include/asm-generic/unaligned.h b/tools/include/asm-generic/unaligned.h
> new file mode 100644
> index 000000000000..47387c607035
> --- /dev/null
> +++ b/tools/include/asm-generic/unaligned.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copied from the kernel sources to tools/perf/:
> + */
> +
> +#ifndef __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
> +#define __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
> +
> +#define __get_unaligned_t(type, ptr) ({						\
> +	const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);	\
> +	__pptr->x;								\
> +})
> +
> +#define __put_unaligned_t(type, val, ptr) do {					\
> +	struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);		\
> +	__pptr->x = (val);							\
> +} while (0)
> +
> +#define get_unaligned(ptr)	__get_unaligned_t(typeof(*(ptr)), (ptr))
> +#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr))
> +
> +#endif /* __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H */
> +
> -- 
> 2.29.2
> 
> 
> -- 
> Regards/Gruss,
>     Boris.
> 
> https://people.kernel.org/tglx/notes-about-netiquette


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [tip: x86/misc] x86/insn: Use get_unaligned() instead of memcpy()
  2021-09-29 18:10                 ` [PATCH] x86/insn: Use get_unaligned() instead of memcpy() Borislav Petkov
  2021-09-30  0:00                   ` Masami Hiramatsu
@ 2021-10-04  9:48                   ` tip-bot2 for Borislav Petkov
  2021-10-06 10:02                   ` tip-bot2 for Borislav Petkov
  2 siblings, 0 replies; 17+ messages in thread
From: tip-bot2 for Borislav Petkov @ 2021-10-04  9:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Linus Torvalds, Borislav Petkov, Masami Hiramatsu, x86, linux-kernel

The following commit has been merged into the x86/misc branch of tip:

Commit-ID:     a1be25a30cf654b3314bc7b26db5e52716833144
Gitweb:        https://git.kernel.org/tip/a1be25a30cf654b3314bc7b26db5e52716833144
Author:        Borislav Petkov <bp@suse.de>
AuthorDate:    Wed, 29 Sep 2021 16:37:53 +02:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Mon, 04 Oct 2021 11:11:58 +02:00

x86/insn: Use get_unaligned() instead of memcpy()

Use get_unaligned() instead of memcpy() to access potentially unaligned
memory, which, when accessed through a pointer, leads to undefined
behavior. get_unaligned() describes much better what is happening there
anyway even if memcpy() does the job.

No functional changes.

Fixes: 5ba1071f7554 ("x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lkml.kernel.org/r/YVSsIkj9Z29TyUjE@zn.tnic
---
 arch/x86/lib/insn.c                   |  5 +++--
 tools/arch/x86/lib/insn.c             |  5 +++--
 tools/include/asm-generic/unaligned.h | 23 +++++++++++++++++++++++
 3 files changed, 29 insertions(+), 4 deletions(-)
 create mode 100644 tools/include/asm-generic/unaligned.h

diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index c565def..55e371c 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -13,6 +13,7 @@
 #endif
 #include <asm/inat.h> /*__ignore_sync_check__ */
 #include <asm/insn.h> /* __ignore_sync_check__ */
+#include <asm/unaligned.h> /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
@@ -37,10 +38,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
index 7976994..8fd63a0 100644
--- a/tools/arch/x86/lib/insn.c
+++ b/tools/arch/x86/lib/insn.c
@@ -13,6 +13,7 @@
 #endif
 #include "../include/asm/inat.h" /* __ignore_sync_check__ */
 #include "../include/asm/insn.h" /* __ignore_sync_check__ */
+#include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
@@ -37,10 +38,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/include/asm-generic/unaligned.h b/tools/include/asm-generic/unaligned.h
new file mode 100644
index 0000000..47387c6
--- /dev/null
+++ b/tools/include/asm-generic/unaligned.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copied from the kernel sources to tools/perf/:
+ */
+
+#ifndef __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+#define __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+
+#define __get_unaligned_t(type, ptr) ({						\
+	const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);	\
+	__pptr->x;								\
+})
+
+#define __put_unaligned_t(type, val, ptr) do {					\
+	struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);		\
+	__pptr->x = (val);							\
+} while (0)
+
+#define get_unaligned(ptr)	__get_unaligned_t(typeof(*(ptr)), (ptr))
+#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr))
+
+#endif /* __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H */
+

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [tip: x86/misc] x86/insn: Use get_unaligned() instead of memcpy()
  2021-09-29 18:10                 ` [PATCH] x86/insn: Use get_unaligned() instead of memcpy() Borislav Petkov
  2021-09-30  0:00                   ` Masami Hiramatsu
  2021-10-04  9:48                   ` [tip: x86/misc] " tip-bot2 for Borislav Petkov
@ 2021-10-06 10:02                   ` tip-bot2 for Borislav Petkov
  2 siblings, 0 replies; 17+ messages in thread
From: tip-bot2 for Borislav Petkov @ 2021-10-06 10:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Linus Torvalds, Borislav Petkov, Masami Hiramatsu,
	Stephen Rothwell, x86, linux-kernel

The following commit has been merged into the x86/misc branch of tip:

Commit-ID:     f96b4675839b66168f5a07bf964dde6c2f1c4885
Gitweb:        https://git.kernel.org/tip/f96b4675839b66168f5a07bf964dde6c2f1c4885
Author:        Borislav Petkov <bp@suse.de>
AuthorDate:    Wed, 29 Sep 2021 16:37:53 +02:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Wed, 06 Oct 2021 11:56:37 +02:00

x86/insn: Use get_unaligned() instead of memcpy()

Use get_unaligned() instead of memcpy() to access potentially unaligned
memory, which, when accessed through a pointer, leads to undefined
behavior. get_unaligned() describes much better what is happening there
anyway even if memcpy() does the job.

In addition, since perf tool builds with -Werror, it would fire with:

  util/intel-pt-decoder/../../../arch/x86/lib/insn.c: In function '__insn_get_emulate_prefix':
  tools/include/../include/asm-generic/unaligned.h:10:15: error: packed attribute is unnecessary [-Werror=packed]
     10 |  const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \

because -Werror=packed would complain if the packed attribute would have
no effect on the layout of the structure.

In this case, that is intentional so disable the warning only for that
compilation unit.

That part is Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>

No functional changes.

Fixes: 5ba1071f7554 ("x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lkml.kernel.org/r/YVSsIkj9Z29TyUjE@zn.tnic
---
 arch/x86/lib/insn.c                    |  5 +++--
 tools/arch/x86/lib/insn.c              |  5 +++--
 tools/include/asm-generic/unaligned.h  | 23 +++++++++++++++++++++++
 tools/perf/util/intel-pt-decoder/Build |  2 ++
 4 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 tools/include/asm-generic/unaligned.h

diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index c565def..55e371c 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -13,6 +13,7 @@
 #endif
 #include <asm/inat.h> /*__ignore_sync_check__ */
 #include <asm/insn.h> /* __ignore_sync_check__ */
+#include <asm/unaligned.h> /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
@@ -37,10 +38,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/arch/x86/lib/insn.c b/tools/arch/x86/lib/insn.c
index 7976994..8fd63a0 100644
--- a/tools/arch/x86/lib/insn.c
+++ b/tools/arch/x86/lib/insn.c
@@ -13,6 +13,7 @@
 #endif
 #include "../include/asm/inat.h" /* __ignore_sync_check__ */
 #include "../include/asm/insn.h" /* __ignore_sync_check__ */
+#include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */
 
 #include <linux/errno.h>
 #include <linux/kconfig.h>
@@ -37,10 +38,10 @@
 	((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
 
 #define __get_next(t, insn)	\
-	({ t r; memcpy(&r, insn->next_byte, sizeof(t)); insn->next_byte += sizeof(t); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r); })
 
 #define __peek_nbyte_next(t, insn, n)	\
-	({ t r; memcpy(&r, (insn)->next_byte + n, sizeof(t)); leXX_to_cpu(t, r); })
+	({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); })
 
 #define get_next(t, insn)	\
 	({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
diff --git a/tools/include/asm-generic/unaligned.h b/tools/include/asm-generic/unaligned.h
new file mode 100644
index 0000000..47387c6
--- /dev/null
+++ b/tools/include/asm-generic/unaligned.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copied from the kernel sources to tools/perf/:
+ */
+
+#ifndef __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+#define __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
+
+#define __get_unaligned_t(type, ptr) ({						\
+	const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);	\
+	__pptr->x;								\
+})
+
+#define __put_unaligned_t(type, val, ptr) do {					\
+	struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);		\
+	__pptr->x = (val);							\
+} while (0)
+
+#define get_unaligned(ptr)	__get_unaligned_t(typeof(*(ptr)), (ptr))
+#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr))
+
+#endif /* __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H */
+
diff --git a/tools/perf/util/intel-pt-decoder/Build b/tools/perf/util/intel-pt-decoder/Build
index bc62935..b41c2e9 100644
--- a/tools/perf/util/intel-pt-decoder/Build
+++ b/tools/perf/util/intel-pt-decoder/Build
@@ -18,3 +18,5 @@ CFLAGS_intel-pt-insn-decoder.o += -I$(OUTPUT)util/intel-pt-decoder
 ifeq ($(CC_NO_CLANG), 1)
   CFLAGS_intel-pt-insn-decoder.o += -Wno-override-init
 endif
+
+CFLAGS_intel-pt-insn-decoder.o += -Wno-packed

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-10-06 10:02 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 10:30 [GIT pull] irq/urgent for v5.15-rc3 Thomas Gleixner
2021-09-26 10:30 ` [GIT pull] timers/urgent " Thomas Gleixner
2021-09-26 17:27   ` pr-tracker-bot
2021-09-26 10:30 ` [GIT pull] x86/urgent " Thomas Gleixner
2021-09-26 17:21   ` Linus Torvalds
2021-09-26 18:15     ` Borislav Petkov
2021-09-26 19:10       ` Linus Torvalds
2021-09-28 17:56         ` Borislav Petkov
2021-09-28 20:13           ` Linus Torvalds
2021-09-28 20:41             ` Borislav Petkov
2021-09-28 22:44               ` Linus Torvalds
2021-09-29 18:10                 ` [PATCH] x86/insn: Use get_unaligned() instead of memcpy() Borislav Petkov
2021-09-30  0:00                   ` Masami Hiramatsu
2021-10-04  9:48                   ` [tip: x86/misc] " tip-bot2 for Borislav Petkov
2021-10-06 10:02                   ` tip-bot2 for Borislav Petkov
2021-09-26 17:27   ` [GIT pull] x86/urgent for v5.15-rc3 pr-tracker-bot
2021-09-26 17:27 ` [GIT pull] irq/urgent " pr-tracker-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.