Linux 6.2.1
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.2.1 kernel.
All users of the 6.2 kernel series must upgrade.
The updated 6.2.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.2.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
MAINTAINERS | 2 Makefile | 2 arch/x86/include/asm/text-patching.h | 31 ++++++++++++ arch/x86/kernel/alternative.c | 62 ++++++++++++++++++------- arch/x86/kernel/kprobes/core.c | 38 +++------------ arch/x86/kernel/static_call.c | 50 ++++++++++++++++++-- drivers/hid/hid-mcp2221.c | 3 + drivers/net/wireless/marvell/mwifiex/sdio.c | 1 drivers/platform/x86/amd/pmf/Kconfig | 1 drivers/platform/x86/nvidia-wmi-ec-backlight.c | 6 ++ fs/ext4/sysfs.c | 7 ++ include/linux/nospec.h | 4 + kernel/bpf/core.c | 3 - lib/usercopy.c | 7 ++ security/Kconfig.hardening | 3 + 15 files changed, 166 insertions(+), 54 deletions(-)
Benjamin Tissoires (1):
HID: mcp-2221: prevent UAF in delayed work
Dave Hansen (1):
uaccess: Add speculation barrier to copy_from_user()
Eric Biggers (1):
randstruct: disable Clang 15 support
Greg Kroah-Hartman (1):
Linux 6.2.1
Hans de Goede (1):
platform/x86: nvidia-wmi-ec-backlight: Add force module parameter
Kees Cook (1):
ext4: Fix function prototype mismatch for ext4_feat_ktype
Linus Torvalds (1):
bpf: add missing header file include
Lukas Wunner (1):
wifi: mwifiex: Add missing compatible string for SD8787
Paul Moore (1):
audit: update the mailing list in MAINTAINERS
Peter Zijlstra (3):
x86/alternatives: Introduce int3_emulate_jcc() x86/alternatives: Teach text_poke_bp() to patch Jcc.d32 instructions x86/static_call: Add support for Jcc tail-calls
Shyam Sundar S K (1):
platform/x86/amd/pmf: Add depends on CONFIG_POWER_SUPPLY
Greg Kroah-Hartman
maintainerMAINTAINERS +1 -1
@@ -3515,7 +3515,7 @@ F: drivers/net/ieee802154/atusb.h AUDIT SUBSYSTEM M: Paul Moore <[email protected]> M: Eric Paris <[email protected]> -L: [email protected] (moderated for non-subscribers) +L: [email protected] S: Supported W: https://github.com/linux-audit T: git git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 2 -SUBLEVEL = 0 +SUBLEVEL = 1 EXTRAVERSION = NAME = Hurr durr I'ma ninja sloth
arch/x86/include/asm/text-patching.h +31 -0
@@ -184,6 +184,37 @@ void int3_emulate_ret(struct pt_regs *regs)unsigned long ip =int3_emulate_pop (regs);int3_emulate_jmp (regs, ip); } + +static __always_inline +void int3_emulate_jcc(struct pt_regs *regs, u8 cc, unsigned long ip, unsigned long disp) +{ +static const unsigned long jcc_mask[6 ] = { + [0 ] =X86_EFLAGS_OF , + [1 ] =X86_EFLAGS_CF , + [2 ] =X86_EFLAGS_ZF , + [3 ] =X86_EFLAGS_CF |X86_EFLAGS_ZF , + [4 ] =X86_EFLAGS_SF , + [5 ] =X86_EFLAGS_PF , + }; + +bool invert = cc &1 ; +bool match; + +if (cc <0xc ) { + match = regs->flags & jcc_mask[cc >>1 ]; + }else { + match = ((regs->flags &X86_EFLAGS_SF ) >>X86_EFLAGS_SF_BIT ) ^ + ((regs->flags &X86_EFLAGS_OF ) >>X86_EFLAGS_OF_BIT ); +if (cc >=0xe ) + match = match || (regs->flags &X86_EFLAGS_ZF ); + } + +if ((match && !invert) || (!match && invert)) + ip += disp; + +int3_emulate_jmp (regs, ip); +} +#endif /* !CONFIG_UML_X86 */ #endif /* _ASM_X86_TEXT_PATCHING_H */
arch/x86/kernel/alternative.c +47 -15
139 lines not on this page · raw message
arch/x86/kernel/kprobes/core.c +8 -30
@@ -464,50 +464,26 @@ static void kprobe_emulate_call(struct kprobe *p, struct pt_regs *regs) }NOKPROBE_SYMBOL (kprobe_emulate_call); -static nokprobe_inline -void __kprobe_emulate_jmp(struct kprobe *p, struct pt_regs *regs, bool cond) +static void kprobe_emulate_jmp (struct kprobe *p,struct pt_regs *regs) {unsigned long ip = regs->ip -INT3_INSN_SIZE + p->ainsn.size; -if (cond) - ip += p->ainsn.rel32; + ip += p->ainsn.rel32;int3_emulate_jmp (regs, ip); } - -static void kprobe_emulate_jmp (struct kprobe *p,struct pt_regs *regs) -{ -__kprobe_emulate_jmp (p, regs, true); -}NOKPROBE_SYMBOL (kprobe_emulate_jmp); -static const unsigned long jcc_mask[6 ] = { - [0 ] =X86_EFLAGS_OF , - [1 ] =X86_EFLAGS_CF , - [2 ] =X86_EFLAGS_ZF , - [3 ] =X86_EFLAGS_CF |X86_EFLAGS_ZF , - [4 ] =X86_EFLAGS_SF , - [5 ] =X86_EFLAGS_PF , -}; -static void kprobe_emulate_jcc (struct kprobe *p,struct pt_regs *regs) { -bool invert = p->ainsn.jcc.type &1 ; -bool match; +unsigned long ip = regs->ip -INT3_INSN_SIZE + p->ainsn.size; -if (p->ainsn.jcc.type <0xc ) { - match = regs->flags & jcc_mask[p->ainsn.jcc.type >>1 ]; - }else { - match = ((regs->flags &X86_EFLAGS_SF ) >>X86_EFLAGS_SF_BIT ) ^ - ((regs->flags &X86_EFLAGS_OF ) >>X86_EFLAGS_OF_BIT ); -if (p->ainsn.jcc.type >=0xe ) - match = match || (regs->flags &X86_EFLAGS_ZF ); - } -__kprobe_emulate_jmp (p, regs, (match && !invert) || (!match && invert)); +int3_emulate_jcc (regs, p->ainsn.jcc.type, ip, p->ainsn.rel32); }NOKPROBE_SYMBOL (kprobe_emulate_jcc);static void kprobe_emulate_loop (struct kprobe *p,struct pt_regs *regs) { +unsigned long ip = regs->ip -INT3_INSN_SIZE + p->ainsn.size;bool match;if (p->ainsn.loop.type !=3 ) {/* LOOP* */
@@ -535,7 +511,9 @@ static void kprobe_emulate_loop(struct kprobe *p, struct pt_regs *regs)else if (p->ainsn.loop.type ==1 )/* LOOPE */ match = match && (regs->flags &X86_EFLAGS_ZF ); -__kprobe_emulate_jmp (p, regs, match); +if (match) + ip += p->ainsn.rel32; +int3_emulate_jmp (regs, ip); }NOKPROBE_SYMBOL (kprobe_emulate_loop);
arch/x86/kernel/static_call.c +47 -3
87 lines not on this page · raw message
drivers/hid/hid-mcp2221.c +3 -0
@@ -922,6 +922,9 @@ static void mcp2221_hid_unregister(void *ptr)/* This is needed to be sure hid_hw_stop() isn't called twice by the subsystem */ static void mcp2221_remove (struct hid_device *hdev) { +struct mcp2221 *mcp =hid_get_drvdata (hdev); + +cancel_delayed_work_sync (&mcp->init_work); }#if IS_REACHABLE (CONFIG_IIO )
drivers/net/wireless/marvell/mwifiex/sdio.c +1 -0
@@ -480,6 +480,7 @@ static struct memory_type_mapping mem_type_mapping_tbl[] = { };static const struct of_device_id mwifiex_sdio_of_match_table[] = { + { .compatible ="marvell,sd8787" }, { .compatible ="marvell,sd8897" }, { .compatible ="marvell,sd8997" }, { }
drivers/platform/x86/amd/pmf/Kconfig +1 -0
@@ -6,6 +6,7 @@ config AMD_PMF tristate "AMD Platform Management Framework" depends on ACPI && PCI + depends on POWER_SUPPLY select ACPI_PLATFORM_PROFILE help This driver provides support for the AMD Platform Management Framework.
drivers/platform/x86/nvidia-wmi-ec-backlight.c +5 -1
@@ -12,6 +12,10 @@#include <linux/wmi.h> #include <acpi/video.h> +static bool force; +module_param (force, bool,0444 ); +MODULE_PARM_DESC (force,"Force loading (disable acpi_backlight=xxx checks" ); +/** * wmi_brightness_notify() - helper function for calling WMI-wrapped ACPI method * @w: Pointer to the struct wmi_device identified by %WMI_BRIGHTNESS_GUID
@@ -91,7 +95,7 @@ static int nvidia_wmi_ec_backlight_probe(struct wmi_device *wdev, const void *ctint ret;/* drivers/acpi/video_detect.c also checks that SOURCE == EC */ -if (acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec) +if (!force &&acpi_video_get_backlight_type () != acpi_backlight_nvidia_wmi_ec)return -ENODEV ;/*
fs/ext4/sysfs.c +6 -1
@@ -491,6 +491,11 @@ static void ext4_sb_release(struct kobject *kobj)complete (&sbi->s_kobj_unregister); } +static void ext4_feat_release (struct kobject *kobj) +{ +kfree (kobj); +} +static const struct sysfs_ops ext4_attr_ops = { .show = ext4_attr_show, .store = ext4_attr_store,
@@ -505,7 +510,7 @@ static struct kobj_type ext4_sb_ktype = {static struct kobj_type ext4_feat_ktype = { .default_groups = ext4_feat_groups, .sysfs_ops = &ext4_attr_ops, - .release = (void (*)(struct kobject *))kfree, + .release = ext4_feat_release, };void ext4_notify_error_sysfs (struct ext4_sb_info *sbi)
include/linux/nospec.h +4 -0
@@ -11,6 +11,10 @@struct task_struct ; +#ifndef barrier_nospec +# define barrier_nospec () do { } while (0) +#endif +/** * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise * @index: array element index
kernel/bpf/core.c +1 -2
@@ -34,6 +34,7 @@#include <linux/log2.h> #include <linux/bpf_verifier.h> #include <linux/nodemask.h> +#include <linux/nospec.h> #include <linux/bpf_mem_alloc.h> #include <asm/barrier.h>
@@ -1910,9 +1911,7 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn)* reuse preexisting logic from Spectre v1 mitigation that * happens to produce the required code on x86 for v4 as well. */ -#ifdef CONFIG_X86 barrier_nospec (); -#endif CONT ;#define LDST (SIZEOP ,SIZE ) \ STX_MEM_##SIZEOP: \
lib/usercopy.c +7 -0
@@ -3,6 +3,7 @@#include <linux/fault-inject-usercopy.h> #include <linux/instrumented.h> #include <linux/uaccess.h> +#include <linux/nospec.h> /* out-of-line parts */
@@ -12,6 +13,12 @@ unsigned long _copy_from_user(void *to, const void __user *from, unsigned long nunsigned long res = n;might_fault ();if (!should_fail_usercopy () &&likely (access_ok (from, n))) { +/* +* Ensure that bad access_ok() speculation will not +* lead to nasty side effects *after* the copy is +* finished: +*/ +barrier_nospec ();instrument_copy_from_user_before (to, from, n); res =raw_copy_from_user (to, from, n);instrument_copy_from_user_after (to, from, n, res);
security/Kconfig.hardening +3 -0
@@ -281,6 +281,9 @@ endmenu config CC_HAS_RANDSTRUCT def_bool $(cc-option,-frandomize-layout-seed-file=/dev/null) + # Randstruct was first added in Clang 15, but it isn't safe to use until + # Clang 16 due to https://github.com/llvm/llvm-project/issues/60349 + depends on !CC_IS_CLANG || CLANG_VERSION >= 160000 choice prompt "Randomize layout of sensitive kernel structures"