Linux 6.0.1
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.0.1 kernel.
All users of the 6.0 kernel series must upgrade.
The updated 6.0.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.0.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
------------
Documentation/process/code-of-conduct-interpretation.rst | 2 Makefile | 6 +- arch/riscv/kernel/cpu.c | 2 arch/sparc/include/asm/smp_32.h | 15 ++--- arch/sparc/kernel/leon_smp.c | 12 ++-- arch/sparc/kernel/sun4d_smp.c | 12 ++-- arch/sparc/kernel/sun4m_smp.c | 10 ++- arch/sparc/mm/srmmu.c | 29 +++++------ drivers/gpio/gpiolib-acpi.c | 38 +++++++++++++-- drivers/hwmon/aquacomputer_d5next.c | 2 drivers/net/ethernet/mediatek/mtk_ppe.c | 2 drivers/usb/mon/mon_bin.c | 5 + drivers/usb/serial/ftdi_sio.c | 3 - fs/coredump.c | 3 - fs/inode.c | 7 +- include/net/xsk_buff_pool.h | 2 kernel/bpf/helpers.c | 28 +++++------ kernel/bpf/syscall.c | 2 net/bluetooth/hci_core.c | 15 +++++ net/bluetooth/hci_event.c | 6 +- net/xdp/xsk.c | 4 - net/xdp/xsk_buff_pool.c | 5 + scripts/Makefile.extrawarn | 1 security/Kconfig.hardening | 14 +++-- 24 files changed, 140 insertions(+), 85 deletions(-)
Al Viro (1):
fix coredump breakage
Aleksa Savic (1):
hwmon: (aquacomputer_d5next) Fix Quadro fan speed offsets
Bart Van Assche (1):
sparc: Unbreak the build
Daniel Golle (1):
net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear
Dongliang Mu (1):
fs: fix UAF/GPF bug in nilfs_mdt_destroy
Greg Kroah-Hartman (1):
Linux 6.0.1
Jalal Mostafa (1):
xsk: Inherit need_wakeup flag for shared sockets
Johan Hovold (1):
USB: serial: ftdi_sio: fix 300 bps rate for SIO
Jules Irenge (1):
bpf: Fix resetting logic for unreferenced kptrs
Kees Cook (1):
hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero
Kumar Kartikeya Dwivedi (1):
bpf: Gate dynptr API behind CAP_BPF
Mario Limonciello (2):
gpiolib: acpi: Add support to ignore programming an interrupt
gpiolib: acpi: Add a quirk for Asus UM325UAZ
Palmer Dabbelt (1):
RISC-V: Print SSTC in canonical order
Sami Tolvanen (1):
Makefile.extrawarn: Move -Wcast-function-type-strict to W=1
Shuah Khan (1):
docs: update mediator information in CoC docs
Tadeusz Struk (1):
usb: mon: make mmapped memory read only
Tetsuo Handa (1):
Bluetooth: use hdev->workqueue when queuing hdev->{cmd,ncmd}_timer worksGreg Kroah-Hartman
maintainerDocumentation/process/code-of-conduct-interpretation.rst +1 -1
@@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or other maintainers if you're uncertain how to handle situations that come up. It will not be considered a violation report unless you want it to be. If you are uncertain about approaching the TAB or any other maintainers, please -reach out to our conflict mediator, Mishi Choudhary <[email protected]>. +reach out to our conflict mediator, Joanna Lee <[email protected]>. In the end, "be kind to each other" is really what the end goal is for everybody. We know everyone is human and we all fail at times, but the
Makefile +3 -3
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 0 -SUBLEVEL = 0 +SUBLEVEL = 1 EXTRAVERSION = NAME = Hurr durr I'ma ninja sloth
@@ -831,8 +831,8 @@ endif # Initialize all stack variables with a zero value. ifdef CONFIG_INIT_STACK_ALL_ZERO KBUILD_CFLAGS += -ftrivial-auto-var-init=zero -ifdef CONFIG_CC_IS_CLANG -# https://bugs.llvm.org/show_bug.cgi?id=45497 +ifdef CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER +# https://github.com/llvm/llvm-project/issues/44842 KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang endif endif
arch/riscv/kernel/cpu.c +1 -1
@@ -92,10 +92,10 @@ int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid)*/ static struct riscv_isa_ext_data isa_ext_arr[] = {__RISCV_ISA_EXT_DATA (sscofpmf,RISCV_ISA_EXT_SSCOFPMF ), +__RISCV_ISA_EXT_DATA (sstc,RISCV_ISA_EXT_SSTC ),__RISCV_ISA_EXT_DATA (svpbmt,RISCV_ISA_EXT_SVPBMT ),__RISCV_ISA_EXT_DATA (zicbom,RISCV_ISA_EXT_ZICBOM ),__RISCV_ISA_EXT_DATA (zihintpause,RISCV_ISA_EXT_ZIHINTPAUSE ), -__RISCV_ISA_EXT_DATA (sstc,RISCV_ISA_EXT_SSTC ),__RISCV_ISA_EXT_DATA ("" ,RISCV_ISA_EXT_MAX ), };
arch/sparc/include/asm/smp_32.h +6 -9
@@ -33,9 +33,6 @@ extern volatile unsigned long cpu_callin_map[NR_CPUS];extern cpumask_t smp_commenced_mask;extern struct linux_prom_registers smp_penguin_ctable; -typedef void (*smpfunc_t )(unsigned long ,unsigned long ,unsigned long , -unsigned long ,unsigned long ); -void cpu_panic (void );/*
@@ -57,7 +54,7 @@ void smp_bogo(struct seq_file *);void smp_info (struct seq_file *);struct sparc32_ipi_ops { -void (*cross_call)(smpfunc_t func,cpumask_t mask,unsigned long arg1, +void (*cross_call)(void *func,cpumask_t mask,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4);void (*resched)(int cpu);
@@ -66,28 +63,28 @@ struct sparc32_ipi_ops { };extern const struct sparc32_ipi_ops *sparc32_ipi_ops; -static inline void xc0 (smpfunc_t func) +static inline void xc0 (void *func) { sparc32_ipi_ops->cross_call (func, *cpu_online_mask,0 ,0 ,0 ,0 ); } -static inline void xc1 (smpfunc_t func,unsigned long arg1) +static inline void xc1 (void *func,unsigned long arg1) { sparc32_ipi_ops->cross_call (func, *cpu_online_mask, arg1,0 ,0 ,0 ); } -static inline void xc2 (smpfunc_t func,unsigned long arg1,unsigned long arg2) +static inline void xc2 (void *func,unsigned long arg1,unsigned long arg2) { sparc32_ipi_ops->cross_call (func, *cpu_online_mask, arg1, arg2,0 ,0 ); } -static inline void xc3 (smpfunc_t func,unsigned long arg1,unsigned long arg2, +static inline void xc3 (void *func,unsigned long arg1,unsigned long arg2,unsigned long arg3) { sparc32_ipi_ops->cross_call (func, *cpu_online_mask, arg1, arg2, arg3,0 ); } -static inline void xc4 (smpfunc_t func,unsigned long arg1,unsigned long arg2, +static inline void xc4 (void *func,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4) { sparc32_ipi_ops->cross_call(func, *cpu_online_mask,
arch/sparc/kernel/leon_smp.c +7 -5
@@ -359,7 +359,7 @@ void leonsmp_ipi_interrupt(void) } static struct smp_funcall { - smpfunc_t func; + void *func; unsigned long arg1; unsigned long arg2; unsigned long arg3;
@@ -372,7 +372,7 @@ static struct smp_funcall {static DEFINE_SPINLOCK (cross_call_lock);/* Cross calls must be serialized, at least currently. */ -static void leon_cross_call (smpfunc_t func,cpumask_t mask,unsigned long arg1, +static void leon_cross_call (void *func,cpumask_t mask,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4) {
@@ -384,7 +384,7 @@ static void leon_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, {/* If you make changes here, make sure gcc generates proper code... */ - register smpfunc_t f asm("i0") = func; + register void *f asm("i0") = func; register unsigned long a1 asm("i1") = arg1; register unsigned long a2 asm("i2") = arg2; register unsigned long a3 asm("i3") = arg3;
@@ -444,11 +444,13 @@ static void leon_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,/* Running cross calls. */ void leon_cross_call_irq (void ) { +void (*func)(unsigned long ,unsigned long ,unsigned long ,unsigned long , +unsigned long ) = ccall_info.func;int i =smp_processor_id (); ccall_info.processors_in[i] =1 ; - ccall_info.func (ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, - ccall_info.arg4, ccall_info.arg5); +func (ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, ccall_info.arg4, + ccall_info.arg5); ccall_info.processors_out[i] =1 ; }
arch/sparc/kernel/sun4d_smp.c +7 -5
@@ -268,7 +268,7 @@ static void sun4d_ipi_resched(int cpu) } static struct smp_funcall { - smpfunc_t func; + void *func; unsigned long arg1; unsigned long arg2; unsigned long arg3;
@@ -281,7 +281,7 @@ static struct smp_funcall {static DEFINE_SPINLOCK (cross_call_lock);/* Cross calls must be serialized, at least currently. */ -static void sun4d_cross_call (smpfunc_t func,cpumask_t mask,unsigned long arg1, +static void sun4d_cross_call (void *func,cpumask_t mask,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4) {
@@ -296,7 +296,7 @@ static void sun4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,* If you make changes here, make sure * gcc generates proper code... */ - register smpfunc_t f asm("i0") = func; + register void *f asm("i0") = func; register unsigned long a1 asm("i1") = arg1; register unsigned long a2 asm("i2") = arg2; register unsigned long a3 asm("i3") = arg3;
@@ -353,11 +353,13 @@ static void sun4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,/* Running cross calls. */ void smp4d_cross_call_irq (void ) { +void (*func)(unsigned long ,unsigned long ,unsigned long ,unsigned long , +unsigned long ) = ccall_info.func;int i =hard_smp_processor_id (); ccall_info.processors_in[i] =1 ; - ccall_info.func (ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, - ccall_info.arg4, ccall_info.arg5); +func (ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, ccall_info.arg4, + ccall_info.arg5); ccall_info.processors_out[i] =1 ; }
arch/sparc/kernel/sun4m_smp.c +6 -4
@@ -157,7 +157,7 @@ static void sun4m_ipi_mask_one(int cpu) } static struct smp_funcall { - smpfunc_t func; + void *func; unsigned long arg1; unsigned long arg2; unsigned long arg3;
@@ -170,7 +170,7 @@ static struct smp_funcall {static DEFINE_SPINLOCK (cross_call_lock);/* Cross calls must be serialized, at least currently. */ -static void sun4m_cross_call (smpfunc_t func,cpumask_t mask,unsigned long arg1, +static void sun4m_cross_call (void *func,cpumask_t mask,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4) {
@@ -230,11 +230,13 @@ static void sun4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,/* Running cross calls. */ void smp4m_cross_call_irq (void ) { +void (*func)(unsigned long ,unsigned long ,unsigned long ,unsigned long , +unsigned long ) = ccall_info.func;int i =smp_processor_id (); ccall_info.processors_in[i] =1 ; - ccall_info.func (ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, - ccall_info.arg4, ccall_info.arg5); +func (ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, ccall_info.arg4, + ccall_info.arg5); ccall_info.processors_out[i] =1 ; }
arch/sparc/mm/srmmu.c +13 -16
@@ -1636,19 +1636,19 @@ static void __init get_srmmu_type(void)/* Local cross-calls. */ static void smp_flush_page_for_dma (unsigned long page) { -xc1 ((smpfunc_t ) local_ops->page_for_dma, page); +xc1 (local_ops->page_for_dma, page); local_ops->page_for_dma (page); }static void smp_flush_cache_all (void ) { -xc0 ((smpfunc_t ) local_ops->cache_all); +xc0 (local_ops->cache_all); local_ops->cache_all (); }static void smp_flush_tlb_all (void ) { -xc0 ((smpfunc_t ) local_ops->tlb_all); +xc0 (local_ops->tlb_all); local_ops->tlb_all (); }
@@ -1659,7 +1659,7 @@ static void smp_flush_cache_mm(struct mm_struct *mm)cpumask_copy (&cpu_mask,mm_cpumask (mm));cpumask_clear_cpu (smp_processor_id (), &cpu_mask);if (!cpumask_empty (&cpu_mask)) -xc1 ((smpfunc_t ) local_ops->cache_mm, (unsigned long ) mm); +xc1 (local_ops->cache_mm, (unsigned long )mm); local_ops->cache_mm (mm); } }
@@ -1671,7 +1671,7 @@ static void smp_flush_tlb_mm(struct mm_struct *mm)cpumask_copy (&cpu_mask,mm_cpumask (mm));cpumask_clear_cpu (smp_processor_id (), &cpu_mask);if (!cpumask_empty (&cpu_mask)) { -xc1 ((smpfunc_t ) local_ops->tlb_mm, (unsigned long ) mm); +xc1 (local_ops->tlb_mm, (unsigned long )mm);if (atomic_read (&mm->mm_users) ==1 && current->active_mm == mm)cpumask_copy (mm_cpumask (mm),cpumask_of (smp_processor_id ()));
@@ -1691,8 +1691,8 @@ static void smp_flush_cache_range(struct vm_area_struct *vma,cpumask_copy (&cpu_mask,mm_cpumask (mm));cpumask_clear_cpu (smp_processor_id (), &cpu_mask);if (!cpumask_empty (&cpu_mask)) -xc3 ((smpfunc_t ) local_ops->cache_range, - (unsigned long ) vma, start, end); +xc3 (local_ops->cache_range, (unsigned long )vma, start, + end); local_ops->cache_range (vma, start, end); } }
@@ -1708,8 +1708,8 @@ static void smp_flush_tlb_range(struct vm_area_struct *vma,cpumask_copy (&cpu_mask,mm_cpumask (mm));cpumask_clear_cpu (smp_processor_id (), &cpu_mask);if (!cpumask_empty (&cpu_mask)) -xc3 ((smpfunc_t ) local_ops->tlb_range, - (unsigned long ) vma, start, end); +xc3 (local_ops->tlb_range, (unsigned long )vma, start, + end); local_ops->tlb_range (vma, start, end); } }
@@ -1723,8 +1723,7 @@ static void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page)cpumask_copy (&cpu_mask,mm_cpumask (mm));cpumask_clear_cpu (smp_processor_id (), &cpu_mask);if (!cpumask_empty (&cpu_mask)) -xc2 ((smpfunc_t ) local_ops->cache_page, - (unsigned long ) vma, page); +xc2 (local_ops->cache_page, (unsigned long )vma, page); local_ops->cache_page (vma, page); } }
@@ -1738,8 +1737,7 @@ static void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)cpumask_copy (&cpu_mask,mm_cpumask (mm));cpumask_clear_cpu (smp_processor_id (), &cpu_mask);if (!cpumask_empty (&cpu_mask)) -xc2 ((smpfunc_t ) local_ops->tlb_page, - (unsigned long ) vma, page); +xc2 (local_ops->tlb_page, (unsigned long )vma, page); local_ops->tlb_page (vma, page); } }
@@ -1753,7 +1751,7 @@ static void smp_flush_page_to_ram(unsigned long page)* XXX This experiment failed, research further... -DaveM */ #if 1 -xc1 ((smpfunc_t ) local_ops->page_to_ram, page); +xc1 (local_ops->page_to_ram, page);#endif local_ops->page_to_ram (page); }
@@ -1764,8 +1762,7 @@ static void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr)cpumask_copy (&cpu_mask,mm_cpumask (mm));cpumask_clear_cpu (smp_processor_id (), &cpu_mask);if (!cpumask_empty (&cpu_mask)) -xc2 ((smpfunc_t ) local_ops->sig_insns, - (unsigned long ) mm, insn_addr); +xc2 (local_ops->sig_insns, (unsigned long )mm, insn_addr); local_ops->sig_insns (mm, insn_addr); }
drivers/gpio/gpiolib-acpi.c +34 -4
@@ -32,9 +32,16 @@ MODULE_PARM_DESC(ignore_wake,"controller@pin combos on which to ignore the ACPI wake flag " "ignore_wake=controller@pin[,controller@pin[,...]]"); +static char *ignore_interrupt; +module_param (ignore_interrupt, charp,0444 ); +MODULE_PARM_DESC (ignore_interrupt, +"controller@pin combos on which to ignore interrupt " +"ignore_interrupt=controller@pin[,controller@pin[,...]]" ); +struct acpi_gpiolib_dmi_quirk {bool no_edge_events_on_boot;char *ignore_wake; +char *ignore_interrupt; };/**
@@ -317,14 +324,15 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,return desc; } -static bool acpi_gpio_in_ignore_list (const char *controller_in,unsigned int pin_in) +static bool acpi_gpio_in_ignore_list (const char *ignore_list,const char *controller_in, +unsigned int pin_in) {const char *controller, *pin_str;unsigned int pin;char *endp;int len; - controller = ignore_wake; + controller = ignore_list;while (controller) { pin_str =strchr (controller,'@' );if (!pin_str)
@@ -348,7 +356,7 @@ static bool acpi_gpio_in_ignore_list(const char *controller_in, unsigned int pinreturn false; err: -pr_err_once ("Error: Invalid value for gpiolib_acpi.ignore_wake: %s\n" , ignore_wake); +pr_err_once ("Error: Invalid value for gpiolib_acpi.ignore_...: %s\n" , ignore_list);return false; }
@@ -360,7 +368,7 @@ static bool acpi_gpio_irq_is_wake(struct device *parent,if (agpio->wake_capable !=ACPI_WAKE_CAPABLE )return false; -if (acpi_gpio_in_ignore_list (dev_name (parent), pin)) { +if (acpi_gpio_in_ignore_list (ignore_wake,dev_name (parent), pin)) {dev_info (parent,"Ignoring wakeup on pin %u\n" , pin);return false; }
@@ -427,6 +435,11 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares, goto fail_unlock_irq; } +if (acpi_gpio_in_ignore_list (ignore_interrupt,dev_name (chip->parent), pin)) { +dev_info (chip->parent,"Ignoring interrupt on pin %u\n" , pin); +return AE_OK ; + } + event =kzalloc (sizeof (*event),GFP_KERNEL );if (!event) goto fail_unlock_irq;
@@ -1563,6 +1576,20 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] __initconst = { .ignore_wake = "INT33FF:01@0", }, }, + { + /* + * Interrupt storm caused from edge triggered floating pin + * Found in BIOS UX325UAZ.300 + * https://bugzilla.kernel.org/show_bug.cgi?id=216208 + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UAZ_UM325UAZ"), + }, + .driver_data = &(struct acpi_gpiolib_dmi_quirk) { + .ignore_interrupt = "AMDI0030:00@18", + }, + }, {} /* Terminating entry */ };
@@ -1585,6 +1612,9 @@ static int __init acpi_gpio_setup_params(void)if (ignore_wake ==NULL && quirk && quirk->ignore_wake) ignore_wake = quirk->ignore_wake; +if (ignore_interrupt ==NULL && quirk && quirk->ignore_interrupt) + ignore_interrupt = quirk->ignore_interrupt; +return 0 ; }
drivers/hwmon/aquacomputer_d5next.c +1 -1
@@ -110,7 +110,7 @@ static u16 octo_ctrl_fan_offsets[] = { 0x5B, 0xB0, 0x105, 0x15A, 0x1AF, 0x204, 0static u8 quadro_sensor_fan_offsets[] = {0x70 ,0x7D ,0x8A ,0x97 };/* Fan speed registers in Quadro control report (from 0-100%) */ -static u16 quadro_ctrl_fan_offsets[] = {0x36 ,0x8b ,0xe0 ,0x135 }; +static u16 quadro_ctrl_fan_offsets[] = {0x37 ,0x8c ,0xe1 ,0x136 };/* Labels for D5 Next */ static const char *const label_d5next_temp[] = {
drivers/net/ethernet/mediatek/mtk_ppe.c +1 -1
@@ -412,7 +412,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)if (entry->hash !=0xffff ) { ppe->foe_table[entry->hash].ib1 &= ~MTK_FOE_IB1_STATE ; ppe->foe_table[entry->hash].ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE , -MTK_FOE_STATE_UNBIND ); +MTK_FOE_STATE_INVALID );dma_wmb (); } entry->hash =0xffff ;
drivers/usb/mon/mon_bin.c +5 -0
@@ -1268,6 +1268,11 @@ static int mon_bin_mmap(struct file *filp, struct vm_area_struct *vma) {/* don't do anything here: "fault" will set up page table entries */ vma->vm_ops = &mon_bin_vm_ops; + +if (vma->vm_flags &VM_WRITE ) +return -EPERM ; + + vma->vm_flags &= ~VM_MAYWRITE ; vma->vm_flags |=VM_DONTEXPAND |VM_DONTDUMP ; vma->vm_private_data = filp->private_data;mon_bin_vma_open (vma);
drivers/usb/serial/ftdi_sio.c +1 -2
@@ -1319,8 +1319,7 @@ static u32 get_ftdi_divisor(struct tty_struct *tty,case 38400 : div_value = ftdi_sio_b38400;break ;case 57600 : div_value = ftdi_sio_b57600;break ;case 115200 : div_value = ftdi_sio_b115200;break ; - }/* baud */ -if (div_value ==0 ) { +default :dev_dbg (dev,"%s - Baudrate (%d) requested is not supported\n" , __func__, baud); div_value = ftdi_sio_b9600;
fs/coredump.c +2 -1
@@ -841,7 +841,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page) };struct iov_iter iter;struct file *file = cprm->file; -loff_t pos = file->f_pos; +loff_t pos;ssize_t n;if (cprm->to_skip) {
@@ -853,6 +853,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page)return 0 ;if (dump_interrupted ())return 0 ; + pos = file->f_pos;iov_iter_bvec (&iter,WRITE , &bvec,1 ,PAGE_SIZE ); n =__kernel_write_iter (cprm->file, &iter, &pos);if (n !=PAGE_SIZE )
fs/inode.c +3 -4
@@ -192,8 +192,6 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_wb_frn_history =0 ;#endif -if (security_inode_alloc (inode)) - goto out;spin_lock_init (&inode->i_lock);lockdep_set_class (&inode->i_lock, &sb->s_type->i_lock_key);
@@ -228,11 +226,12 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_fsnotify_mask =0 ;#endif inode->i_flctx =NULL ; + +if (unlikely (security_inode_alloc (inode))) +return -ENOMEM ;this_cpu_inc (nr_inodes);return 0 ; -out: -return -ENOMEM ; }EXPORT_SYMBOL (inode_init_always);
include/net/xsk_buff_pool.h +1 -1
@@ -95,7 +95,7 @@ struct xsk_buff_pool *xp_create_and_assign_umem(struct xdp_sock *xs, struct xdp_umem *umem);int xp_assign_dev (struct xsk_buff_pool *pool,struct net_device *dev,u16 queue_id,u16 flags); -int xp_assign_dev_shared (struct xsk_buff_pool *pool,struct xdp_umem *umem, +int xp_assign_dev_shared (struct xsk_buff_pool *pool,struct xdp_sock *umem_xs,struct net_device *dev,u16 queue_id);int xp_alloc_tx_descs (struct xsk_buff_pool *pool,struct xdp_sock *xs);void xp_destroy (struct xsk_buff_pool *pool);
kernel/bpf/helpers.c +14 -14
@@ -1627,26 +1627,12 @@ bpf_base_func_proto(enum bpf_func_id func_id)return &bpf_ringbuf_discard_proto;case BPF_FUNC_ringbuf_query:return &bpf_ringbuf_query_proto; -case BPF_FUNC_ringbuf_reserve_dynptr: -return &bpf_ringbuf_reserve_dynptr_proto; -case BPF_FUNC_ringbuf_submit_dynptr: -return &bpf_ringbuf_submit_dynptr_proto; -case BPF_FUNC_ringbuf_discard_dynptr: -return &bpf_ringbuf_discard_dynptr_proto;case BPF_FUNC_for_each_map_elem:return &bpf_for_each_map_elem_proto;case BPF_FUNC_loop:return &bpf_loop_proto;case BPF_FUNC_strncmp:return &bpf_strncmp_proto; -case BPF_FUNC_dynptr_from_mem: -return &bpf_dynptr_from_mem_proto; -case BPF_FUNC_dynptr_read: -return &bpf_dynptr_read_proto; -case BPF_FUNC_dynptr_write: -return &bpf_dynptr_write_proto; -case BPF_FUNC_dynptr_data: -return &bpf_dynptr_data_proto;default :break ; }
@@ -1675,6 +1661,20 @@ bpf_base_func_proto(enum bpf_func_id func_id)return &bpf_timer_cancel_proto;case BPF_FUNC_kptr_xchg:return &bpf_kptr_xchg_proto; +case BPF_FUNC_ringbuf_reserve_dynptr: +return &bpf_ringbuf_reserve_dynptr_proto; +case BPF_FUNC_ringbuf_submit_dynptr: +return &bpf_ringbuf_submit_dynptr_proto; +case BPF_FUNC_ringbuf_discard_dynptr: +return &bpf_ringbuf_discard_dynptr_proto; +case BPF_FUNC_dynptr_from_mem: +return &bpf_dynptr_from_mem_proto; +case BPF_FUNC_dynptr_read: +return &bpf_dynptr_read_proto; +case BPF_FUNC_dynptr_write: +return &bpf_dynptr_write_proto; +case BPF_FUNC_dynptr_data: +return &bpf_dynptr_data_proto;default :break ; }
kernel/bpf/syscall.c +1 -1
@@ -598,7 +598,7 @@ void bpf_map_free_kptrs(struct bpf_map *map, void *map_value)if (off_desc->type ==BPF_KPTR_UNREF ) {u64 *p = (u64 *)btf_id_ptr; -WRITE_ONCE (p,0 ); +WRITE_ONCE (*p,0 );continue ; } old_ptr =xchg (btf_id_ptr,0 );
net/bluetooth/hci_core.c +13 -2
@@ -597,6 +597,15 @@ static int hci_dev_do_reset(struct hci_dev *hdev)/* Cancel these to avoid queueing non-chained pending work */ hci_dev_set_flag (hdev,HCI_CMD_DRAIN_WORKQUEUE ); +/* Wait for +* +* if (!hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE)) +* queue_delayed_work(&hdev->{cmd,ncmd}_timer) +* +* inside RCU section to see the flag or complete scheduling. +*/ +synchronize_rcu (); +/* Explicitly cancel works in case scheduled after setting the flag. */ cancel_delayed_work (&hdev->cmd_timer);cancel_delayed_work (&hdev->ncmd_timer);
@@ -4056,12 +4065,14 @@ static void hci_cmd_work(struct work_struct *work)if (res <0 )__hci_cmd_sync_cancel (hdev, -res); +rcu_read_lock ();if (test_bit (HCI_RESET , &hdev->flags) ||hci_dev_test_flag (hdev,HCI_CMD_DRAIN_WORKQUEUE ))cancel_delayed_work (&hdev->cmd_timer);else -schedule_delayed_work (&hdev->cmd_timer, -HCI_CMD_TIMEOUT ); +queue_delayed_work (hdev->workqueue, &hdev->cmd_timer, +HCI_CMD_TIMEOUT ); +rcu_read_unlock (); }else {skb_queue_head (&hdev->cmd_q, skb);queue_work (hdev->workqueue, &hdev->cmd_work);
net/bluetooth/hci_event.c +4 -2
@@ -3766,16 +3766,18 @@ static inline void handle_cmd_cnt_and_timer(struct hci_dev *hdev, u8 ncmd) {cancel_delayed_work (&hdev->cmd_timer); +rcu_read_lock ();if (!test_bit (HCI_RESET , &hdev->flags)) {if (ncmd) {cancel_delayed_work (&hdev->ncmd_timer);atomic_set (&hdev->cmd_cnt,1 ); }else {if (!hci_dev_test_flag (hdev,HCI_CMD_DRAIN_WORKQUEUE )) -schedule_delayed_work (&hdev->ncmd_timer, -HCI_NCMD_TIMEOUT ); +queue_delayed_work (hdev->workqueue, &hdev->ncmd_timer, +HCI_NCMD_TIMEOUT ); } } +rcu_read_unlock (); } static u8 hci_cc_le_read_buffer_size_v2(struct hci_dev *hdev, void *data,
net/xdp/xsk.c +2 -2
@@ -954,8 +954,8 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len) goto out_unlock; } - err =xp_assign_dev_shared (xs->pool, umem_xs->umem, - dev, qid); + err =xp_assign_dev_shared (xs->pool, umem_xs, dev, + qid);if (err) {xp_destroy (xs->pool); xs->pool =NULL ;
net/xdp/xsk_buff_pool.c +3 -2
@@ -212,17 +212,18 @@ int xp_assign_dev(struct xsk_buff_pool *pool,return err; } -int xp_assign_dev_shared (struct xsk_buff_pool *pool,struct xdp_umem *umem, +int xp_assign_dev_shared (struct xsk_buff_pool *pool,struct xdp_sock *umem_xs,struct net_device *dev,u16 queue_id) {u16 flags; +struct xdp_umem *umem = umem_xs->umem;/* One fill and completion ring required for each queue id. */ if (!pool->fq || !pool->cq)return -EINVAL ; flags = umem->zc ?XDP_ZEROCOPY :XDP_COPY ; -if (pool->uses_need_wakeup) +if (umem_xs->pool->uses_need_wakeup) flags |=XDP_USE_NEED_WAKEUP ;return xp_assign_dev (pool, dev, queue_id, flags);
scripts/Makefile.extrawarn +1 -0
@@ -64,6 +64,7 @@ KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast) KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access) +KBUILD_CFLAGS += $(call cc-disable-warning, cast-function-type-strict) endif endif
security/Kconfig.hardening +10 -4
@@ -22,11 +22,17 @@ menu "Memory initialization" config CC_HAS_AUTO_VAR_INIT_PATTERN def_bool $(cc-option,-ftrivial-auto-var-init=pattern) -config CC_HAS_AUTO_VAR_INIT_ZERO - # GCC ignores the -enable flag, so we can test for the feature with - # a single invocation using the flag, but drop it as appropriate in - # the Makefile, depending on the presence of Clang. +config CC_HAS_AUTO_VAR_INIT_ZERO_BARE + def_bool $(cc-option,-ftrivial-auto-var-init=zero) + +config CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER + # Clang 16 and later warn about using the -enable flag, but it + # is required before then. def_bool $(cc-option,-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang) + depends on !CC_HAS_AUTO_VAR_INIT_ZERO_BARE + +config CC_HAS_AUTO_VAR_INIT_ZERO + def_bool CC_HAS_AUTO_VAR_INIT_ZERO_BARE || CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER choice prompt "Initialize kernel stack variables at function entry"