From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5C71C433FE for ; Mon, 10 Oct 2022 07:04:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230432AbiJJHEC (ORCPT ); Mon, 10 Oct 2022 03:04:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbiJJHD7 (ORCPT ); Mon, 10 Oct 2022 03:03:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A038247B96; Mon, 10 Oct 2022 00:03:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 44BF060AB4; Mon, 10 Oct 2022 07:03:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56C41C433D6; Mon, 10 Oct 2022 07:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385437; bh=j8yz7c+fu6wC7fp/hDNkzZWQ6OI7/IA5ogBHV0cHu4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mzegYX0CWF7/0u8DPQ6LbtCKYEP6ZXw4hLEyCufWR96ao9ZIvbByvzMis3RXMPQlW /8p8J4NnWUp7Ghd4wGi2jcwmbY4ig82lud1qwnaHneIwWXqX0KXdvViAgqGIWEFG54 pQtW5pRkvmlcEjlF2suMv5+z37etdG9HFyF68xq4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jalal Mostafa , Daniel Borkmann , Magnus Karlsson Subject: [PATCH 6.0 01/17] xsk: Inherit need_wakeup flag for shared sockets Date: Mon, 10 Oct 2022 09:04:24 +0200 Message-Id: <20221010070330.211534120@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jalal Mostafa commit 60240bc26114543fcbfcd8a28466e67e77b20388 upstream. The flag for need_wakeup is not set for xsks with `XDP_SHARED_UMEM` flag and of different queue ids and/or devices. They should inherit the flag from the first socket buffer pool since no flags can be specified once `XDP_SHARED_UMEM` is specified. Fixes: b5aea28dca134 ("xsk: Add shared umem support between queue ids") Signed-off-by: Jalal Mostafa Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220921135701.10199-1-jalal.a.mostapha@g= mail.com Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- include/net/xsk_buff_pool.h | 2 +- net/xdp/xsk.c | 4 ++-- net/xdp/xsk_buff_pool.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) --- a/include/net/xsk_buff_pool.h +++ b/include/net/xsk_buff_pool.h @@ -95,7 +95,7 @@ struct xsk_buff_pool *xp_create_and_assi 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); --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -954,8 +954,8 @@ static int xsk_bind(struct socket *sock, goto out_unlock; } =20 - err =3D xp_assign_dev_shared(xs->pool, umem_xs->umem, - dev, qid); + err =3D xp_assign_dev_shared(xs->pool, umem_xs, dev, + qid); if (err) { xp_destroy(xs->pool); xs->pool =3D NULL; --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -212,17 +212,18 @@ err_unreg_pool: return err; } =20 -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 =3D umem_xs->umem; =20 /* One fill and completion ring required for each queue id. */ if (!pool->fq || !pool->cq) return -EINVAL; =20 flags =3D umem->zc ? XDP_ZEROCOPY : XDP_COPY; - if (pool->uses_need_wakeup) + if (umem_xs->pool->uses_need_wakeup) flags |=3D XDP_USE_NEED_WAKEUP; =20 return xp_assign_dev(pool, dev, queue_id, flags); From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B5A6C433F5 for ; Mon, 10 Oct 2022 07:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231503AbiJJHFl (ORCPT ); Mon, 10 Oct 2022 03:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbiJJHE5 (ORCPT ); Mon, 10 Oct 2022 03:04:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291C25A152; Mon, 10 Oct 2022 00:04:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5223360E84; Mon, 10 Oct 2022 07:04:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62D59C433C1; Mon, 10 Oct 2022 07:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385466; bh=HNPPtoQnYBQEA6aJUF+GOhYCaUNi2L9VMOgqLx3VwZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jW9ePRayM/mBRktcSIZybsbdJvLJgWpNV2J6NKZloUGHYkJakw4xP4i9RuJpQPUx2 eGcwXCKt4sV+Pl39MuqLNV9WUcgVUhNob9cZlDmQ1Ytuyt6SN6ONxtdKNcyaOslnZi G18QnF9MXipttm8fnw8YMzRcw/a9A0xT8KWh3mi8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, butt3rflyh4ck , Hao Sun , Jiacheng Xu , "Christian Brauner (Microsoft)" , Dongliang Mu , Al Viro Subject: [PATCH 6.0 02/17] fs: fix UAF/GPF bug in nilfs_mdt_destroy Date: Mon, 10 Oct 2022 09:04:25 +0200 Message-Id: <20221010070330.249769257@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongliang Mu commit 2e488f13755ffbb60f307e991b27024716a33b29 upstream. In alloc_inode, inode_init_always() could return -ENOMEM if security_inode_alloc() fails, which causes inode->i_private uninitialized. Then nilfs_is_metadata_file_inode() returns true and nilfs_free_inode() wrongly calls nilfs_mdt_destroy(), which frees the uninitialized inode->i_private and leads to crashes(e.g., UAF/GPF). Fix this by moving security_inode_alloc just prior to this_cpu_inc(nr_inodes) Link:=C2=A0https://lkml.kernel.org/r/CAFcO6XOcf1Jj2SeGt=3DjJV59wmhESeSKpfR0= omdFRq+J9nD1vfQ@mail.gmail.com Reported-by: butt3rflyh4ck Reported-by: Hao Sun Reported-by: Jiacheng Xu Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Dongliang Mu Cc: Al Viro Cc: stable@vger.kernel.org Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- fs/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/fs/inode.c +++ b/fs/inode.c @@ -192,8 +192,6 @@ int inode_init_always(struct super_block inode->i_wb_frn_history =3D 0; #endif =20 - 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); =20 @@ -228,11 +226,12 @@ int inode_init_always(struct super_block inode->i_fsnotify_mask =3D 0; #endif inode->i_flctx =3D NULL; + + if (unlikely(security_inode_alloc(inode))) + return -ENOMEM; this_cpu_inc(nr_inodes); =20 return 0; -out: - return -ENOMEM; } EXPORT_SYMBOL(inode_init_always); =20 From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6980FC433F5 for ; Mon, 10 Oct 2022 07:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231618AbiJJHFq (ORCPT ); Mon, 10 Oct 2022 03:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231517AbiJJHE7 (ORCPT ); Mon, 10 Oct 2022 03:04:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3816657218; Mon, 10 Oct 2022 00:04:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0076660E33; Mon, 10 Oct 2022 07:04:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 171EFC433C1; Mon, 10 Oct 2022 07:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385469; bh=UtIDBXhdAQyO1vH3evjFRrIJ49GBbhsUJXe/G1NSqZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RaIGtRmB5qMBz/0Y3NP+ApzKvE3aXrqamXtgkbaowLtwB1gRCVVfq0y23Jk9gHuzN 3rD6ctAs040kQTQ5QbBN5sl8/q3J9SibYigwRmuhc4j5Je0tdOVCX/tMDEbcKMUSZK cOJkWeI75/jUspU2k1z57GMK8eM0ekQrCX9RlGd4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "J. R. Okajima" , Al Viro , stable@kernel.org Subject: [PATCH 6.0 03/17] [brown paperbag] fix coredump breakage Date: Mon, 10 Oct 2022 09:04:26 +0200 Message-Id: <20221010070330.284105863@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Al Viro commit 4f526fef91b24197d489ff86789744c67f475bb4 upstream. Let me count the ways in which I'd screwed up: * when emitting a page, handling of gaps in coredump should happen before fetching the current file position. * fix for a problem that occurs on rather uncommon setups (and hadn't been observed in the wild) had been sent very late in the cycle. * ... with badly insufficient testing, introducing an easily reproducible breakage. Without giving it time to soak in -next. Fucked-up-by: Al Viro Reported-by: "J. R. Okajima" Tested-by: "J. R. Okajima" Fixes: 06bbaa6dc53c "[coredump] don't use __kernel_write() on kmap_local_pa= ge()" Cc: stable@kernel.org # v6.0-only Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- fs/coredump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/coredump.c +++ b/fs/coredump.c @@ -841,7 +841,7 @@ static int dump_emit_page(struct coredum }; struct iov_iter iter; struct file *file =3D cprm->file; - loff_t pos =3D file->f_pos; + loff_t pos; ssize_t n; =20 if (cprm->to_skip) { @@ -853,6 +853,7 @@ static int dump_emit_page(struct coredum return 0; if (dump_interrupted()) return 0; + pos =3D file->f_pos; iov_iter_bvec(&iter, WRITE, &bvec, 1, PAGE_SIZE); n =3D __kernel_write_iter(cprm->file, &iter, &pos); if (n !=3D PAGE_SIZE) From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2154BC433F5 for ; Mon, 10 Oct 2022 07:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbiJJHFy (ORCPT ); Mon, 10 Oct 2022 03:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbiJJHFA (ORCPT ); Mon, 10 Oct 2022 03:05:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B06E58DC6; Mon, 10 Oct 2022 00:04:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9200760E86; Mon, 10 Oct 2022 07:04:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3416C433C1; Mon, 10 Oct 2022 07:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385472; bh=PSMXGnsG+3jG0WxZXNAHq0UZqhqCZ0vRVwIh4w1G0Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OhAh0teu+zA0FthUFa9TcrOL4k621i9HAPZlhqsUseTS5PsDf3LWvAarwxLRsPWWz YRIdh4PEY1hTJDV+DVLH1X2VojNbR3ERpjqGS/bWY9sLi+F+fYFFP+qRKz/ztuRxZf Hfl33Gq3f1XVCo9Yr9RSQf2hc6uF336nrgfjWaWo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bart Van Assche , Andreas Larsson , Kees Cook Subject: [PATCH 6.0 04/17] sparc: Unbreak the build Date: Mon, 10 Oct 2022 09:04:27 +0200 Message-Id: <20221010070330.315004347@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bart Van Assche commit 17006e86a7641fa3c50324cfb602f0e74dac8527 upstream. Fix the following build errors: arch/sparc/mm/srmmu.c: In function =E2=80=98smp_flush_page_for_dma=E2=80=99: arch/sparc/mm/srmmu.c:1639:13: error: cast between incompatible function ty= pes from =E2=80=98void (*)(long unsigned int)=E2=80=99 to =E2=80=98void (*)= (long unsigned int, long unsigned int, long unsigned int, long unsigned = int, long unsigned int)=E2=80=99 [-Werror=3Dcast-function-type] 1639 | xc1((smpfunc_t) local_ops->page_for_dma, page); | ^ arch/sparc/mm/srmmu.c: In function =E2=80=98smp_flush_cache_mm=E2=80=99: arch/sparc/mm/srmmu.c:1662:29: error: cast between incompatible function ty= pes from =E2=80=98void (*)(struct mm_struct *)=E2=80=99 to =E2=80=98void (*= )(long unsigned int, long unsigned int, long unsigned int, long unsigned= int, long unsigned int)=E2=80=99 [-Werror=3Dcast-function-type] 1662 | xc1((smpfunc_t) local_ops->cache_mm, (unsig= ned long) mm); | [ ... ] Compile-tested only. Fixes: 552a23a0e5d0 ("Makefile: Enable -Wcast-function-type") Cc: stable@vger.kernel.org Signed-off-by: Bart Van Assche Tested-by: Andreas Larsson Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220830205854.1918026-1-bvanassche@acm.org Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- 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 +++++++++++++---------------- 5 files changed, 39 insertions(+), 39 deletions(-) --- a/arch/sparc/include/asm/smp_32.h +++ b/arch/sparc/include/asm/smp_32.h @@ -33,9 +33,6 @@ extern volatile unsigned long cpu_callin extern cpumask_t smp_commenced_mask; extern struct linux_prom_registers smp_penguin_ctable; =20 -typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long); - void cpu_panic(void); =20 /* @@ -57,7 +54,7 @@ void smp_bogo(struct seq_file *); void smp_info(struct seq_file *); =20 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; =20 -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); } =20 -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 a= rg2) +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); } =20 -static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long a= rg2, +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); } =20 -static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long a= rg2, +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, --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c @@ -359,7 +359,7 @@ void leonsmp_ipi_interrupt(void) } =20 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); =20 /* 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 fu =20 { /* If you make changes here, make sure gcc generates proper code... */ - register smpfunc_t f asm("i0") =3D func; + register void *f asm("i0") =3D func; register unsigned long a1 asm("i1") =3D arg1; register unsigned long a2 asm("i2") =3D arg2; register unsigned long a3 asm("i3") =3D arg3; @@ -444,11 +444,13 @@ static void leon_cross_call(smpfunc_t fu /* Running cross calls. */ void leon_cross_call_irq(void) { + void (*func)(unsigned long, unsigned long, unsigned long, unsigned long, + unsigned long) =3D ccall_info.func; int i =3D smp_processor_id(); =20 ccall_info.processors_in[i] =3D 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] =3D 1; } =20 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c @@ -268,7 +268,7 @@ static void sun4d_ipi_resched(int cpu) } =20 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); =20 /* 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 arg= 1, unsigned long arg2, unsigned long arg3, unsigned long arg4) { @@ -296,7 +296,7 @@ static void sun4d_cross_call(smpfunc_t f * If you make changes here, make sure * gcc generates proper code... */ - register smpfunc_t f asm("i0") =3D func; + register void *f asm("i0") =3D func; register unsigned long a1 asm("i1") =3D arg1; register unsigned long a2 asm("i2") =3D arg2; register unsigned long a3 asm("i3") =3D arg3; @@ -353,11 +353,13 @@ static void sun4d_cross_call(smpfunc_t f /* Running cross calls. */ void smp4d_cross_call_irq(void) { + void (*func)(unsigned long, unsigned long, unsigned long, unsigned long, + unsigned long) =3D ccall_info.func; int i =3D hard_smp_processor_id(); =20 ccall_info.processors_in[i] =3D 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] =3D 1; } =20 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c @@ -157,7 +157,7 @@ static void sun4m_ipi_mask_one(int cpu) } =20 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); =20 /* 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 arg= 1, unsigned long arg2, unsigned long arg3, unsigned long arg4) { @@ -230,11 +230,13 @@ static void sun4m_cross_call(smpfunc_t f /* Running cross calls. */ void smp4m_cross_call_irq(void) { + void (*func)(unsigned long, unsigned long, unsigned long, unsigned long, + unsigned long) =3D ccall_info.func; int i =3D smp_processor_id(); =20 ccall_info.processors_in[i] =3D 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] =3D 1; } =20 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -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); } =20 static void smp_flush_cache_all(void) { - xc0((smpfunc_t) local_ops->cache_all); + xc0(local_ops->cache_all); local_ops->cache_all(); } =20 static void smp_flush_tlb_all(void) { - xc0((smpfunc_t) local_ops->tlb_all); + xc0(local_ops->tlb_all); local_ops->tlb_all(); } =20 @@ -1659,7 +1659,7 @@ static void smp_flush_cache_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_s 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) =3D=3D 1 && current->active_mm =3D=3D mm) cpumask_copy(mm_cpumask(mm), cpumask_of(smp_processor_id())); @@ -1691,8 +1691,8 @@ static void smp_flush_cache_range(struct 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 v 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 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 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(unsign * 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 m 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); } =20 From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E049C433FE for ; Mon, 10 Oct 2022 07:06:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231411AbiJJHF7 (ORCPT ); Mon, 10 Oct 2022 03:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbiJJHFM (ORCPT ); Mon, 10 Oct 2022 03:05:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11C2EBC; Mon, 10 Oct 2022 00:04:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C726CB80E53; Mon, 10 Oct 2022 07:04:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 406D1C433C1; Mon, 10 Oct 2022 07:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385474; bh=dBpezJIwjq1M+9ukK5f5Mb+tYyOlvPJmyGHSMIB8t6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=up9Q9vne0GKW/hbKZ48930iafozALb23P48nNap+GGFbMwrqyBefWoYI3TTd+WYPO M6RFPa0OqdNkAi7sOJvEVDqit0gkYSKEKv7w4gL3d0tfmFwTnUwQpPawVk2LZF8Jg0 EXvJ8AqKDt202YR0Keh4+Sb4iskOPI1c5N7W5am8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Sami Tolvanen , Kees Cook Subject: [PATCH 6.0 05/17] Makefile.extrawarn: Move -Wcast-function-type-strict to W=1 Date: Mon, 10 Oct 2022 09:04:28 +0200 Message-Id: <20221010070330.348608074@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sami Tolvanen commit 2120635108b35ecad9c59c8b44f6cbdf4f98214e upstream. We enable -Wcast-function-type globally in the kernel to warn about mismatching types in function pointer casts. Compilers currently warn only about ABI incompability with this flag, but Clang 16 will enable a stricter version of the check by default that checks for an exact type match. This will be very noisy in the kernel, so disable -Wcast-function-type-strict without W=3D1 until the new warnings have been addressed. Cc: stable@vger.kernel.org Link: https://reviews.llvm.org/D134831 Link: https://github.com/ClangBuiltLinux/linux/issues/1724 Suggested-by: Nathan Chancellor Signed-off-by: Sami Tolvanen Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220930203310.4010564-1-samitolvanen@googl= e.com Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- scripts/Makefile.extrawarn | 1 + 1 file changed, 1 insertion(+) --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -64,6 +64,7 @@ KBUILD_CFLAGS +=3D -Wno-sign-compare KBUILD_CFLAGS +=3D $(call cc-disable-warning, pointer-to-enum-cast) KBUILD_CFLAGS +=3D -Wno-tautological-constant-out-of-range-compare KBUILD_CFLAGS +=3D $(call cc-disable-warning, unaligned-access) +KBUILD_CFLAGS +=3D $(call cc-disable-warning, cast-function-type-strict) endif =20 endif From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 882CBC433F5 for ; Mon, 10 Oct 2022 07:06:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbiJJHGb (ORCPT ); Mon, 10 Oct 2022 03:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbiJJHFm (ORCPT ); Mon, 10 Oct 2022 03:05:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA2E3658B; Mon, 10 Oct 2022 00:04:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7C471B80E57; Mon, 10 Oct 2022 07:04:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF57DC433D6; Mon, 10 Oct 2022 07:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385477; bh=DsoCa3MDoRxrq2Sl640fMowD0OxS0uU2ONr/dWh+nng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BtFXPUlE/6bkWdQIDch8i3r1951CjWGEIfhmRAwB+jxfr3AyqNVD1uyea7cBuLWpQ PSae47Ieaw8QTIeGJsQOOwlWvN7MuiYOVosB2Cc4MZyrkelP9cHUumUdylgvBjQf2/ +Gqd/Pz//4pjnjQNzhXvgFDFe2B1eMPfPCUt0sMs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Masahiro Yamada , Nick Desaulniers , linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Kees Cook Subject: [PATCH 6.0 06/17] hardening: Remove Clangs enable flag for -ftrivial-auto-var-init=zero Date: Mon, 10 Oct 2022 09:04:29 +0200 Message-Id: <20221010070330.376138580@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Kees Cook commit 607e57c6c62c00965ae276902c166834ce73014a upstream. Now that Clang's -enable-trivial-auto-var-init-zero-knowing-it-will-be-remo= ved-from-clang option is no longer required, remove it from the command line. Clang 16 and later will warn when it is used, which will cause Kconfig to think it can't use -ftrivial-auto-var-init=3Dzero at all. Check for whether it is required and only use it when so. Cc: Nathan Chancellor Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: linux-kbuild@vger.kernel.org Cc: llvm@lists.linux.dev Cc: stable@vger.kernel.org Fixes: f02003c860d9 ("hardening: Avoid harmless Clang option under CONFIG_I= NIT_STACK_ALL_ZERO") Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- Makefile | 4 ++-- security/Kconfig.hardening | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) --- a/Makefile +++ b/Makefile @@ -831,8 +831,8 @@ endif # Initialize all stack variables with a zero value. ifdef CONFIG_INIT_STACK_ALL_ZERO KBUILD_CFLAGS +=3D -ftrivial-auto-var-init=3Dzero -ifdef CONFIG_CC_IS_CLANG -# https://bugs.llvm.org/show_bug.cgi?id=3D45497 +ifdef CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER +# https://github.com/llvm/llvm-project/issues/44842 KBUILD_CFLAGS +=3D -enable-trivial-auto-var-init-zero-knowing-it-will-be-r= emoved-from-clang endif endif --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening @@ -22,11 +22,17 @@ menu "Memory initialization" config CC_HAS_AUTO_VAR_INIT_PATTERN def_bool $(cc-option,-ftrivial-auto-var-init=3Dpattern) =20 -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=3Dzero) + +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=3Dzero -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_ENAB= LER =20 choice prompt "Initialize kernel stack variables at function entry" From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C285C433F5 for ; Mon, 10 Oct 2022 07:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231687AbiJJHGZ (ORCPT ); Mon, 10 Oct 2022 03:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231588AbiJJHFi (ORCPT ); Mon, 10 Oct 2022 03:05:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CE93B867; Mon, 10 Oct 2022 00:04:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7633A60E74; Mon, 10 Oct 2022 07:04:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87397C433C1; Mon, 10 Oct 2022 07:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385479; bh=7a+WTDLovQeSm3K4+3q8ZCqpy2ODJ1EzuBZHDte6j3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q7WSKj82aLGB1Xj3Qf1di3eMv5aKbBJKvu9K/67RQk5smo82SvcDQi7eOL4aX5IQx p0yhOED9fntKp+wifw2Qa5EfOlB3ULvwFOewdy8SB8HrVO9k2app6hxL27zs8RccUf O71ovo36jYxwP9ym6IP9ZZbSheHM4LIuE4Gpu/nw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shuah Khan , Jonathan Corbet Subject: [PATCH 6.0 07/17] docs: update mediator information in CoC docs Date: Mon, 10 Oct 2022 09:04:30 +0200 Message-Id: <20221010070330.412305029@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Shuah Khan commit 8bfdfa0d6b929ede7b6189e0e546ceb6a124d05d upstream. Update mediator information in the CoC interpretation document. Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220901212319.56644-1-skhan@linuxfoundatio= n.org Cc: stable@vger.kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- Documentation/process/code-of-conduct-interpretation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Documentation/process/code-of-conduct-interpretation.rst +++ b/Documentation/process/code-of-conduct-interpretation.rst @@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or ot 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 . +reach out to our conflict mediator, Joanna Lee . =20 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 From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 768EEC4332F for ; Mon, 10 Oct 2022 07:06:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231664AbiJJHGM (ORCPT ); Mon, 10 Oct 2022 03:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbiJJHFS (ORCPT ); Mon, 10 Oct 2022 03:05:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89924631E; Mon, 10 Oct 2022 00:04:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3E13260E8D; Mon, 10 Oct 2022 07:04:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 543CEC433D6; Mon, 10 Oct 2022 07:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385482; bh=Jq8qMOMnQ5EYQxwRItUaZQpYLQUALXFqrahrT5nE/nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wivghXBt3Z3xCsTW92eiq2xH5FXOuAQZqnutUAJ4QdKThlW45KNlxMT1TBQXItOxY mtiUMb2/TsOZRS9/cnVqOzVL8Q5hO2LDlYQWBR8h7PT6t7BdM37S2nCHScXF9A6Q0V T2txNCbUTahGFz7o6BTj5JHRPzyd0O7TEpxqXS7U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aleksa Savic , stable@vger.kenrel.org, Guenter Roeck Subject: [PATCH 6.0 08/17] hwmon: (aquacomputer_d5next) Fix Quadro fan speed offsets Date: Mon, 10 Oct 2022 09:04:31 +0200 Message-Id: <20221010070330.443889502@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Aleksa Savic commit b7f3e9650f12d1e06b94a0257bcb90279f691bf5 upstream. The offsets for setting speeds of fans connected to Quadro are off by one. Set them to their correct values. The offsets as shown point to registers for setting the fan control mode, which will be explored in future patches, but slipped in here. When setting fan speeds, the resulting values were overlapping, which made the fans still run in my initial testing. Fixes: cdbe34da01e3 ("hwmon: (aquacomputer_d5next) Add support for Aquacomp= uter Quadro fan controller") Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20220914114327.6941-1-savicaleksa83@gmail.c= om Cc: stable@vger.kenrel.org Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- drivers/hwmon/aquacomputer_d5next.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hwmon/aquacomputer_d5next.c +++ b/drivers/hwmon/aquacomputer_d5next.c @@ -110,7 +110,7 @@ static u16 octo_ctrl_fan_offsets[] =3D { 0 static u8 quadro_sensor_fan_offsets[] =3D { 0x70, 0x7D, 0x8A, 0x97 }; =20 /* Fan speed registers in Quadro control report (from 0-100%) */ -static u16 quadro_ctrl_fan_offsets[] =3D { 0x36, 0x8b, 0xe0, 0x135 }; +static u16 quadro_ctrl_fan_offsets[] =3D { 0x37, 0x8c, 0xe1, 0x136 }; =20 /* Labels for D5 Next */ static const char *const label_d5next_temp[] =3D { From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1630C433FE for ; Mon, 10 Oct 2022 07:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231682AbiJJHGU (ORCPT ); Mon, 10 Oct 2022 03:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231459AbiJJHFc (ORCPT ); Mon, 10 Oct 2022 03:05:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27111B4B0; Mon, 10 Oct 2022 00:04:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DBD0D60AB4; Mon, 10 Oct 2022 07:04:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDB08C433D6; Mon, 10 Oct 2022 07:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385485; bh=xxDHkhWXn9LWoUKnTOuFYR63Zphxmul0hUMh47XisPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uFYS5ls7MO0lzpXIUvMDVcHPV77mAGMNsXxqK3eItYSJJMRf0zXTiFHwTPxMkmAJb Gs9N7M1BRm/TLiOggSRfWaeF0eG64IeTHpexcTI9W5lhbLie+3FB9R/0s5TB43eonA OZuEDruy2qhNooBVo3kU2zfNsRySg9e2tVyGMRdQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Dmitry Vyukov" , stable , syzbot+23f57c5ae902429285d7@syzkaller.appspotmail.com, Tadeusz Struk , PaX Team Subject: [PATCH 6.0 09/17] usb: mon: make mmapped memory read only Date: Mon, 10 Oct 2022 09:04:32 +0200 Message-Id: <20221010070330.478301738@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Tadeusz Struk commit a659daf63d16aa883be42f3f34ff84235c302198 upstream. Syzbot found an issue in usbmon module, where the user space client can corrupt the monitor's internal memory, causing the usbmon module to crash the kernel with segfault, UAF, etc. The reproducer mmaps the /dev/usbmon memory to user space, and overwrites it with arbitrary data, which causes all kinds of issues. Return an -EPERM error from mon_bin_mmap() if the flag VM_WRTIE is set. Also clear VM_MAYWRITE to make it impossible to change it to writable later. Cc: "Dmitry Vyukov" Cc: stable Fixes: 6f23ee1fefdc ("USB: add binary API to usbmon") Suggested-by: PaX Team # for the VM_MAYRITE portion Link: https://syzkaller.appspot.com/bug?id=3D2eb1f35d6525fa4a74d75b4244971e= 5b1411c95a Reported-by: syzbot+23f57c5ae902429285d7@syzkaller.appspotmail.com Signed-off-by: Tadeusz Struk Link: https://lore.kernel.org/r/20220919215957.205681-1-tadeusz.struk@linar= o.org Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- drivers/usb/mon/mon_bin.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c @@ -1268,6 +1268,11 @@ static int mon_bin_mmap(struct file *fil { /* don't do anything here: "fault" will set up page table entries */ vma->vm_ops =3D &mon_bin_vm_ops; + + if (vma->vm_flags & VM_WRITE) + return -EPERM; + + vma->vm_flags &=3D ~VM_MAYWRITE; vma->vm_flags |=3D VM_DONTEXPAND | VM_DONTDUMP; vma->vm_private_data =3D filp->private_data; mon_bin_vma_open(vma); From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08391C433F5 for ; Mon, 10 Oct 2022 07:04:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231157AbiJJHEQ (ORCPT ); Mon, 10 Oct 2022 03:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230509AbiJJHEH (ORCPT ); Mon, 10 Oct 2022 03:04:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58CC04DB59; Mon, 10 Oct 2022 00:04:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D59DA60E75; Mon, 10 Oct 2022 07:04:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9AFEC433B5; Mon, 10 Oct 2022 07:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385445; bh=z6OsWk08vLGcLmceY4PxP1JeS2qoz8/BVeiey1XblsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gAlFSnzQ08mSYvTfxGWX+30IimNvvCW2jUKXnRx8snXe9snyIkzk+nec5uJqnYYjl 1YyMaabF0nEWRAun7lkYgi6+NzOv71jwLO5jRYAnaCDraK/IrdgRn3hyp2M6AkWqIw iViL6n0C7vfJe/djRzdyd3BKaOZT0Sxn7ziSP5JI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 6.0 10/17] USB: serial: ftdi_sio: fix 300 bps rate for SIO Date: Mon, 10 Oct 2022 09:04:33 +0200 Message-Id: <20221010070330.514134436@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Johan Hovold commit 7bd7ad3c310cd6766f170927381eea0aa6f46c69 upstream. The 300 bps rate of SIO devices has been mapped to 9600 bps since 2003... Let's fix the regression. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- drivers/usb/serial/ftdi_sio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1319,8 +1319,7 @@ static u32 get_ftdi_divisor(struct tty_s case 38400: div_value =3D ftdi_sio_b38400; break; case 57600: div_value =3D ftdi_sio_b57600; break; case 115200: div_value =3D ftdi_sio_b115200; break; - } /* baud */ - if (div_value =3D=3D 0) { + default: dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n", __func__, baud); div_value =3D ftdi_sio_b9600; From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A589C433F5 for ; Mon, 10 Oct 2022 07:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231232AbiJJHEa (ORCPT ); Mon, 10 Oct 2022 03:04:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230509AbiJJHEZ (ORCPT ); Mon, 10 Oct 2022 03:04:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4E257214; Mon, 10 Oct 2022 00:04:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AD5EF60E08; Mon, 10 Oct 2022 07:04:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBD1BC4347C; Mon, 10 Oct 2022 07:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385448; bh=p/a7Ck13eilhvSGzMf34OEY+FhQIKCwPRX08CU6DU38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CEzVlqmaG6uWNr7+WQwA/wPTZ8bmeLJ2C8YM07Dt0WD+GIjYXheEuJDY8seivv69J xByNrdC0Ozun7ne/IXAGDLUR+TikqEXIeTLQ7/QuNXgnoRB/2H5i0+nHBIeBCYa+1U FwQ1lCUfvK44g40f2/4Pac3MwDm23Ck8PHGnlwf4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Limonciello , Hans de Goede , Mika Westerberg , Andy Shevchenko Subject: [PATCH 6.0 11/17] gpiolib: acpi: Add support to ignore programming an interrupt Date: Mon, 10 Oct 2022 09:04:34 +0200 Message-Id: <20221010070330.541193431@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Mario Limonciello commit 6b6af7bd5718f4e45a9b930533aec1158387d552 upstream. gpiolib-acpi already had support for ignoring a pin for wakeup, but if an OEM configures a floating pin as an interrupt source then stopping it from being a wakeup won't do much good to stop the interrupt storm. Add support for a module parameter and quirk infrastructure to ignore interrupts as well. Signed-off-by: Mario Limonciello Reviewed-by: Hans de Goede Reviewed-by: Mika Westerberg Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- drivers/gpio/gpiolib-acpi.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -32,9 +32,16 @@ MODULE_PARM_DESC(ignore_wake, "controller@pin combos on which to ignore the ACPI wake flag " "ignore_wake=3Dcontroller@pin[,controller@pin[,...]]"); =20 +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=3Dcontroller@pin[,controller@pin[,...]]"); + struct acpi_gpiolib_dmi_quirk { bool no_edge_events_on_boot; char *ignore_wake; + char *ignore_interrupt; }; =20 /** @@ -317,14 +324,15 @@ static struct gpio_desc *acpi_request_ow return desc; } =20 -static bool acpi_gpio_in_ignore_list(const char *controller_in, unsigned i= nt 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; =20 - controller =3D ignore_wake; + controller =3D ignore_list; while (controller) { pin_str =3D strchr(controller, '@'); if (!pin_str) @@ -348,7 +356,7 @@ static bool acpi_gpio_in_ignore_list(con =20 return false; err: - pr_err_once("Error: Invalid value for gpiolib_acpi.ignore_wake: %s\n", ig= nore_wake); + pr_err_once("Error: Invalid value for gpiolib_acpi.ignore_...: %s\n", ign= ore_list); return false; } =20 @@ -360,7 +368,7 @@ static bool acpi_gpio_irq_is_wake(struct if (agpio->wake_capable !=3D ACPI_WAKE_CAPABLE) return false; =20 - 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_e goto fail_unlock_irq; } =20 + if (acpi_gpio_in_ignore_list(ignore_interrupt, dev_name(chip->parent), pi= n)) { + dev_info(chip->parent, "Ignoring interrupt on pin %u\n", pin); + return AE_OK; + } + event =3D kzalloc(sizeof(*event), GFP_KERNEL); if (!event) goto fail_unlock_irq; @@ -1585,6 +1598,9 @@ static int __init acpi_gpio_setup_params if (ignore_wake =3D=3D NULL && quirk && quirk->ignore_wake) ignore_wake =3D quirk->ignore_wake; =20 + if (ignore_interrupt =3D=3D NULL && quirk && quirk->ignore_interrupt) + ignore_interrupt =3D quirk->ignore_interrupt; + return 0; } From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB188C433FE for ; Mon, 10 Oct 2022 07:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbiJJHEj (ORCPT ); Mon, 10 Oct 2022 03:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231211AbiJJHE3 (ORCPT ); Mon, 10 Oct 2022 03:04:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4053457BCE; Mon, 10 Oct 2022 00:04:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4DF0460E33; Mon, 10 Oct 2022 07:04:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F70FC433C1; Mon, 10 Oct 2022 07:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385450; bh=oZYqT3xUb1hjb2465mZZ2n6xZl4MUWJlOEtk+FXrmj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RWzFVsAdUmHNrIOtpxL73B2ehl/Shszqze8k4SIfWJdrlk4a/lbhNPv38GhAcaLAW /JPDIa2mqNrBDSGU0CwRw36EhuS/X3mlbDds8f9Zi7brf3nxDGVULt4FloKk8tYWvz srtRGXwpvX2iK4OR4ccKbie6pmlyEw20zu1lts2M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Krc , Hans de Goede , Mario Limonciello , Mika Westerberg , Andy Shevchenko Subject: [PATCH 6.0 12/17] gpiolib: acpi: Add a quirk for Asus UM325UAZ Date: Mon, 10 Oct 2022 09:04:35 +0200 Message-Id: <20221010070330.571554368@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Mario Limonciello commit 0ea76c401f9245ac209f1b1ce03a7e1fb9de36e5 upstream. Asus UM325UAZ has GPIO 18 programmed as both an interrupt and a wake source, but confirmed with internal team on this design this pin is floating and shouldn't have been programmed. This causes lots of spurious IRQs on the system and horrendous battery life. Add a quirk to ignore attempts to program this pin on this system. Reported-by: Pavel Krc Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216208 Reviewed-by: Hans de Goede Signed-off-by: Mario Limonciello Reviewed-by: Mika Westerberg Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- drivers/gpio/gpiolib-acpi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -1576,6 +1576,20 @@ static const struct dmi_system_id gpioli .ignore_wake =3D "INT33FF:01@0", }, }, + { + /* + * Interrupt storm caused from edge triggered floating pin + * Found in BIOS UX325UAZ.300 + * https://bugzilla.kernel.org/show_bug.cgi?id=3D216208 + */ + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UAZ_UM325UAZ"), + }, + .driver_data =3D &(struct acpi_gpiolib_dmi_quirk) { + .ignore_interrupt =3D "AMDI0030:00@18", + }, + }, {} /* Terminating entry */ }; From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE084C433F5 for ; Mon, 10 Oct 2022 07:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbiJJHEo (ORCPT ); Mon, 10 Oct 2022 03:04:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbiJJHE3 (ORCPT ); Mon, 10 Oct 2022 03:04:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA9C658B71; Mon, 10 Oct 2022 00:04:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 90C44B80E4D; Mon, 10 Oct 2022 07:04:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA104C4314B; Mon, 10 Oct 2022 07:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385453; bh=UyJS/8ZScB4QO07Dy1KKrqbvq/OK/tJ5Sq7/ISEA1eg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZO/41ZPrg2aBp4G5l+J5dAgydWrVVtm3efryKi2IFgHQrTyU9LsrUrDpfVAhm6EHz 51sNsmvrcmbQ9ud4wEOZu6PthSwc0/UyB8/tL4GMrFi4LvnSN1M1R8J4QllDz/p5Sv PHGr1kcm0kUuyxxeh5k6n8C8kFuVyuBlMoEcXqBo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Palmer Dabbelt , Conor Dooley , Heiko Stuebner Subject: [PATCH 6.0 13/17] RISC-V: Print SSTC in canonical order Date: Mon, 10 Oct 2022 09:04:36 +0200 Message-Id: <20221010070330.604651779@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Palmer Dabbelt commit 61a41d16ad20657f93613229a8b17766c51dc849 upstream. This got out of order during a merge conflict, fix it by putting the entries in the correct order. Fixes: 7ab52f75a9cf ("RISC-V: Add Sstc extension support") Signed-off-by: Palmer Dabbelt Reviewed-by: Conor Dooley Reviewed-by: Heiko Stuebner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220920204518.10988-1-palmer@rivosinc.com/ Signed-off-by: Palmer Dabbelt Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- arch/riscv/kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -92,10 +92,10 @@ int riscv_of_parent_hartid(struct device */ static struct riscv_isa_ext_data isa_ext_arr[] =3D { __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), }; From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDB07C4332F for ; Mon, 10 Oct 2022 07:05:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbiJJHFT (ORCPT ); Mon, 10 Oct 2022 03:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231237AbiJJHEs (ORCPT ); Mon, 10 Oct 2022 03:04:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B502558B78; Mon, 10 Oct 2022 00:04:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AF0F860E7F; Mon, 10 Oct 2022 07:04:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3935C433D7; Mon, 10 Oct 2022 07:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385456; bh=Jaz0AY+s7g0Ayj++Xk/Qjt2WzNkoORlTkMLlmVWP6jI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ahiCzZEMVvLwwo6G2msOO/DNVlP/fTBjpzrMF5Yf5GZGc3tAy4POWpUXdpUuSXI6v FGFe/O7+SLKEkDAbX+T/45+ADUv/jF0oZreAVifcRoYwK3SpV1WShajhnwcItBHSWh DM+UFy39DrV7hovaLW9lkfk1i19QGO3GmHVMCW8I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kumar Kartikeya Dwivedi , Andrii Nakryiko , Alexei Starovoitov Subject: [PATCH 6.0 14/17] bpf: Gate dynptr API behind CAP_BPF Date: Mon, 10 Oct 2022 09:04:37 +0200 Message-Id: <20221010070330.633241098@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Kumar Kartikeya Dwivedi commit 8addbfc7b308d591f8a5f2f6bb24d08d9d79dfbb upstream. This has been enabled for unprivileged programs for only one kernel release, hence the expected annoyances due to this move are low. Users using ringbuf can stick to non-dynptr APIs. The actual use cases dynptr is meant to serve may not make sense in unprivileged BPF programs. Hence, gate these helpers behind CAP_BPF and limit use to privileged BPF programs. Fixes: 263ae152e962 ("bpf: Add bpf_dynptr_from_mem for local dynptrs") Fixes: bc34dee65a65 ("bpf: Dynptr support for ring buffers") Fixes: 13bbbfbea759 ("bpf: Add bpf_dynptr_read and bpf_dynptr_write") Fixes: 34d4ef5775f7 ("bpf: Add dynptr data slices") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220921143550.30247-1-memxor@gmail.com Acked-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- kernel/bpf/helpers.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -1627,26 +1627,12 @@ bpf_base_func_proto(enum bpf_func_id fun 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 fun 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; } From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FB79C433F5 for ; Mon, 10 Oct 2022 07:05:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231449AbiJJHFY (ORCPT ); Mon, 10 Oct 2022 03:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbiJJHEs (ORCPT ); Mon, 10 Oct 2022 03:04:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B31C958DED; Mon, 10 Oct 2022 00:04:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D77660E08; Mon, 10 Oct 2022 07:04:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FDFCC433D6; Mon, 10 Oct 2022 07:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385458; bh=wWIt7W38r1172jhSxno5+FW8NgxPwz1Fi0FdN/Yqt7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xIe8VEWcSHtWIZeZzB36XQfrHu3zbv8GzONHd7cXRCD5xGqrQzDml9bk5yiLO7Du/ dW4NMmsIPG32KQ2ToL0cjOZTfjos+OKe39Yx35F1DiFPUgm80nGwTyfhdLKPdCTArA 1r6rA6YysC8s+B7wlB5gf2pEkrK4r4TqQ5yxIy8w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Daniel Golle , Jakub Kicinski Subject: [PATCH 6.0 15/17] net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear Date: Mon, 10 Oct 2022 09:04:38 +0200 Message-Id: <20221010070330.668852221@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Daniel Golle commit ae3ed15da5889263de372ff9df2e83e16acca4cb upstream. Setting ib1 state to MTK_FOE_STATE_UNBIND in __mtk_foe_entry_clear routine as done by commit 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear") breaks flow offloading, at least on older MTK_NETSYS_V1 SoCs, OpenWrt users have confirmed the bug on MT7622 and MT7621 systems. Felix Fietkau suggested to use MTK_FOE_STATE_INVALID instead which works well on both, MTK_NETSYS_V1 and MTK_NETSYS_V2. Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3). Suggested-by: Felix Fietkau Fixes: 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_e= ntry_clear") Fixes: 33fc42de33278b ("net: ethernet: mtk_eth_soc: support creating mac ad= dress based offload entries") Signed-off-by: Daniel Golle Link: https://lore.kernel.org/r/YzY+1Yg0FBXcnrtc@makrotopia.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c @@ -412,7 +412,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp if (entry->hash !=3D 0xffff) { ppe->foe_table[entry->hash].ib1 &=3D ~MTK_FOE_IB1_STATE; ppe->foe_table[entry->hash].ib1 |=3D FIELD_PREP(MTK_FOE_IB1_STATE, - MTK_FOE_STATE_UNBIND); + MTK_FOE_STATE_INVALID); dma_wmb(); } entry->hash =3D 0xffff; From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 744F9C433F5 for ; Mon, 10 Oct 2022 07:05:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbiJJHF2 (ORCPT ); Mon, 10 Oct 2022 03:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231171AbiJJHEw (ORCPT ); Mon, 10 Oct 2022 03:04:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7212E59262; Mon, 10 Oct 2022 00:04:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AA443B80E28; Mon, 10 Oct 2022 07:04:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8A6BC433C1; Mon, 10 Oct 2022 07:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385461; bh=LSfMXv0QKcvX4XqWgYoK2hjJnLrT1XfRPAGWA7UWSzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=amRc1M6Ku6kjtOEx62mdj/wiYcFYbh7/pKZKoM1NIAt8nXUvRZTfOhxLn6gJXeqEo 7dLwmijV3fivfqmeB2Q+W0mqUNhMje8V8bTsf/wXzT8f6VOTUUncJSZ5WI1scM98+s WZqf8WAVZRgJQvzJ5MdIcdx+IJ1MRvIbPLi65GBI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jules Irenge , Alexei Starovoitov Subject: [PATCH 6.0 16/17] bpf: Fix resetting logic for unreferenced kptrs Date: Mon, 10 Oct 2022 09:04:39 +0200 Message-Id: <20221010070330.697203665@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jules Irenge commit 9fad7fe5b29803584c7f17a2abe6c2936fec6828 upstream. Sparse reported a warning at bpf_map_free_kptrs() "warning: Using plain integer as NULL pointer" During the process of fixing this warning, it was discovered that the curre= nt code erroneously writes to the pointer variable instead of deferencing and writing to the actual kptr. Hence, Sparse tool accidentally helped to uncov= er this problem. Fix this by doing WRITE_ONCE(*p, 0) instead of WRITE_ONCE(p, = 0). Note that the effect of this bug is that unreferenced kptrs will not be cle= ared during check_and_free_fields. It is not a problem if the clearing is not do= ne during map_free stage, as there is nothing to free for them. Fixes: 14a324f6a67e ("bpf: Wire up freeing of referenced kptr") Signed-off-by: Jules Irenge Link: https://lore.kernel.org/r/Yxi3pJaK6UDjVJSy@playground Signed-off-by: Alexei Starovoitov Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -598,7 +598,7 @@ void bpf_map_free_kptrs(struct bpf_map * if (off_desc->type =3D=3D BPF_KPTR_UNREF) { u64 *p =3D (u64 *)btf_id_ptr; =20 - WRITE_ONCE(p, 0); + WRITE_ONCE(*p, 0); continue; } old_ptr =3D xchg(btf_id_ptr, 0); From nobody Thu Apr 9 11:04:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E264C43217 for ; Mon, 10 Oct 2022 07:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbiJJHFP (ORCPT ); Mon, 10 Oct 2022 03:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbiJJHEs (ORCPT ); Mon, 10 Oct 2022 03:04:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A320052E61; Mon, 10 Oct 2022 00:04:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6069CB80E54; Mon, 10 Oct 2022 07:04:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD8F1C433D6; Mon, 10 Oct 2022 07:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385464; bh=9TaVU9acwI902OnE6elPW0nf4T3kB68NpMHKm/VssLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1S8N2lZM53YkviKs/uF27Y3bYCEBFfelcclRChyrsmypg6sMF5KGBr77GpZUYaGoO aKHobOtsQrQlQcq7YcNxlR6a0fz8IecS/++4n8lmRZnpXqUMCCEzrc4KnMW3oEkdSL SWmCpds7fo/KchTH59m7fkN2Mw3lSdANM2loGi44= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , Tetsuo Handa , Luiz Augusto von Dentz Subject: [PATCH 6.0 17/17] Bluetooth: use hdev->workqueue when queuing hdev->{cmd,ncmd}_timer works Date: Mon, 10 Oct 2022 09:04:40 +0200 Message-Id: <20221010070330.725277419@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070330.159911806@linuxfoundation.org> References: <20221010070330.159911806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Tetsuo Handa commit deee93d13d385103205879a8a0915036ecd83261 upstream. syzbot is reporting attempt to schedule hdev->cmd_work work from system_wq WQ into hdev->workqueue WQ which is under draining operation [1], for commit c8efcc2589464ac7 ("workqueue: allow chained queueing during destruction") does not allow such operation. The check introduced by commit 877afadad2dce8aa ("Bluetooth: When HCI work queue is drained, only queue chained work") was incomplete. Use hdev->workqueue WQ when queuing hdev->{cmd,ncmd}_timer works because hci_{cmd,ncmd}_timeout() calls queue_work(hdev->workqueue). Also, protect the queuing operation with RCU read lock in order to avoid calling queue_delayed_work() after cancel_delayed_work() completed. Link: https://syzkaller.appspot.com/bug?extid=3D243b7d89777f90f7613b [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: 877afadad2dce8aa ("Bluetooth: When HCI work queue is drained, only q= ueue chained work") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman Tested-by: Bagas Sanjaya Tested-by: Fenil Jain Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Jon Hunter Tested-by: Justin M. Forbes Tested-by: Linux Kernel Functional Testing Tested-by: Luna Jernberg Tested-by: Ron Economos Tested-by: Rudi Heitbaum Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee Tested-by: Zan Aziz --- net/bluetooth/hci_core.c | 15 +++++++++++++-- net/bluetooth/hci_event.c | 6 ++++-- 2 files changed, 17 insertions(+), 4 deletions(-) --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -597,6 +597,15 @@ static int hci_dev_do_reset(struct hci_d =20 /* 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); =20 @@ -4056,12 +4065,14 @@ static void hci_cmd_work(struct work_str if (res < 0) __hci_cmd_sync_cancel(hdev, -res); =20 + 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); --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3766,16 +3766,18 @@ static inline void handle_cmd_cnt_and_ti { cancel_delayed_work(&hdev->cmd_timer); =20 + 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(); } =20 static u8 hci_cc_le_read_buffer_size_v2(struct hci_dev *hdev, void *data,