From nobody Thu Apr 2 11:46:35 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 5CB72C6FA92 for ; Mon, 26 Sep 2022 10:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234089AbiIZKN5 (ORCPT ); Mon, 26 Sep 2022 06:13:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235004AbiIZKNm (ORCPT ); Mon, 26 Sep 2022 06:13:42 -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 4DECBE69; Mon, 26 Sep 2022 03:13:41 -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 E02A960AF2; Mon, 26 Sep 2022 10:13:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2B52C433D7; Mon, 26 Sep 2022 10:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187220; bh=S/uIQBi13lJQnohuZqNlFk+LWnZqVLfvZQ856GUXAwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BaTbNCUYXFcZGuQK92BaFvV6v2/1xjHDDPYJk9F4ugADDs25pWfSgVIQHEXm3uK4X 8ZOjGFnm45IljSi4JIGUsSob6Wo3+PRuYDnyjNEVQXsracx6wxVVq5F0iHkdg2Cm5N Gc96Yfl2RywmKDmT7cwvgXP2TbNWzjRMFD4c7Z9E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Yingliang , Helge Deller , Sasha Levin Subject: [PATCH 4.9 01/30] parisc: ccio-dma: Add missing iounmap in error path in ccio_probe() Date: Mon, 26 Sep 2022 12:11:32 +0200 Message-Id: <20220926100736.214354283@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Yang Yingliang [ Upstream commit 38238be4e881a5d0abbe4872b4cd6ed790be06c8 ] Add missing iounmap() before return from ccio_probe(), if ccio_init_resourc= es() fails. Fixes: d46c742f827f ("parisc: ccio-dma: Handle kmalloc failure in ccio_init= _resources()") Signed-off-by: Yang Yingliang Signed-off-by: Helge Deller Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/parisc/ccio-dma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 633762f8d775..84a93ddcd57a 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -1569,6 +1569,7 @@ static int __init ccio_probe(struct parisc_device *de= v) ioc->ioc_regs =3D ioremap_nocache(dev->hpa.start, 4096); ccio_ioc_init(ioc); if (ccio_init_resources(ioc)) { + iounmap(ioc->ioc_regs); kfree(ioc); return -ENOMEM; } --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 339ADC6FA86 for ; Mon, 26 Sep 2022 10:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234497AbiIZKOD (ORCPT ); Mon, 26 Sep 2022 06:14:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235027AbiIZKNo (ORCPT ); Mon, 26 Sep 2022 06:13:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40126E3B; Mon, 26 Sep 2022 03:13: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 dfw.source.kernel.org (Postfix) with ESMTPS id CCF0F60AF0; Mon, 26 Sep 2022 10:13:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7064C433D6; Mon, 26 Sep 2022 10:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187223; bh=wYYg+ZsRnP0jNGIZ0QVKY3zQv/ltH8dLHcgdLcIHnVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RPlzx+RSClNETtC1O3LMXyoRsmL4FHF9xTGZiMHTHKJusxWShCRHDxHTCtW9phOHS ARN+j7WCKa9tcHj2wvl1f+hkaGzs5wigWU62ulmwj/6vJ9bvfE43kk0xszhc5qNjLf ytK1ChkoefwwlMy0+r+3oqkRXFQmEgVElTQ3YLCk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Metzmacher , Ronnie Sahlberg , "Paulo Alcantara (SUSE)" , Steve French Subject: [PATCH 4.9 02/30] cifs: dont send down the destination address to sendmsg for a SOCK_STREAM Date: Mon, 26 Sep 2022 12:11:33 +0200 Message-Id: <20220926100736.249258635@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Stefan Metzmacher commit 17d3df38dc5f4cec9b0ac6eb79c1859b6e2693a4 upstream. This is ignored anyway by the tcp layer. Signed-off-by: Stefan Metzmacher Cc: stable@vger.kernel.org Reviewed-by: Ronnie Sahlberg Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- fs/cifs/transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -140,8 +140,8 @@ smb_send_kvec(struct TCP_Server_Info *se =20 *sent =3D 0; =20 - smb_msg->msg_name =3D (struct sockaddr *) &server->dstaddr; - smb_msg->msg_namelen =3D sizeof(struct sockaddr); + smb_msg->msg_name =3D NULL; + smb_msg->msg_namelen =3D 0; smb_msg->msg_control =3D NULL; smb_msg->msg_controllen =3D 0; if (server->noblocksnd) From nobody Thu Apr 2 11:46:35 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 12EF3C32771 for ; Mon, 26 Sep 2022 10:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233443AbiIZKOS (ORCPT ); Mon, 26 Sep 2022 06:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235033AbiIZKNs (ORCPT ); Mon, 26 Sep 2022 06:13:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A582F73; Mon, 26 Sep 2022 03:13:47 -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 C878D60AF2; Mon, 26 Sep 2022 10:13:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7885C433D6; Mon, 26 Sep 2022 10:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187226; bh=De71Q6KPiXPBoR+9AleU9zxny28K3+huMQeadpr9NMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c/ysXU9bzhE8w4b8wPuYsJWOYqjJSf2/H2QPZyOq4bLCJmIc1dkmrSyjQqkrLwyiy AP7r0re+rrQbnsy8nqz/Et8UtDe9vTXxHcmhGjz7SY4kFau5KzrKF+UWIHUdtrYlRd bKtDbtMY1QCECXdsI8E8KKHMHwJKXi/2RQ2ToET0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Melissa Wen , Maxime Ripard , Sasha Levin Subject: [PATCH 4.9 03/30] drm/vc4: crtc: Use an union to store the page flip callback Date: Mon, 26 Sep 2022 12:11:34 +0200 Message-Id: <20220926100736.283415181@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Maxime Ripard [ Upstream commit 2523e9dcc3be91bf9fdc0d1e542557ca00bbef42 ] We'll need to extend the vc4_async_flip_state structure to rely on another callback implementation, so let's move the current one into a union. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-10-maxime@cerno.tech Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/gpu/drm/vc4/vc4_crtc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 51d34e7275ab..9d97f535a4d6 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -717,17 +717,17 @@ struct vc4_async_flip_state { struct drm_framebuffer *fb; struct drm_pending_vblank_event *event; =20 - struct vc4_seqno_cb cb; + union { + struct vc4_seqno_cb seqno; + } cb; }; =20 /* Called when the V3D execution for the BO being flipped to is done, so t= hat * we can actually update the plane's address to point to it. */ static void -vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) +vc4_async_page_flip_complete(struct vc4_async_flip_state *flip_state) { - struct vc4_async_flip_state *flip_state =3D - container_of(cb, struct vc4_async_flip_state, cb); struct drm_crtc *crtc =3D flip_state->crtc; struct drm_device *dev =3D crtc->dev; struct vc4_dev *vc4 =3D to_vc4_dev(dev); @@ -749,6 +749,14 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) up(&vc4->async_modeset); } =20 +static void vc4_async_page_flip_seqno_complete(struct vc4_seqno_cb *cb) +{ + struct vc4_async_flip_state *flip_state =3D + container_of(cb, struct vc4_async_flip_state, cb.seqno); + + vc4_async_page_flip_complete(flip_state); +} + /* Implements async (non-vblank-synced) page flips. * * The page flip ioctl needs to return immediately, so we grab the @@ -794,8 +802,8 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, drm_atomic_set_fb_for_plane(plane->state, fb); plane->fb =3D fb; =20 - vc4_queue_seqno_cb(dev, &flip_state->cb, bo->seqno, - vc4_async_page_flip_complete); + vc4_queue_seqno_cb(dev, &flip_state->cb.seqno, bo->seqno, + vc4_async_page_flip_seqno_complete); =20 /* Driver takes ownership of state on successful async commit. */ return 0; --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 E63F4C6FA86 for ; Mon, 26 Sep 2022 10:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235182AbiIZKUb (ORCPT ); Mon, 26 Sep 2022 06:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235147AbiIZKSM (ORCPT ); Mon, 26 Sep 2022 06:18:12 -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 2C2C53FA3F; Mon, 26 Sep 2022 03:15:15 -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 47AE6B80924; Mon, 26 Sep 2022 10:15:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BC24C433D6; Mon, 26 Sep 2022 10:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187312; bh=lacPAtZsEPiZpm46yptQlJb7OhqxDdXtZKNT0DH6wYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GrQmEAPw9BgBAhWrgXRJ6R41JBnXBbydc+dAFUwg6+UuPlTH2OMkz/QOT0cu8CnHe GofiqtMkSAWrmIiTi1Un9bUh75ozcKxr8df0XvJzCtKBBjEYdZL7UzV4gCYeczKh2Q pah/eRaguKe13dJTyEIqqfWSTIKWCdYBmW21+FsA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiang wangx , Helge Deller , Sasha Levin Subject: [PATCH 4.9 04/30] video: fbdev: skeletonfb: Fix syntax errors in comments Date: Mon, 26 Sep 2022 12:11:35 +0200 Message-Id: <20220926100736.313886468@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Xiang wangx [ Upstream commit fc378794a2f7a19cf26010dc33b89ba608d4c70f ] Delete the redundant word 'its'. Signed-off-by: Xiang wangx Signed-off-by: Helge Deller Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/video/fbdev/skeletonfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/skeletonfb.c b/drivers/video/fbdev/skeleto= nfb.c index f948baa16d82..254bb6e2187c 100644 --- a/drivers/video/fbdev/skeletonfb.c +++ b/drivers/video/fbdev/skeletonfb.c @@ -96,7 +96,7 @@ static struct fb_fix_screeninfo xxxfb_fix =3D { =20 /* * Modern graphical hardware not only supports pipelines but some=20 - * also support multiple monitors where each display can have its =20 + * also support multiple monitors where each display can have * its own unique data. In this case each display could be =20 * represented by a separate framebuffer device thus a separate=20 * struct fb_info. Now the struct xxx_par represents the graphics --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 CB54FC32771 for ; Mon, 26 Sep 2022 10:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234433AbiIZKO2 (ORCPT ); Mon, 26 Sep 2022 06:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiIZKNz (ORCPT ); Mon, 26 Sep 2022 06:13:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDB26DA7; Mon, 26 Sep 2022 03:13:53 -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 66ABE60AF2; Mon, 26 Sep 2022 10:13:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65ECEC433C1; Mon, 26 Sep 2022 10:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187232; bh=tiXH/T7g462YrC81TWBszoTWj9vCYXtfXO+RNyErlGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DNj81msI0hInpp7Q4bc3k1aPrLfd2jnYJaV+W19N8RsOlr3f8ckhvF6uvp3ei+Szn XIl/ou0/gNk3XKTbaZwZdhukgE1b/FUkRdysorwd0lDv9mVXzOBabKm1eBMsK18KVu oZ94JfFpMArd5G8kHL2BFxTY4k6w5ftrqTQFoynw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Petr Cvek , Helge Deller , Sasha Levin Subject: [PATCH 4.9 05/30] video: fbdev: intelfb: Use aperture size from pci_resource_len Date: Mon, 26 Sep 2022 12:11:36 +0200 Message-Id: <20220926100736.341936020@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Petr Cvek [ Upstream commit 25c9a15fb7bbfafb94dd3b4e3165c18b8e1bd039 ] Aperture size for i9x5 variants is determined from PCI base address. if (pci_resource_start(pdev, 2) & 0x08000000) *aperture_size =3D MB(128); ... This condition is incorrect as 128 MiB address can have the address set as 0x?8000000 or 0x?0000000. Also the code can be simplified to just use pci_resource_len(). The true settings of the aperture size is in the MSAC register, which could be used instead. However the value is used only as an info message, so it doesn't matter. Signed-off-by: Petr Cvek Signed-off-by: Helge Deller Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/video/fbdev/intelfb/intelfbhw.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/= intelfb/intelfbhw.c index d31ed4e2c46f..3aa93565e935 100644 --- a/drivers/video/fbdev/intelfb/intelfbhw.c +++ b/drivers/video/fbdev/intelfb/intelfbhw.c @@ -199,13 +199,11 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *a= perture_size, case PCI_DEVICE_ID_INTEL_945GME: case PCI_DEVICE_ID_INTEL_965G: case PCI_DEVICE_ID_INTEL_965GM: - /* 915, 945 and 965 chipsets support a 256MB aperture. - Aperture size is determined by inspected the - base address of the aperture. */ - if (pci_resource_start(pdev, 2) & 0x08000000) - *aperture_size =3D MB(128); - else - *aperture_size =3D MB(256); + /* + * 915, 945 and 965 chipsets support 64MB, 128MB or 256MB + * aperture. Determine size from PCI resource length. + */ + *aperture_size =3D pci_resource_len(pdev, 2); break; default: if ((tmp & INTEL_GMCH_MEM_MASK) =3D=3D INTEL_GMCH_MEM_64M) --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 EAC3EC32771 for ; Mon, 26 Sep 2022 10:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234350AbiIZKQ3 (ORCPT ); Mon, 26 Sep 2022 06:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235100AbiIZKPe (ORCPT ); Mon, 26 Sep 2022 06:15:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06CF748E9F; Mon, 26 Sep 2022 03:14: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 dfw.source.kernel.org (Postfix) with ESMTPS id A780960B60; Mon, 26 Sep 2022 10:14:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2904C433C1; Mon, 26 Sep 2022 10:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187266; bh=VttBdWDUBl9A3RqWXWoax22uYxYPC+6gtQNYnwCFaz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CiqA2Q5YJMuRcdHpfcKp3urIfflm4l0eNAg7TTFCGvIJijQlzAXQl+fIly3uQddno 9lrF+haniKQ9Tn6mpi7g8V1q6Cm0hkIN9mx0z3BKeYkzqAYMIZAGFzWHv5TYyQsPSX Wp1+wd9qXCm9ZUmbCjmf42d78sz2pDzqUWhJOrCg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hyunwoo Kim , Helge Deller , Sasha Levin Subject: [PATCH 4.9 06/30] video: fbdev: pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write Date: Mon, 26 Sep 2022 12:11:37 +0200 Message-Id: <20220926100736.370084852@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Hyunwoo Kim [ Upstream commit a09d2d00af53b43c6f11e6ab3cb58443c2cac8a7 ] In pxa3xx_gcu_write, a count parameter of type size_t is passed to words of type int. Then, copy_from_user() may cause a heap overflow because it is u= sed as the third argument of copy_from_user(). Signed-off-by: Hyunwoo Kim Signed-off-by: Helge Deller Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/video/fbdev/pxa3xx-gcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-= gcu.c index 184773b6b9e4..2cca4b763d8d 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -391,7 +391,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff, struct pxa3xx_gcu_batch *buffer; struct pxa3xx_gcu_priv *priv =3D to_pxa3xx_gcu_priv(file); =20 - int words =3D count / 4; + size_t words =3D count / 4; =20 /* Does not need to be atomic. There's a lock in user space, * but anyhow, this is just for statistics. */ --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 C64D6C07E9D for ; Mon, 26 Sep 2022 10:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234864AbiIZKRk (ORCPT ); Mon, 26 Sep 2022 06:17:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234695AbiIZKQx (ORCPT ); Mon, 26 Sep 2022 06:16:53 -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 41A2F15A18; Mon, 26 Sep 2022 03:14:51 -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 207A460AF0; Mon, 26 Sep 2022 10:14:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 331DAC433B5; Mon, 26 Sep 2022 10:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187290; bh=L8RVp5OXmyoqFtSIWnGjdQGw8DF4M9iNlVUBWEbtTUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ypnT/ljjJEaPObb3dsPZrBmsZ336uxuBTtXphZwoImg4NU22yuLPjq7h6OKyetXkL jYngcsjrEZhMmTM1G0y4SNB86IVJekDhbvNZuJp2Jj8Mz2wwzTaBTkCsOPVN5pcINm 336dUl6r47J8eVe4DC2MRZJvCYDaU8rs0nAOFa84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yihao Han , Hans de Goede , Helge Deller , Sasha Levin Subject: [PATCH 4.9 07/30] video: fbdev: simplefb: Check before clk_put() not needed Date: Mon, 26 Sep 2022 12:11:38 +0200 Message-Id: <20220926100736.416842592@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Yihao Han [ Upstream commit 5491424d17bdeb7b7852a59367858251783f8398 ] clk_put() already checks the clk ptr using !clk and IS_ERR() so there is no need to check it again before calling it. Signed-off-by: Yihao Han Reviewed-by: Hans de Goede Signed-off-by: Helge Deller Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/video/fbdev/simplefb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 61f799a515dc..1efdbbc20f99 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -231,8 +231,7 @@ static int simplefb_clocks_init(struct simplefb_par *pa= r, if (IS_ERR(clock)) { if (PTR_ERR(clock) =3D=3D -EPROBE_DEFER) { while (--i >=3D 0) { - if (par->clks[i]) - clk_put(par->clks[i]); + clk_put(par->clks[i]); } kfree(par->clks); return -EPROBE_DEFER; --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 B1F79C6FA83 for ; Mon, 26 Sep 2022 10:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235154AbiIZKTs (ORCPT ); Mon, 26 Sep 2022 06:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234070AbiIZKRu (ORCPT ); Mon, 26 Sep 2022 06:17:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40A8248F6; Mon, 26 Sep 2022 03:15: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 ams.source.kernel.org (Postfix) with ESMTPS id C358CB80915; Mon, 26 Sep 2022 10:14:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BBE6C433C1; Mon, 26 Sep 2022 10:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187293; bh=s9Ol33kpSrjmzFWdc4sW7eWoQqLfe0AJTiY9sp9s7jY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qfuqBeFVMZUATw87CLPFpdP8NWqYfmn68HD3OVurl4MIp24MQypeF+YDNmULEL3D7 zmecIo5Z1wp0eT9Ygep9KTH1THkjOTbUJ2NHx+lQtCHO2i/rFmB8xUVRSEzd1JV5fL EkL095VdKZ7/7YeLFx05gVbQF8raptrfs0u8I9/M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.9 08/30] mips: lantiq: falcon: Fix refcount leak bug in sysctrl Date: Mon, 26 Sep 2022 12:11:39 +0200 Message-Id: <20220926100736.453859021@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Liang He [ Upstream commit 72a2af539fff975caadd9a4db3f99963569bd9c9 ] In ltq_soc_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- arch/mips/lantiq/falcon/sysctrl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/lantiq/falcon/sysctrl.c b/arch/mips/lantiq/falcon/sy= sctrl.c index 714d92659489..665739bd4190 100644 --- a/arch/mips/lantiq/falcon/sysctrl.c +++ b/arch/mips/lantiq/falcon/sysctrl.c @@ -210,6 +210,12 @@ void __init ltq_soc_init(void) of_address_to_resource(np_sysgpe, 0, &res_sys[2])) panic("Failed to get core resources"); =20 + of_node_put(np_status); + of_node_put(np_ebu); + of_node_put(np_sys1); + of_node_put(np_syseth); + of_node_put(np_sysgpe); + if ((request_mem_region(res_status.start, resource_size(&res_status), res_status.name) < 0) || (request_mem_region(res_ebu.start, resource_size(&res_ebu), --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 42DCAC6FA83 for ; Mon, 26 Sep 2022 10:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235086AbiIZKTi (ORCPT ); Mon, 26 Sep 2022 06:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235133AbiIZKRq (ORCPT ); Mon, 26 Sep 2022 06:17:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DCA53F31B; Mon, 26 Sep 2022 03:15: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 ams.source.kernel.org (Postfix) with ESMTPS id 043A4B80918; Mon, 26 Sep 2022 10:14:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DFB0C433D7; Mon, 26 Sep 2022 10:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187296; bh=lxvNlYhAytKwxZp4jMyRmt1FmbsAxMgDwEsNjVDEVwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gS5wrcZl/ITiqShZSMX0RdlS4mjelyqQPnuHmHTbQOGJOuH2B6k5XPrmjU4lqJb24 pIB9mZSPEQIeByYwyybUwn6bBlSIzNICRj4kQaeKj8m8ObyKhrTz+24WQoJXeCtj2j 4qyXmt7vZzKFONvkK7kcDNEvpviNkCNYxWM1SJ34= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.9 09/30] mips: lantiq: xway: Fix refcount leak bug in sysctrl Date: Mon, 26 Sep 2022 12:11:40 +0200 Message-Id: <20220926100736.491653664@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Liang He [ Upstream commit 76695592711ef1e215cc24ed3e1cd857d7fc3098 ] In ltq_soc_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- arch/mips/lantiq/xway/sysctrl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctr= l.c index dd7c36a193e3..6891456a7603 100644 --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c @@ -457,6 +457,10 @@ void __init ltq_soc_init(void) of_address_to_resource(np_ebu, 0, &res_ebu)) panic("Failed to get core resources"); =20 + of_node_put(np_pmu); + of_node_put(np_cgu); + of_node_put(np_ebu); + if (!request_mem_region(res_pmu.start, resource_size(&res_pmu), res_pmu.name) || !request_mem_region(res_cgu.start, resource_size(&res_cgu), --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 62EB8C07E9D for ; Mon, 26 Sep 2022 10:18:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234743AbiIZKSN (ORCPT ); Mon, 26 Sep 2022 06:18:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234891AbiIZKRY (ORCPT ); Mon, 26 Sep 2022 06:17:24 -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 45B7836DF8; Mon, 26 Sep 2022 03:15:04 -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 101D5B80925; Mon, 26 Sep 2022 10:15:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6797FC433C1; Mon, 26 Sep 2022 10:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187299; bh=qKqAQRD6cxz9W/PwVbpSTLflZheubG7vtgJbTS+PnZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vjOCGC/lTtLhVZJDmT6mN1hB4fEIFt+qPy/lkXkaRYtBP9kJXI2yisDR6BqkvxIj0 07V8opfoY3NEfltmWK9eM4H4F+J1G93M7uvmhZ/54JBkRy+uprv0d99UzlAlQvWf9R 4s56HroC5aGTCNTTfm2zOb7zqLnWFwRHzmnO/540= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.9 10/30] mips/pic32/pic32mzda: Fix refcount leak bugs Date: Mon, 26 Sep 2022 12:11:41 +0200 Message-Id: <20220926100736.537955607@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Liang He [ Upstream commit eb9e9bc4fa5fb489c92ec588b3fb35f042ba6d86 ] of_find_matching_node(), of_find_compatible_node() and of_find_node_by_path() will return node pointers with refcout incremented. We should call of_node_put() when they are not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- arch/mips/pic32/pic32mzda/init.c | 7 ++++++- arch/mips/pic32/pic32mzda/time.c | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/mips/pic32/pic32mzda/init.c b/arch/mips/pic32/pic32mzda/i= nit.c index 406c6c5cec29..f8985d4573e6 100644 --- a/arch/mips/pic32/pic32mzda/init.c +++ b/arch/mips/pic32/pic32mzda/init.c @@ -131,13 +131,18 @@ static int __init pic32_of_prepare_platform_data(stru= ct of_dev_auxdata *lookup) np =3D of_find_compatible_node(NULL, NULL, lookup->compatible); if (np) { lookup->name =3D (char *)np->name; - if (lookup->phys_addr) + if (lookup->phys_addr) { + of_node_put(np); continue; + } if (!of_address_to_resource(np, 0, &res)) lookup->phys_addr =3D res.start; + of_node_put(np); } } =20 + of_node_put(root); + return 0; } =20 diff --git a/arch/mips/pic32/pic32mzda/time.c b/arch/mips/pic32/pic32mzda/t= ime.c index 62a0a78b6c64..bfafe241c1b5 100644 --- a/arch/mips/pic32/pic32mzda/time.c +++ b/arch/mips/pic32/pic32mzda/time.c @@ -40,6 +40,9 @@ static unsigned int pic32_xlate_core_timer_irq(void) goto default_map; =20 irq =3D irq_of_parse_and_map(node, 0); + + of_node_put(node); + if (!irq) goto default_map; =20 --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 2CAC0C6FA86 for ; Mon, 26 Sep 2022 10:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235040AbiIZKT2 (ORCPT ); Mon, 26 Sep 2022 06:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235131AbiIZKRp (ORCPT ); Mon, 26 Sep 2022 06:17:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5AFA3F32F; Mon, 26 Sep 2022 03:15:11 -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 8BB3060BBF; Mon, 26 Sep 2022 10:15:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92DFEC433D6; Mon, 26 Sep 2022 10:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187303; bh=rrDhxUZ7JRFCLEk5L6AChGIzQ8M4z5nHZqc1JCT5t+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jY+Apsp7oerkpNar9f91JsugwzLwGz9u5c/tWZBWv3/OCCNg5snwsIHiHcJtwwKE0 2CGCluPoXJSL6pqqoqEKMDpdGifj/LR2ubkNIqOr5vVpsg9dEraAA00eHzdWzMmjmE be1hkTTM4cbg+CrQ/QbXpqS0MpbPjKZhlDFBlRtc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.9 11/30] mips: lantiq: Add missing of_node_put() in irq.c Date: Mon, 26 Sep 2022 12:11:42 +0200 Message-Id: <20220926100736.579467679@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Liang He [ Upstream commit 3748d2185ac4c2c6f80989672253aad909ecaf95 ] In icu_of_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- arch/mips/lantiq/irq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c index e64f678ca12c..e29dc58271b2 100644 --- a/arch/mips/lantiq/irq.c +++ b/arch/mips/lantiq/irq.c @@ -460,6 +460,7 @@ int __init icu_of_init(struct device_node *node, struct= device_node *parent) if (!ltq_eiu_membase) panic("Failed to remap eiu memory"); } + of_node_put(eiu_node); =20 return 0; } --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 6AF36C32771 for ; Mon, 26 Sep 2022 10:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234794AbiIZKTX (ORCPT ); Mon, 26 Sep 2022 06:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235119AbiIZKRh (ORCPT ); Mon, 26 Sep 2022 06:17:37 -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 5DCE83F31C; Mon, 26 Sep 2022 03:15: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 66CFD60BFE; Mon, 26 Sep 2022 10:15:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58BD5C433D6; Mon, 26 Sep 2022 10:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187305; bh=KZ2/UYyi2UeRP/7S3TXv7BylaBfnuZkXyL4LhPepjYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EHk3iea5mR1aTRI3kIjTSG75Rx+/Un7FdOUtFRHAH6tW8RV5KjhFpnLthfi4bLFZh CXZ2ZAI8PeInlqTEkNrpUMptYEoL2Ja1fu4DVuxOw6l3Y4BRc4oQ7BC20A78imknJ5 EZoYOjya5pcKK41gQ0i/e5CxRnalXEOqNsjdihwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Viresh Kumar , Arnd Bergmann , Sasha Levin Subject: [PATCH 4.9 12/30] arm: mach-spear: Add missing of_node_put() in time.c Date: Mon, 26 Sep 2022 12:11:43 +0200 Message-Id: <20220926100736.617492501@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Liang He [ Upstream commit 2c629dd2d14fd7f64a553f809eda6d0b3a4f615a ] In spear_setup_of_timer(), of_find_matching_node() will return a node pointer with refcount incrementd. We should use of_node_put() in each fail path or when it is not used anymore. Signed-off-by: Liang He Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220616093027.3984903-1-windhl@126.com' Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- arch/arm/mach-spear/time.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c index aaaa6781b9fe..57b77c7effa9 100644 --- a/arch/arm/mach-spear/time.c +++ b/arch/arm/mach-spear/time.c @@ -223,13 +223,13 @@ void __init spear_setup_of_timer(void) irq =3D irq_of_parse_and_map(np, 0); if (!irq) { pr_err("%s: No irq passed for timer via DT\n", __func__); - return; + goto err_put_np; } =20 gpt_base =3D of_iomap(np, 0); if (!gpt_base) { pr_err("%s: of iomap failed\n", __func__); - return; + goto err_put_np; } =20 gpt_clk =3D clk_get_sys("gpt0", NULL); @@ -244,6 +244,8 @@ void __init spear_setup_of_timer(void) goto err_prepare_enable_clk; } =20 + of_node_put(np); + spear_clockevent_init(irq); spear_clocksource_init(); =20 @@ -253,4 +255,6 @@ void __init spear_setup_of_timer(void) clk_put(gpt_clk); err_iomap: iounmap(gpt_base); +err_put_np: + of_node_put(np); } --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 DA67EC32771 for ; Mon, 26 Sep 2022 10:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235175AbiIZKUR (ORCPT ); Mon, 26 Sep 2022 06:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234779AbiIZKSK (ORCPT ); Mon, 26 Sep 2022 06:18:10 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3503FA39; Mon, 26 Sep 2022 03:15:15 -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 sin.source.kernel.org (Postfix) with ESMTPS id 7589BCE10E9; Mon, 26 Sep 2022 10:15:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C465C433C1; Mon, 26 Sep 2022 10:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187308; bh=wpR2uPM5j62f5gxaMpy1qf7y9e1hJhxI6jbW71SU2yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kuHhZHA5syHALewkg+YzIlh/s2sb/wdRFga2rP/TS9En/ZYn2E3Kt+74DJkYTAnw6 B6sZvhAeYGAuaAPZ+rmEmd2dvW+uQ5ODGMI6RYwH5Kz8N4t8lIm2ZqciHpAYUelihZ Jcc+0muTEIt3N/emGwn5BcRQZSmdqd67tHMZqJCA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+f9acff9bf08a845f225d@syzkaller.appspotmail.com, Johannes Berg , Siddh Raman Pant , Johannes Berg , Sasha Levin Subject: [PATCH 4.9 13/30] wifi: mac80211: Fix UAF in ieee80211_scan_rx() Date: Mon, 26 Sep 2022 12:11:44 +0200 Message-Id: <20220926100736.646872576@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Siddh Raman Pant [ Upstream commit 60deb9f10eec5c6a20252ed36238b55d8b614a2c ] ieee80211_scan_rx() tries to access scan_req->flags after a null check, but a UAF is observed when the scan is completed and __ieee80211_scan_completed() executes, which then calls cfg80211_scan_done() leading to the freeing of scan_req. Since scan_req is rcu_dereference()'d, prevent the racing in __ieee80211_scan_completed() by ensuring that from mac80211's POV it is no longer accessed from an RCU read critical section before we call cfg80211_scan_done(). Cc: stable@vger.kernel.org Link: https://syzkaller.appspot.com/bug?extid=3Df9acff9bf08a845f225d Reported-by: syzbot+f9acff9bf08a845f225d@syzkaller.appspotmail.com Suggested-by: Johannes Berg Signed-off-by: Siddh Raman Pant Link: https://lore.kernel.org/r/20220819200340.34826-1-code@siddh.me Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- net/mac80211/scan.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 701adcb9262e..a73c362a0182 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -385,10 +385,6 @@ static void __ieee80211_scan_completed(struct ieee8021= 1_hw *hw, bool aborted) scan_req =3D rcu_dereference_protected(local->scan_req, lockdep_is_held(&local->mtx)); =20 - if (scan_req !=3D local->int_scan_req) { - local->scan_info.aborted =3D aborted; - cfg80211_scan_done(scan_req, &local->scan_info); - } RCU_INIT_POINTER(local->scan_req, NULL); =20 scan_sdata =3D rcu_dereference_protected(local->scan_sdata, @@ -398,6 +394,13 @@ static void __ieee80211_scan_completed(struct ieee8021= 1_hw *hw, bool aborted) local->scanning =3D 0; local->scan_chandef.chan =3D NULL; =20 + synchronize_rcu(); + + if (scan_req !=3D local->int_scan_req) { + local->scan_info.aborted =3D aborted; + cfg80211_scan_done(scan_req, &local->scan_info); + } + /* Set power back to normal operating levels. */ ieee80211_hw_config(local, 0); =20 --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 D99CDC32771 for ; Mon, 26 Sep 2022 10:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234710AbiIZKOg (ORCPT ); Mon, 26 Sep 2022 06:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234295AbiIZKOC (ORCPT ); Mon, 26 Sep 2022 06:14:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7E4D12ABE; Mon, 26 Sep 2022 03:13:59 -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 32C39B80915; Mon, 26 Sep 2022 10:13:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 675B4C433D7; Mon, 26 Sep 2022 10:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187235; bh=nvk05x6gK5D03TV1CBcBORU3mHf59eHcn45/Ej8lgqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ehp2iS1tFXbEwA8mjDLlstZQoXCHnFhTGyzxu/fC2WHSI6s2+aYGd+Qq6fKO3Mgem h3P5ZigAixXi20XEhSeyf7rpXIQ72/jecOUtIdBEq9V5JtNv+b+ByKN7/RUYDWNq6c SUJ3BFEH6KUDJpM53HtO4tw1ug6Zbe7jd03t4pHs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Bagas Sanjaya , Alan Stern Subject: [PATCH 4.9 14/30] USB: core: Fix RST error in hub.c Date: Mon, 26 Sep 2022 12:11:45 +0200 Message-Id: <20220926100736.675981572@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Alan Stern commit 766a96dc558385be735a370db867e302c8f22153 upstream. A recent commit added an invalid RST expression to a kerneldoc comment in hub.c. The fix is trivial. Fixes: 9c6d778800b9 ("USB: core: Prevent nested device-reset calls") Cc: Reported-by: Stephen Rothwell Reviewed-by: Bagas Sanjaya Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YxDDcsLtRZ7c20pq@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/usb/core/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5702,7 +5702,7 @@ re_enumerate_no_bos: * * Return: The same as for usb_reset_and_verify_device(). * However, if a reset is already in progress (for instance, if a - * driver doesn't have pre_ or post_reset() callbacks, and while + * driver doesn't have pre_reset() or post_reset() callbacks, and while * being unbound or re-bound during the ongoing reset its disconnect() * or probe() routine tries to perform a second, nested reset), the * routine returns -EINPROGRESS. From nobody Thu Apr 2 11:46:35 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 C06B5C07E9D for ; Mon, 26 Sep 2022 10:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235030AbiIZKOw (ORCPT ); Mon, 26 Sep 2022 06:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234953AbiIZKOX (ORCPT ); Mon, 26 Sep 2022 06:14:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 143712DD2; Mon, 26 Sep 2022 03:14:01 -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 24347B8091F; Mon, 26 Sep 2022 10:14:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70D3DC433B5; Mon, 26 Sep 2022 10:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187238; bh=+HlodehJsQlscye+xQLIBUBOel0TVWnEATrYFU9oSTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X2FAfyLog4v+mAX7jtYnFDP6zzjnASL5v6toexHoayHhhjvbnYX28HtEnx6VJGbzs ytsjOF9UwTjtgGQdUZhV082aBA0RPOOIfiR7i6zNMInlNNhriA0juSZrweOgMkDYKW 5/8avDWpJvleEHJR4j6m6fJKD/QcAqUf4P7ohbBA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mohan Kumar , Takashi Iwai Subject: [PATCH 4.9 15/30] ALSA: hda/tegra: set depop delay for tegra Date: Mon, 26 Sep 2022 12:11:46 +0200 Message-Id: <20220926100736.704387152@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Mohan Kumar commit 3c4d8c24fb6c44f426e447b04800b0ed61a7b5ae upstream. Reduce the suspend time by setting depop delay to 10ms for tegra. Signed-off-by: Mohan Kumar Cc: Link: https://lore.kernel.org/r/20220913053641.23299-1-mkumard@nvidia.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- sound/pci/hda/patch_hdmi.c | 1 + 1 file changed, 1 insertion(+) --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -3247,6 +3247,7 @@ static int patch_tegra_hdmi(struct hda_c if (err) return err; =20 + codec->depop_delay =3D 10; codec->patch_ops.build_pcms =3D tegra_hdmi_build_pcms; spec =3D codec->spec; spec->chmap.ops.chmap_cea_alloc_validate_get_type =3D From nobody Thu Apr 2 11:46:35 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 2CDBBC32771 for ; Mon, 26 Sep 2022 10:15:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235039AbiIZKPF (ORCPT ); Mon, 26 Sep 2022 06:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234883AbiIZKOf (ORCPT ); Mon, 26 Sep 2022 06:14:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50F5A2F01A; Mon, 26 Sep 2022 03:14:04 -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 54CBCB80918; Mon, 26 Sep 2022 10:14:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AE25C433D7; Mon, 26 Sep 2022 10:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187242; bh=CQYRF5PKqISVOE044XnvUyy2m8Idzz8OYW2ENNv+lu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t+bUXrgBKi+D2bnqocU9GzLo7WS4/11vmITcdIGVuW9jtci3R0kxJRAqH+x9q7qqe +kJ5THqxrWcMpxMpLIXTxA0B6JaGPM6J9DrNkJJEGjKKqAW9mbc3kv0HbtI57EKVme TOrCWOVKm6WrtfMaQAaGsjCfrTkItWTB4PXyHLA0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai Vehmanen , Takashi Iwai Subject: [PATCH 4.9 16/30] ALSA: hda: add Intel 5 Series / 3400 PCI DID Date: Mon, 26 Sep 2022 12:11:47 +0200 Message-Id: <20220926100736.736591699@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Kai Vehmanen commit 4d40ceef4745536289012670103c59264e0fb3ec upstream. Handle 0x3b57 variant with same AZX_DCAPS_INTEL_PCH_NOPM capabilities as 0x3b56. In practise this allow use of HDMI/DP display audio via i915. BugLink: https://gitlab.freedesktop.org/drm/intel/-/issues/2751 Signed-off-by: Kai Vehmanen Cc: Link: https://lore.kernel.org/r/20220912183716.2126312-1-kai.vehmanen@linux= .intel.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- sound/pci/hda/hda_intel.c | 2 ++ 1 file changed, 2 insertions(+) --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2316,6 +2316,8 @@ static const struct pci_device_id azx_id /* 5 Series/3400 */ { PCI_DEVICE(0x8086, 0x3b56), .driver_data =3D AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, + { PCI_DEVICE(0x8086, 0x3b57), + .driver_data =3D AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, /* Poulsbo */ { PCI_DEVICE(0x8086, 0x811b), .driver_data =3D AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE }, From nobody Thu Apr 2 11:46:35 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 3B9E0C32771 for ; Mon, 26 Sep 2022 10:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233582AbiIZKPU (ORCPT ); Mon, 26 Sep 2022 06:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234495AbiIZKOp (ORCPT ); Mon, 26 Sep 2022 06:14:45 -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 420DD474D7; Mon, 26 Sep 2022 03:14:08 -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 501EBB80925; Mon, 26 Sep 2022 10:14:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C66AC433D6; Mon, 26 Sep 2022 10:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187245; bh=LxUOv1BX67hgdtLI6gm3VnbJnfvixz22w9sx+VWQYrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hG3UYtLOrQvT2/l/rBGGgJ/XZpgsbSa6l2elg6zqlljFTBrFcLKIXxbEx/GdjInZE exevv45UyvOSkVCn8BSg7ykuNZiUQFtqFgkb6fpbsLcytfxiJ1bcHMaqTWQuBJ3WeS aKhVkKHFit9Y+HkA8kigK2z0TjvW4pi1w3EUHJCI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, syzbot+81684812ea68216e08c5@syzkaller.appspotmail.com, Muchun Song , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Chao Yu , David Rientjes , Vlastimil Babka Subject: [PATCH 4.9 17/30] mm/slub: fix to return errno if kmalloc() fails Date: Mon, 26 Sep 2022 12:11:48 +0200 Message-Id: <20220926100736.769408253@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Chao Yu commit 7e9c323c52b379d261a72dc7bd38120a761a93cd upstream. In create_unique_id(), kmalloc(, GFP_KERNEL) can fail due to out-of-memory, if it fails, return errno correctly rather than triggering panic via BUG_ON(); kernel BUG at mm/slub.c:5893! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP Call trace: sysfs_slab_add+0x258/0x260 mm/slub.c:5973 __kmem_cache_create+0x60/0x118 mm/slub.c:4899 create_cache mm/slab_common.c:229 [inline] kmem_cache_create_usercopy+0x19c/0x31c mm/slab_common.c:335 kmem_cache_create+0x1c/0x28 mm/slab_common.c:390 f2fs_kmem_cache_create fs/f2fs/f2fs.h:2766 [inline] f2fs_init_xattr_caches+0x78/0xb4 fs/f2fs/xattr.c:808 f2fs_fill_super+0x1050/0x1e0c fs/f2fs/super.c:4149 mount_bdev+0x1b8/0x210 fs/super.c:1400 f2fs_mount+0x44/0x58 fs/f2fs/super.c:4512 legacy_get_tree+0x30/0x74 fs/fs_context.c:610 vfs_get_tree+0x40/0x140 fs/super.c:1530 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x914 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __arm64_sys_mount+0x2f8/0x408 fs/namespace.c:3568 Cc: Fixes: 81819f0fc8285 ("SLUB core") Reported-by: syzbot+81684812ea68216e08c5@syzkaller.appspotmail.com Reviewed-by: Muchun Song Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Chao Yu Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- mm/slub.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/mm/slub.c +++ b/mm/slub.c @@ -5601,7 +5601,8 @@ static char *create_unique_id(struct kme char *name =3D kmalloc(ID_STR_LENGTH, GFP_KERNEL); char *p =3D name; =20 - BUG_ON(!name); + if (!name) + return ERR_PTR(-ENOMEM); =20 *p++ =3D ':'; /* @@ -5649,6 +5650,8 @@ static int sysfs_slab_add(struct kmem_ca * for the symlinks. */ name =3D create_unique_id(s); + if (IS_ERR(name)) + return PTR_ERR(name); } =20 s->kobj.kset =3D cache_kset(s); From nobody Thu Apr 2 11:46:35 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 76303C32771 for ; Mon, 26 Sep 2022 10:15:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234125AbiIZKP1 (ORCPT ); Mon, 26 Sep 2022 06:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233933AbiIZKPA (ORCPT ); Mon, 26 Sep 2022 06:15:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F02F474EF; Mon, 26 Sep 2022 03:14:10 -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 29520B80915; Mon, 26 Sep 2022 10:14:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C0CEC433D6; Mon, 26 Sep 2022 10:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187247; bh=DuCVXBycHtx00cWzGmjUh6h/tEedhC39HX32If+p02g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IDwFftUKCf1yUtpnl+JM8puFWgMvc1FEV7D7CMFYiQdruMNhA8OhM7cpfq+x/VOwc ofKvwES+athermJfvTrFDDY+F8uxh+/lzoIFnUpNdBuxaWMAYNosgsvbnsSdaIHqcy 4lT87hZZfwfBnfYT0BWe3cet2mYHEt4AwLTXwvxo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Igor Ryzhov , Florian Westphal , Sasha Levin Subject: [PATCH 4.9 18/30] netfilter: nf_conntrack_sip: fix ct_sip_walk_headers Date: Mon, 26 Sep 2022 12:11:49 +0200 Message-Id: <20220926100736.811484041@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Igor Ryzhov [ Upstream commit 39aebedeaaa95757f5c1f2ddb5f43fdddbf478ca ] ct_sip_next_header and ct_sip_get_header return an absolute value of matchoff, not a shift from current dataoff. So dataoff should be assigned matchoff, not incremented by it. This issue can be seen in the scenario when there are multiple Contact headers and the first one is using a hostname and other headers use IP addresses. In this case, ct_sip_walk_headers will work as follows: The first ct_sip_get_header call to will find the first Contact header but will return -1 as the header uses a hostname. But matchoff will be changed to the offset of this header. After that, dataoff should be set to matchoff, so that the next ct_sip_get_header call find the next Contact header. But instead of assigning dataoff to matchoff, it is incremented by it, which is not correct, as matchoff is an absolute value of the offset. So on the next call to the ct_sip_get_header, dataoff will be incorrect, and the next Contact header may not be found at all. Fixes: 05e3ced297fe ("[NETFILTER]: nf_conntrack_sip: introduce SIP-URI pars= ing helper") Signed-off-by: Igor Ryzhov Signed-off-by: Florian Westphal Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- net/netfilter/nf_conntrack_sip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_= sip.c index 3a8dc39a9116..7dc23df7b4e3 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c @@ -471,7 +471,7 @@ static int ct_sip_walk_headers(const struct nf_conn *ct= , const char *dptr, return ret; if (ret =3D=3D 0) break; - dataoff +=3D *matchoff; + dataoff =3D *matchoff; } *in_header =3D 0; } @@ -483,7 +483,7 @@ static int ct_sip_walk_headers(const struct nf_conn *ct= , const char *dptr, break; if (ret =3D=3D 0) return ret; - dataoff +=3D *matchoff; + dataoff =3D *matchoff; } =20 if (in_header) --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 C568DC32771 for ; Mon, 26 Sep 2022 10:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234663AbiIZKPf (ORCPT ); Mon, 26 Sep 2022 06:15:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234808AbiIZKPC (ORCPT ); Mon, 26 Sep 2022 06:15:02 -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 375D7476D9; Mon, 26 Sep 2022 03:14: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 6BCF160BFE; Mon, 26 Sep 2022 10:14:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BD64C433D7; Mon, 26 Sep 2022 10:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187250; bh=bbnmpylZreDUTDme6h0ibI/W2LjDmiXSyGclQyVmXck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SHqDqZw4g8cNQIMprKGVU/96P6YIDEfMbmx/9f28ZYY+o/dZ+yZgNSu0qbXCyMuGQ UGTZOufmt/FX1taF4XcVNI6InvCYmgxL6uGiHh0dhBbQ67f1gB7ytoHpm6+3GnlA6i B03Y62XSzt4r6TDfulyh46qvP17qe7ES/3yQgJc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Leadbeater , Florian Westphal , Sasha Levin Subject: [PATCH 4.9 19/30] netfilter: nf_conntrack_irc: Tighten matching on DCC message Date: Mon, 26 Sep 2022 12:11:50 +0200 Message-Id: <20220926100736.846278933@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: David Leadbeater [ Upstream commit e8d5dfd1d8747b56077d02664a8838c71ced948e ] CTCP messages should only be at the start of an IRC message, not anywhere within it. While the helper only decodes packes in the ORIGINAL direction, its possible to make a client send a CTCP message back by empedding one into a PING request. As-is, thats enough to make the helper believe that it saw a CTCP message. Fixes: 869f37d8e48f ("[NETFILTER]: nf_conntrack/nf_nat: add IRC helper port= ") Signed-off-by: David Leadbeater Signed-off-by: Florian Westphal Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- net/netfilter/nf_conntrack_irc.c | 34 ++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_= irc.c index c6a8bdc3a226..5d630288f86c 100644 --- a/net/netfilter/nf_conntrack_irc.c +++ b/net/netfilter/nf_conntrack_irc.c @@ -150,15 +150,37 @@ static int help(struct sk_buff *skb, unsigned int pro= toff, data =3D ib_ptr; data_limit =3D ib_ptr + skb->len - dataoff; =20 - /* strlen("\1DCC SENT t AAAAAAAA P\1\n")=3D24 - * 5+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=3D14 */ - while (data < data_limit - (19 + MINMATCHLEN)) { - if (memcmp(data, "\1DCC ", 5)) { + /* Skip any whitespace */ + while (data < data_limit - 10) { + if (*data =3D=3D ' ' || *data =3D=3D '\r' || *data =3D=3D '\n') + data++; + else + break; + } + + /* strlen("PRIVMSG x ")=3D10 */ + if (data < data_limit - 10) { + if (strncasecmp("PRIVMSG ", data, 8)) + goto out; + data +=3D 8; + } + + /* strlen(" :\1DCC SENT t AAAAAAAA P\1\n")=3D26 + * 7+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=3D26 + */ + while (data < data_limit - (21 + MINMATCHLEN)) { + /* Find first " :", the start of message */ + if (memcmp(data, " :", 2)) { data++; continue; } + data +=3D 2; + + /* then check that place only for the DCC command */ + if (memcmp(data, "\1DCC ", 5)) + goto out; data +=3D 5; - /* we have at least (19+MINMATCHLEN)-5 bytes valid data left */ + /* we have at least (21+MINMATCHLEN)-(2+5) bytes valid data left */ =20 iph =3D ip_hdr(skb); pr_debug("DCC found in master %pI4:%u %pI4:%u\n", @@ -174,7 +196,7 @@ static int help(struct sk_buff *skb, unsigned int proto= ff, pr_debug("DCC %s detected\n", dccprotos[i]); =20 /* we have at least - * (19+MINMATCHLEN)-5-dccprotos[i].matchlen bytes valid + * (21+MINMATCHLEN)-7-dccprotos[i].matchlen bytes valid * data left (=3D=3D 14/13 bytes) */ if (parse_dcc(data, data_limit, &dcc_ip, &dcc_port, &addr_beg_p, &addr_end_p)) { --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 022DDC6FA83 for ; Mon, 26 Sep 2022 10:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235102AbiIZKPv (ORCPT ); Mon, 26 Sep 2022 06:15:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235004AbiIZKPI (ORCPT ); Mon, 26 Sep 2022 06:15:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8508B47B9B; Mon, 26 Sep 2022 03:14: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 ams.source.kernel.org (Postfix) with ESMTPS id 57607B80918; Mon, 26 Sep 2022 10:14:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85F6CC433D6; Mon, 26 Sep 2022 10:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187254; bh=ifI8ILlDcfdr/lMcjAqelB1TbPdmRi3UrdXfsGepMJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZUYfH0Rxiv9J2fnkTc8B1SJGX8zGgIcUxrxjC/kdB21Eyt1k0N4ZmI5S+kEY3xp22 C2v5a6JCK5aPywT+/FzaI7uMJmihl0IeDwGwbTMEzm6OWcv2XsAHf3XL9dWviX+aTH E5VlmIm8YfyHIyuQki3MWp+3S2N+qQY4iwX0JJMo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lu Wei , Eric Dumazet , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 20/30] ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header Date: Mon, 26 Sep 2022 12:11:51 +0200 Message-Id: <20220926100736.883102343@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Lu Wei [ Upstream commit 81225b2ea161af48e093f58e8dfee6d705b16af4 ] If an AF_PACKET socket is used to send packets through ipvlan and the default xmit function of the AF_PACKET socket is changed from dev_queue_xmit() to packet_direct_xmit() via setsockopt() with the option name of PACKET_QDISC_BYPASS, the skb->mac_header may not be reset and remains as the initial value of 65535, this may trigger slab-out-of-bounds bugs as following: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D UG: KASAN: slab-out-of-bounds in ipvlan_xmit_mode_l2+0xdb/0x330 [ipvlan] PU: 2 PID: 1768 Comm: raw_send Kdump: loaded Not tainted 6.0.0-rc4+ #6 ardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 all Trace: print_address_description.constprop.0+0x1d/0x160 print_report.cold+0x4f/0x112 kasan_report+0xa3/0x130 ipvlan_xmit_mode_l2+0xdb/0x330 [ipvlan] ipvlan_start_xmit+0x29/0xa0 [ipvlan] __dev_direct_xmit+0x2e2/0x380 packet_direct_xmit+0x22/0x60 packet_snd+0x7c9/0xc40 sock_sendmsg+0x9a/0xa0 __sys_sendto+0x18a/0x230 __x64_sys_sendto+0x74/0x90 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd The root cause is: 1. packet_snd() only reset skb->mac_header when sock->type is SOCK_RAW and skb->protocol is not specified as in packet_parse_headers() 2. packet_direct_xmit() doesn't reset skb->mac_header as dev_queue_xmit() In this case, skb->mac_header is 65535 when ipvlan_xmit_mode_l2() is called. So when ipvlan_xmit_mode_l2() gets mac header with eth_hdr() which use "skb->head + skb->mac_header", out-of-bound access occurs. This patch replaces eth_hdr() with skb_eth_hdr() in ipvlan_xmit_mode_l2() and reset mac header in multicast to solve this out-of-bound bug. Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.") Signed-off-by: Lu Wei Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/net/ipvlan/ipvlan_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_c= ore.c index 6c0982a39486..7668584c3843 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -441,7 +441,6 @@ static int ipvlan_process_v6_outbound(struct sk_buff *s= kb) =20 static int ipvlan_process_outbound(struct sk_buff *skb) { - struct ethhdr *ethh =3D eth_hdr(skb); int ret =3D NET_XMIT_DROP; =20 /* The ipvlan is a pseudo-L2 device, so the packets that we receive @@ -451,6 +450,8 @@ static int ipvlan_process_outbound(struct sk_buff *skb) if (skb_mac_header_was_set(skb)) { /* In this mode we dont care about * multicast and broadcast traffic */ + struct ethhdr *ethh =3D eth_hdr(skb); + if (is_multicast_ether_addr(ethh->h_dest)) { pr_debug_ratelimited( "Dropped {multi|broad}cast of type=3D[%x]\n", @@ -520,7 +521,7 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, str= uct net_device *dev) static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev) { const struct ipvl_dev *ipvlan =3D netdev_priv(dev); - struct ethhdr *eth =3D eth_hdr(skb); + struct ethhdr *eth =3D skb_eth_hdr(skb); struct ipvl_addr *addr; void *lyr3h; int addr_type; @@ -544,6 +545,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, str= uct net_device *dev) return dev_forward_skb(ipvlan->phy_dev, skb); =20 } else if (is_multicast_ether_addr(eth->h_dest)) { + skb_reset_mac_header(skb); ipvlan_skb_crossing_ns(skb, NULL); ipvlan_multicast_enqueue(ipvlan->port, skb); return NET_XMIT_SUCCESS; --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 DD968C07E9D for ; Mon, 26 Sep 2022 10:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235068AbiIZKPz (ORCPT ); Mon, 26 Sep 2022 06:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235048AbiIZKPJ (ORCPT ); Mon, 26 Sep 2022 06:15:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1FA7E016; Mon, 26 Sep 2022 03:14:18 -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 C2E6060C0B; Mon, 26 Sep 2022 10:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0490C433C1; Mon, 26 Sep 2022 10:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187257; bh=Yq2zNuwlh4qQrtWhiCD9oJKsITCsDdmBPn/mJK9Qrqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjNtjvoJAxHl0oWhh3SqVNLpSi+QgQyKnHjhu/ANHpBegMMgY+kNfPwxEZaNT2+5u oTme94c5VGuZhI/lDXJH6DmP6xMZVIjLdcleZWJ6bbdP53jQzti0SArHBtEJ4J4fnv 7lCBQp4gunbxyfGRtHlTQfnsTqpiKxA+Ew8X3Hwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Poirier , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 21/30] net: team: Unsync device addresses on ndo_stop Date: Mon, 26 Sep 2022 12:11:52 +0200 Message-Id: <20220926100736.912292608@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Benjamin Poirier [ Upstream commit bd60234222b2fd5573526da7bcd422801f271f5f ] Netdev drivers are expected to call dev_{uc,mc}_sync() in their ndo_set_rx_mode method and dev_{uc,mc}_unsync() in their ndo_stop method. This is mentioned in the kerneldoc for those dev_* functions. The team driver calls dev_{uc,mc}_unsync() during ndo_uninit instead of ndo_stop. This is ineffective because address lists (dev->{uc,mc}) have already been emptied in unregister_netdevice_many() before ndo_uninit is called. This mistake can result in addresses being leftover on former team ports after a team device has been deleted; see test_LAG_cleanup() in the last patch in this series. Add unsync calls at their expected location, team_close(). v3: * When adding or deleting a port, only sync/unsync addresses if the team device is up. In other cases, it is taken care of at the right time by ndo_open/ndo_set_rx_mode/ndo_stop. Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device") Signed-off-by: Benjamin Poirier Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/net/team/team.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 001dea7aaba3..657e12e0b5e2 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -1280,10 +1280,12 @@ static int team_port_add(struct team *team, struct = net_device *port_dev) } } =20 - netif_addr_lock_bh(dev); - dev_uc_sync_multiple(port_dev, dev); - dev_mc_sync_multiple(port_dev, dev); - netif_addr_unlock_bh(dev); + if (dev->flags & IFF_UP) { + netif_addr_lock_bh(dev); + dev_uc_sync_multiple(port_dev, dev); + dev_mc_sync_multiple(port_dev, dev); + netif_addr_unlock_bh(dev); + } =20 port->index =3D -1; list_add_tail_rcu(&port->list, &team->port_list); @@ -1354,8 +1356,10 @@ static int team_port_del(struct team *team, struct n= et_device *port_dev) netdev_rx_handler_unregister(port_dev); team_port_disable_netpoll(port); vlan_vids_del_by_dev(port_dev, dev); - dev_uc_unsync(port_dev, dev); - dev_mc_unsync(port_dev, dev); + if (dev->flags & IFF_UP) { + dev_uc_unsync(port_dev, dev); + dev_mc_unsync(port_dev, dev); + } dev_close(port_dev); team_port_leave(team, port); =20 @@ -1703,6 +1707,14 @@ static int team_open(struct net_device *dev) =20 static int team_close(struct net_device *dev) { + struct team *team =3D netdev_priv(dev); + struct team_port *port; + + list_for_each_entry(port, &team->port_list, list) { + dev_uc_unsync(port->dev, dev); + dev_mc_unsync(port->dev, dev); + } + return 0; } =20 --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 44DFCC07E9D for ; Mon, 26 Sep 2022 10:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235048AbiIZKQA (ORCPT ); Mon, 26 Sep 2022 06:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234743AbiIZKPJ (ORCPT ); Mon, 26 Sep 2022 06:15:09 -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 615E5476C8; Mon, 26 Sep 2022 03:14:23 -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 43EF7B80920; Mon, 26 Sep 2022 10:14:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A998AC433C1; Mon, 26 Sep 2022 10:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187260; bh=13g1aFnVTOE6Fcl80WQqyFiRGJJPmPKS2B2jiHH4KwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0hsQ1Ryjvnoj/50MAIurig+eygniVn2tbKqnDF2j4cMyxzCsHGQFUXSAGDfNvItL0 TSe88cHQL4ewSH3svqaRI5bNzV+Y7hvWrhLLs1zCNlLmVQqVczYy7DdUY+gcpRl+VY o1EzY7b3DKNJgt5LdSpzigqzmQC0lEugwdKLAP+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , kernel test robot , Thomas Bogendoerfer , John Crispin , linux-mips@vger.kernel.org, Sasha Levin Subject: [PATCH 4.9 22/30] MIPS: lantiq: export clk_get_io() for lantiq_wdt.ko Date: Mon, 26 Sep 2022 12:11:53 +0200 Message-Id: <20220926100736.941907121@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Randy Dunlap [ Upstream commit 502550123bee6a2ffa438409b5b9aad4d6db3a8c ] The lantiq WDT driver uses clk_get_io(), which is not exported, so export it to fix a build error: ERROR: modpost: "clk_get_io" [drivers/watchdog/lantiq_wdt.ko] undefined! Fixes: 287e3f3f4e68 ("MIPS: lantiq: implement support for clkdev api") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Thomas Bogendoerfer Cc: John Crispin Cc: linux-mips@vger.kernel.org Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- arch/mips/lantiq/clk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c index d1de57b86683..e0835a743e41 100644 --- a/arch/mips/lantiq/clk.c +++ b/arch/mips/lantiq/clk.c @@ -52,6 +52,7 @@ struct clk *clk_get_io(void) { return &cpu_clk_generic[2]; } +EXPORT_SYMBOL_GPL(clk_get_io); =20 struct clk *clk_get_ppe(void) { --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 BC1F8C07E9D for ; Mon, 26 Sep 2022 10:16:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234829AbiIZKQU (ORCPT ); Mon, 26 Sep 2022 06:16:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234662AbiIZKPU (ORCPT ); Mon, 26 Sep 2022 06:15:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D85DD48CA7; Mon, 26 Sep 2022 03:14: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 dfw.source.kernel.org (Postfix) with ESMTPS id B1E4660B5E; Mon, 26 Sep 2022 10:14:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8686C433C1; Mon, 26 Sep 2022 10:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187263; bh=1VZDLEmKxZHmIaDJ8zA5q7zW2XYZQ6x8zemO9HJ0yNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lP8s6AEnYof2oWzr6FQJUwvqLNYWmqHtSpGu86Fw8sNPDZ9elBrDyCwuVv/7jy/6n 0fN7OR6hXjfj26VLi7LXjEY7CmYhI+a5alnT/CV2xAE1n3IQFewf5UL7nDgXW+R9tQ EH9Q9GS5ROLjCxVBKnj7KDIBwjTwXReMH6wEQzy0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.9 23/30] can: gs_usb: gs_can_open(): fix race dev->can.state condition Date: Mon, 26 Sep 2022 12:11:54 +0200 Message-Id: <20220926100736.971657503@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Marc Kleine-Budde [ Upstream commit 5440428b3da65408dba0241985acb7a05258b85e ] The dev->can.state is set to CAN_STATE_ERROR_ACTIVE, after the device has been started. On busy networks the CAN controller might receive CAN frame between and go into an error state before the dev->can.state is assigned. Assign dev->can.state before starting the controller to close the race window. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices= ") Link: https://lore.kernel.org/all/20220920195216.232481-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/net/can/usb/gs_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index e3dc59fffdb7..8472667ffe71 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -687,6 +687,7 @@ static int gs_can_open(struct net_device *netdev) flags |=3D GS_CAN_MODE_TRIPLE_SAMPLE; =20 /* finally start device */ + dev->can.state =3D CAN_STATE_ERROR_ACTIVE; dm->mode =3D cpu_to_le32(GS_CAN_MODE_START); dm->flags =3D cpu_to_le32(flags); rc =3D usb_control_msg(interface_to_usbdev(dev->iface), @@ -703,13 +704,12 @@ static int gs_can_open(struct net_device *netdev) if (rc < 0) { netdev_err(netdev, "Couldn't start device (err=3D%d)\n", rc); kfree(dm); + dev->can.state =3D CAN_STATE_STOPPED; return rc; } =20 kfree(dm); =20 - dev->can.state =3D CAN_STATE_ERROR_ACTIVE; - parent->active_channels++; if (!(dev->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)) netif_start_queue(netdev); --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 B3EB0C07E9D for ; Mon, 26 Sep 2022 10:17:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234110AbiIZKRH (ORCPT ); Mon, 26 Sep 2022 06:17:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234765AbiIZKQR (ORCPT ); Mon, 26 Sep 2022 06:16:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CF87BEF; Mon, 26 Sep 2022 03:14:34 -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 768E3B8091F; Mon, 26 Sep 2022 10:14:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87663C433C1; Mon, 26 Sep 2022 10:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187269; bh=k30dhzOXh/WvOGmj0fRUhjCe8YK/x2ffhyWiqnPNpkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LvBMs8ED4LpCqszC0fE0i9zIUsMAZMJoqgfkw31UNGx8gvyG+oJSCI0KvhRXN/d7i yjn148ay+DNgbnMk0cr35/N9jvDlcQ9PlnwVfYnmWtBspLuTFU6r5tLjDczJ2h8hBH hhjj62w+1eAWTx/IzCQHHhlEn/nyzLsT9AIYx1gQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Dao , Adrian Hunter , Namhyung Kim , Ian Rogers , Jiri Olsa , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.9 24/30] perf kcore_copy: Do not check /proc/modules is unchanged Date: Mon, 26 Sep 2022 12:11:55 +0200 Message-Id: <20220926100737.011675623@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Adrian Hunter [ Upstream commit 5b427df27b94aec1312cace48a746782a0925c53 ] /proc/kallsyms and /proc/modules are compared before and after the copy in order to ensure no changes during the copy. However /proc/modules also might change due to reference counts changing even though that does not make any difference. Any modules loaded or unloaded should be visible in changes to kallsyms, so it is not necessary to check /proc/modules also anyway. Remove the comparison checking that /proc/modules is unchanged. Fixes: fc1b691d7651d949 ("perf buildid-cache: Add ability to add kcore to t= he cache") Reported-by: Daniel Dao Signed-off-by: Adrian Hunter Tested-by: Daniel Dao Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220914122429.8770-1-adrian.hunter@intel.c= om Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- tools/perf/util/symbol-elf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index e155783c601a..0a7e1543ce8f 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -1694,8 +1694,8 @@ static int kcore_copy__compare_file(const char *from_= dir, const char *to_dir, * unusual. One significant peculiarity is that the mapping (start -> pgo= ff) * is not the same for the kernel map and the modules map. That happens b= ecause * the data is copied adjacently whereas the original kcore has gaps. Fin= ally, - * kallsyms and modules files are compared with their copies to check that - * modules have not been loaded or unloaded while the copies were taking p= lace. + * kallsyms file is compared with its copy to check that modules have not = been + * loaded or unloaded while the copies were taking place. * * Return: %0 on success, %-1 on failure. */ @@ -1758,9 +1758,6 @@ int kcore_copy(const char *from_dir, const char *to_d= ir) kci.modules_map.len)) goto out_extract_close; =20 - if (kcore_copy__compare_file(from_dir, to_dir, "modules")) - goto out_extract_close; - if (kcore_copy__compare_file(from_dir, to_dir, "kallsyms")) goto out_extract_close; =20 --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 ACE80C6FA83 for ; Mon, 26 Sep 2022 10:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235114AbiIZKQz (ORCPT ); Mon, 26 Sep 2022 06:16:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234260AbiIZKQO (ORCPT ); Mon, 26 Sep 2022 06:16:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D7E6384; Mon, 26 Sep 2022 03:14:38 -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 D216360BD4; Mon, 26 Sep 2022 10:14:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6E51C433C1; Mon, 26 Sep 2022 10:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187272; bh=FLvbxrPRqfb/etA3zSORKbB/2pyI4K2lAxYbyH6gJNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1QUx1IUGWyWMwsYQJioM04I8fhzyXdXRQhoC66VEqTLkEFQlQnBK0enhwBWK0lwz YuAq63ZKbUj894plEYP/yGLhNOpMzihnnASiDSqMS4s5XCodEWycIjvibeBYaW94p1 lD6S09kI9XZ4ZDS8a17KY/hzvk93UKIEm/AXNt3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Anderson , Andrew Lunn , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.9 25/30] net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD Date: Mon, 26 Sep 2022 12:11:56 +0200 Message-Id: <20220926100737.050115343@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Sean Anderson [ Upstream commit 878e2405710aacfeeb19364c300f38b7a9abfe8f ] There is a separate receive path for small packets (under 256 bytes). Instead of allocating a new dma-capable skb to be used for the next packet, this path allocates a skb and copies the data into it (reusing the existing sbk for the next packet). There are two bytes of junk data at the beginning of every packet. I believe these are inserted in order to allow aligned DMA and IP headers. We skip over them using skb_reserve. Before copying over the data, we must use a barrier to ensure we see the whole packet. The current code only synchronizes len bytes, starting from the beginning of the packet, including the junk bytes. However, this leaves off the final two bytes in the packet. Synchronize the whole packet. To reproduce this problem, ping a HME with a payload size between 17 and 214 $ ping -s 17 which will complain rather loudly about the data mismatch. Small packets (below 60 bytes on the wire) do not have this issue. I suspect this is related to the padding added to increase the minimum packet size. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Sean Anderson Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220920235018.1675956-1-seanga2@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/net/ethernet/sun/sunhme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/s= unhme.c index b38106a7cb5d..b421a1d44783 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2064,9 +2064,9 @@ static void happy_meal_rx(struct happy_meal *hp, stru= ct net_device *dev) =20 skb_reserve(copy_skb, 2); skb_put(copy_skb, len); - dma_sync_single_for_cpu(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE); + dma_sync_single_for_cpu(hp->dma_dev, dma_addr, len + 2, DMA_FROM_DEVICE= ); skb_copy_from_linear_data(skb, copy_skb->data, len); - dma_sync_single_for_device(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE); + dma_sync_single_for_device(hp->dma_dev, dma_addr, len + 2, DMA_FROM_DEV= ICE); /* Reuse original ring buffer. */ hme_write_rxd(hp, this, (RXFLAG_OWN|((RX_BUF_ALLOC_SIZE-RX_OFFSET)<<16)), --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 CF2F2C6FA83 for ; Mon, 26 Sep 2022 10:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234907AbiIZKRC (ORCPT ); Mon, 26 Sep 2022 06:17:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235093AbiIZKQP (ORCPT ); Mon, 26 Sep 2022 06:16:15 -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 CE085D60; Mon, 26 Sep 2022 03:14:42 -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 DC3E360BFE; Mon, 26 Sep 2022 10:14:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEE96C433C1; Mon, 26 Sep 2022 10:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187275; bh=xBg2Hq0C3rG0zEu7USGpFCsDrTdc0HhUCOa8/YfH7fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DI2uMK7FPUv/TpNc5b/qk3KzQIyPH2C7sdGURC12s+RzGldYwaH41hZarKUGRRSsr 7k8KxUnasKMVxwFvY3m3VD2qUB1ffm/pY4GSPws7m/s4AsCPZiFY/Z5c+2oN7lTa5T vDXTN5P3Uu8TLbg3xHFUi1icp+rQKUc1nlgYszkI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , stable , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 4.9 26/30] serial: Create uart_xmit_advance() Date: Mon, 26 Sep 2022 12:11:57 +0200 Message-Id: <20220926100737.078991410@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Ilpo J=C3=A4rvinen commit e77cab77f2cb3a1ca2ba8df4af45bb35617ac16d upstream. A very common pattern in the drivers is to advance xmit tail index and do bookkeeping of Tx'ed characters. Create uart_xmit_advance() to handle it. Reviewed-by: Andy Shevchenko Cc: stable Signed-off-by: Ilpo J=C3=A4rvinen Link: https://lore.kernel.org/r/20220901143934.8850-2-ilpo.jarvinen@linux.i= ntel.com Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- include/linux/serial_core.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -294,6 +294,23 @@ struct uart_state { /* number of characters left in xmit buffer before we ask for more */ #define WAKEUP_CHARS 256 =20 +/** + * uart_xmit_advance - Advance xmit buffer and account Tx'ed chars + * @up: uart_port structure describing the port + * @chars: number of characters sent + * + * This function advances the tail of circular xmit buffer by the number of + * @chars transmitted and handles accounting of transmitted bytes (into + * @up's icount.tx). + */ +static inline void uart_xmit_advance(struct uart_port *up, unsigned int ch= ars) +{ + struct circ_buf *xmit =3D &up->state->xmit; + + xmit->tail =3D (xmit->tail + chars) & (UART_XMIT_SIZE - 1); + up->icount.tx +=3D chars; +} + struct module; struct tty_driver; =20 From nobody Thu Apr 2 11:46:35 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 7FD7CC07E9D for ; Mon, 26 Sep 2022 10:17:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235142AbiIZKR4 (ORCPT ); Mon, 26 Sep 2022 06:17:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234509AbiIZKQ5 (ORCPT ); Mon, 26 Sep 2022 06:16:57 -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 41B2315A24; Mon, 26 Sep 2022 03:14:50 -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 A9A28B80921; Mon, 26 Sep 2022 10:14:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05C11C433D6; Mon, 26 Sep 2022 10:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187278; bh=P/jPu5lRTU5KAlw0BfvfSuAKw0KPbUzxhtuOZH99Lpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f+VwhgMxkv/pozO2r5WADI3x959mQBVwkaWKqK/WEDOrIz+FqYREu0jxJya9Cp/mx 5ujp8HcgdYvMHQbBgrfu0IAhYP33rNVqh9uiWt83YIhRu5xg1m2qcicbDSd4uYA07g gGWCcb7x5UHZuRIVa6O6Cy8pNfXhltaGfyBiw9WM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 4.9 27/30] serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting Date: Mon, 26 Sep 2022 12:11:58 +0200 Message-Id: <20220926100737.111078157@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Ilpo J=C3=A4rvinen commit 754f68044c7dd6c52534ba3e0f664830285c4b15 upstream. DMA complete & stop paths did not correctly account Tx'ed characters into icount.tx. Using uart_xmit_advance() fixes the problem. Fixes: e9ea096dd225 ("serial: tegra: add serial driver") Cc: # serial: Create uart_xmit_advance() Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo J=C3=A4rvinen Link: https://lore.kernel.org/r/20220901143934.8850-3-ilpo.jarvinen@linux.i= ntel.com Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/tty/serial/serial-tegra.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -409,7 +409,7 @@ static void tegra_uart_tx_dma_complete(v count =3D tup->tx_bytes_requested - state.residue; async_tx_ack(tup->tx_dma_desc); spin_lock_irqsave(&tup->uport.lock, flags); - xmit->tail =3D (xmit->tail + count) & (UART_XMIT_SIZE - 1); + uart_xmit_advance(&tup->uport, count); tup->tx_in_progress =3D 0; if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(&tup->uport); @@ -493,7 +493,6 @@ static unsigned int tegra_uart_tx_empty( static void tegra_uart_stop_tx(struct uart_port *u) { struct tegra_uart_port *tup =3D to_tegra_uport(u); - struct circ_buf *xmit =3D &tup->uport.state->xmit; struct dma_tx_state state; unsigned int count; =20 @@ -504,7 +503,7 @@ static void tegra_uart_stop_tx(struct ua dmaengine_tx_status(tup->tx_dma_chan, tup->tx_cookie, &state); count =3D tup->tx_bytes_requested - state.residue; async_tx_ack(tup->tx_dma_desc); - xmit->tail =3D (xmit->tail + count) & (UART_XMIT_SIZE - 1); + uart_xmit_advance(&tup->uport, count); tup->tx_in_progress =3D 0; } =20 From nobody Thu Apr 2 11:46:35 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 7055FC32771 for ; Mon, 26 Sep 2022 10:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233348AbiIZKRL (ORCPT ); Mon, 26 Sep 2022 06:17:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234779AbiIZKQS (ORCPT ); Mon, 26 Sep 2022 06:16:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FD9B10043; Mon, 26 Sep 2022 03:14:42 -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 3919F60B4A; Mon, 26 Sep 2022 10:14:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30150C43470; Mon, 26 Sep 2022 10:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187281; bh=dgTzuXvWpBNqEIEFup/8PQSrW0v3ksBIqp3m5roA2og=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N5Usqd5MU31VYDwWVLCggktKSBb5GlkxcvYJLToSq3EXynsv/2trBFBygA9FZP3SV E5wmXB2ajlJ2YCfn0D1Ja/czFFg0UyMPZRcxqWtRKWfmMiWQLI9DbrVRm3hpxi7ss1 IuRdeuYc4Fs0bgWvydS83XH4GJpZAtTiwqlwqsWA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Jan Hoeppner , Jens Axboe Subject: [PATCH 4.9 28/30] s390/dasd: fix Oops in dasd_alias_get_start_dev due to missing pavgroup Date: Mon, 26 Sep 2022 12:11:59 +0200 Message-Id: <20220926100737.151359246@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Stefan Haberland commit db7ba07108a48c0f95b74fabbfd5d63e924f992d upstream. Fix Oops in dasd_alias_get_start_dev() function caused by the pavgroup pointer being NULL. The pavgroup pointer is checked on the entrance of the function but without the lcu->lock being held. Therefore there is a race window between dasd_alias_get_start_dev() and _lcu_update() which sets pavgroup to NULL with the lcu->lock held. Fix by checking the pavgroup pointer with lcu->lock held. Cc: # 2.6.25+ Fixes: 8e09f21574ea ("[S390] dasd: add hyper PAV support to DASD device dri= ver, part 1") Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220919154931.4123002-2-sth@linux.ibm.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/s390/block/dasd_alias.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c @@ -674,12 +674,12 @@ int dasd_alias_remove_device(struct dasd struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *base_devi= ce) { struct dasd_eckd_private *alias_priv, *private =3D base_device->private; - struct alias_pav_group *group =3D private->pavgroup; struct alias_lcu *lcu =3D private->lcu; struct dasd_device *alias_device; + struct alias_pav_group *group; unsigned long flags; =20 - if (!group || !lcu) + if (!lcu) return NULL; if (lcu->pav =3D=3D NO_PAV || lcu->flags & (NEED_UAC_UPDATE | UPDATE_PENDING)) @@ -696,6 +696,11 @@ struct dasd_device *dasd_alias_get_start } =20 spin_lock_irqsave(&lcu->lock, flags); + group =3D private->pavgroup; + if (!group) { + spin_unlock_irqrestore(&lcu->lock, flags); + return NULL; + } alias_device =3D group->next; if (!alias_device) { if (list_empty(&group->aliaslist)) { From nobody Thu Apr 2 11:46:35 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 81701C32771 for ; Mon, 26 Sep 2022 10:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235036AbiIZKSS (ORCPT ); Mon, 26 Sep 2022 06:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235031AbiIZKR2 (ORCPT ); Mon, 26 Sep 2022 06:17:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E73637189; Mon, 26 Sep 2022 03:15:02 -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 EDAACB80835; Mon, 26 Sep 2022 10:14:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 285FDC433C1; Mon, 26 Sep 2022 10:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187284; bh=mZEjU9sKh4ZHqsW67cldg1I7i6KLgb+SX4bzxU6CYwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oYU8nIZkR2qbaHTuGsq1AqNmvlQ8ONmxYZ7Vs8cTwsKhqg+2Z76X8H99C1m+Q01UA cmT2nnNR0n1dTrBsDk8GZxznTh36H3ZFgL/kaFNPtpoBYn/rbif15sccGqX7xMqQSf Af5n5dqE8YrCk9dtmscuREG6tHriS0ZgSpMC0328= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Kelley , Vitaly Kuznetsov , Wei Liu , Sasha Levin Subject: [PATCH 4.9 29/30] Drivers: hv: Never allocate anything besides framebuffer from framebuffer memory region Date: Mon, 26 Sep 2022 12:12:00 +0200 Message-Id: <20220926100737.181257997@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Vitaly Kuznetsov [ Upstream commit f0880e2cb7e1f8039a048fdd01ce45ab77247221 ] Passed through PCI device sometimes misbehave on Gen1 VMs when Hyper-V DRM driver is also loaded. Looking at IOMEM assignment, we can see e.g. $ cat /proc/iomem ... f8000000-fffbffff : PCI Bus 0000:00 f8000000-fbffffff : 0000:00:08.0 f8000000-f8001fff : bb8c4f33-2ba2-4808-9f7f-02f3b4da22fe ... fe0000000-fffffffff : PCI Bus 0000:00 fe0000000-fe07fffff : bb8c4f33-2ba2-4808-9f7f-02f3b4da22fe fe0000000-fe07fffff : 2ba2:00:02.0 fe0000000-fe07fffff : mlx4_core the interesting part is the 'f8000000' region as it is actually the VM's framebuffer: $ lspci -v ... 0000:00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtu= al VGA (prog-if 00 [VGA controller]) Flags: bus master, fast devsel, latency 0, IRQ 11 Memory at f8000000 (32-bit, non-prefetchable) [size=3D64M] ... hv_vmbus: registering driver hyperv_drm hyperv_drm 5620e0c7-8062-4dce-aeb7-520c7ef76171: [drm] Synthvid Version ma= jor 3, minor 5 hyperv_drm 0000:00:08.0: vgaarb: deactivate vga console hyperv_drm 0000:00:08.0: BAR 0: can't reserve [mem 0xf8000000-0xfbffffff] hyperv_drm 5620e0c7-8062-4dce-aeb7-520c7ef76171: [drm] Cannot request fram= ebuffer, boot fb still active? Note: "Cannot request framebuffer" is not a fatal error in hyperv_setup_gen1() as the code assumes there's some other framebuffer device there but we actually have some other PCI device (mlx4 in this case) config space there! The problem appears to be that vmbus_allocate_mmio() can use dedicated framebuffer region to serve any MMIO request from any device. The semantics one might assume of a parameter named "fb_overlap_ok" aren't implemented because !fb_overlap_ok essentially has no effect. The existing semantics are really "prefer_fb_overlap". This patch implements the expected and needed semantics, which is to not allocate from the frame buffer space when !fb_overlap_ok. Note, Gen2 VMs are usually unaffected by the issue because framebuffer region is already taken by EFI fb (in case kernel supports it) but Gen1 VMs may have this region unclaimed by the time Hyper-V PCI pass-through driver tries allocating MMIO space if Hyper-V DRM/FB drivers load after it. Devices can be brought up in any sequence so let's resolve the issue by always ignoring 'fb_mmio' region for non-FB requests, even if the region is unclaimed. Reviewed-by: Michael Kelley Signed-off-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20220827130345.1320254-4-vkuznets@redhat.com Signed-off-by: Wei Liu Signed-off-by: Sasha Levin Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- drivers/hv/vmbus_drv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 3248aa7a35b3..cb3e22f10d68 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1186,7 +1186,7 @@ int vmbus_allocate_mmio(struct resource **new, struct= hv_device *device_obj, bool fb_overlap_ok) { struct resource *iter, *shadow; - resource_size_t range_min, range_max, start; + resource_size_t range_min, range_max, start, end; const char *dev_n =3D dev_name(&device_obj->device); int retval; =20 @@ -1221,6 +1221,14 @@ int vmbus_allocate_mmio(struct resource **new, struc= t hv_device *device_obj, range_max =3D iter->end; start =3D (range_min + align - 1) & ~(align - 1); for (; start + size - 1 <=3D range_max; start +=3D align) { + end =3D start + size - 1; + + /* Skip the whole fb_mmio region if not fb_overlap_ok */ + if (!fb_overlap_ok && fb_mmio && + (((start >=3D fb_mmio->start) && (start <=3D fb_mmio->end)) || + ((end >=3D fb_mmio->start) && (end <=3D fb_mmio->end)))) + continue; + shadow =3D __request_region(iter, start, size, NULL, IORESOURCE_BUSY); if (!shadow) --=20 2.35.1 From nobody Thu Apr 2 11:46:35 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 A337AC07E9D for ; Mon, 26 Sep 2022 10:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235130AbiIZKRn (ORCPT ); Mon, 26 Sep 2022 06:17:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235113AbiIZKQz (ORCPT ); Mon, 26 Sep 2022 06:16:55 -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 41C5A15A28; Mon, 26 Sep 2022 03:14:52 -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 D9A09B8091E; Mon, 26 Sep 2022 10:14:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30ED4C433C1; Mon, 26 Sep 2022 10:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187287; bh=2FBLOR6h3UCh5GKhSE+UT/LyXePGcm5basdWGeNhV3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2rBvgogenrDYg7P9vhE4oJ62kwQATJmc4MBjMK8Eu5+qvcYCXOzYVI3+TtU63l44v BMUAT6WSHzhVvZpNwsKuJYvoDHIOu23r0o8vSjASrsGO8AAgpp6sXFFWYY03HzCVQL zUTfRZHBIN/x2fAq8LpZ8aNdF7joFqREBo4ddQkw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Wahren , Ojaswin Mujoo , stable@kernel.org, Jan Kara , Theodore Tso Subject: [PATCH 4.9 30/30] ext4: make directory inode spreading reflect flexbg size Date: Mon, 26 Sep 2022 12:12:01 +0200 Message-Id: <20220926100737.224531328@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100736.153157100@linuxfoundation.org> References: <20220926100736.153157100@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: Jan Kara commit 613c5a85898d1cd44e68f28d65eccf64a8ace9cf upstream. Currently the Orlov inode allocator searches for free inodes for a directory only in flex block groups with at most inodes_per_group/16 more directory inodes than average per flex block group. However with growing size of flex block group this becomes unnecessarily strict. Scale allowed difference from average directory count per flex block group with flex block group size as we do with other metrics. Tested-by: Stefan Wahren Tested-by: Ojaswin Mujoo Cc: stable@kernel.org Link: https://lore.kernel.org/all/0d81a7c2-46b7-6010-62a4-3e6cfc1628d6@i2se= .com/ Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220908092136.11770-3-jack@suse.cz Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan --- fs/ext4/ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -511,7 +511,7 @@ static int find_group_orlov(struct super goto fallback; } =20 - max_dirs =3D ndirs / ngroups + inodes_per_group / 16; + max_dirs =3D ndirs / ngroups + inodes_per_group*flex_size / 16; min_inodes =3D avefreei - inodes_per_group*flex_size / 4; if (min_inodes < 1) min_inodes =3D 1;