Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55C1219D89E for ; Wed, 26 Feb 2025 02:12:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535969; cv=none; b=TnUEKPaR3r9YHpKHaDwACaZvEcHPir/NV4yAJdCVYxIYxXpCXvdIahZyspQ9Y8EDvKTasRFRIGxgeo67ZIGWfhFtzoN2Eweb2lhXgI4a9XpAOjUqwjv0GLIAt9Yrg0w2BF4jLcsd6hX4m/n9Gc/VGAtOvSDkQ8rsYSMV0D1z0ck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535969; c=relaxed/simple; bh=HnaQB7LdNRVX3qHBczYHudxZtlsYWzV1XVwQ/rowVfg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=grMNJxGyU+sYL+HdIN+Z9Lq5sZXZ1jB+qboMrwVHj3WPM7en3zZ/motDJzfKodnbtaXSXLdqpO6tAmXB4ZiRW20KvVhOiyXPonVJI8Chs0jTwGHahc5FFmPz0/dDCF10EVOKSA4LOExQU+Utr96PKmTYOLzicpum9EpUbBvG1Ds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SRFzvzUi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SRFzvzUi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4204C4CEDD; Wed, 26 Feb 2025 02:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535968; bh=HnaQB7LdNRVX3qHBczYHudxZtlsYWzV1XVwQ/rowVfg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SRFzvzUi+b83vU891GAHzBijIGNt6MjEAnon09/iRo9ELHDuydNdXRMK7aFB0kLgi toD0V5s0/2rBlseKw6Zys10Un8BU0t7rmb0sIlCrhxp5KfWKsN0JzRAlN0qKW3Lpo5 YRoMeQUQLgZnyrcvakM5Eh2F4k68kfkZjHxqsgq8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49312: staging: rtl8712: fix a potential memory leak in r871xu_drv_init() Date: Wed, 26 Feb 2025 03:09:46 +0100 Message-ID: <2025022636-CVE-2022-49312-6cea@gregkh> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2904; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=HnaQB7LdNRVX3qHBczYHudxZtlsYWzV1XVwQ/rowVfg=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7yh8osN08vtroa3rffaZfXUv7c8QmSu785bY8SHXvC e1l/55HdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBENsoyzC8pNGEOEenoCNdK KtKoM1vV9823i2HBtfiWjPVaGqsf3O2LePv377YbnVOPAgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: staging: rtl8712: fix a potential memory leak in r871xu_drv_init() In r871xu_drv_init(), if r8712_init_drv_sw() fails, then the memory allocated by r8712_alloc_io_queue() in r8712_usb_dvobj_init() is not properly released as there is no action will be performed by r8712_usb_dvobj_deinit(). To properly release it, we should call r8712_free_io_queue() in r8712_usb_dvobj_deinit(). Besides, in r871xu_dev_remove(), r8712_usb_dvobj_deinit() will be called by r871x_dev_unload() under condition `padapter->bup` and r8712_free_io_queue() is called by r8712_free_drv_sw(). However, r8712_usb_dvobj_deinit() does not rely on `padapter->bup` and calling r8712_free_io_queue() in r8712_free_drv_sw() is negative for better understading the code. So I move r8712_usb_dvobj_deinit() into r871xu_dev_remove(), and remove r8712_free_io_queue() from r8712_free_drv_sw(). The Linux kernel CVE team has assigned CVE-2022-49312 to this issue. Affected and fixed versions =========================== Fixed in 5.10.122 with commit 5a89a92efc342dd7c44b6056da87debc598f9c73 Fixed in 5.15.47 with commit 8eb42d6d10f8fe509117859defddf9e72b4fa4d0 Fixed in 5.17.15 with commit 205e039fead72e87ad2838f5e649a4c4834f648b Fixed in 5.18.4 with commit a2882b8baad068d21c99fb2ab5a85a2bdbd5b834 Fixed in 5.19 with commit 7288ff561de650d4139fab80e9cb0da9b5b32434 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-49312 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/staging/rtl8712/os_intfs.c drivers/staging/rtl8712/usb_intf.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/5a89a92efc342dd7c44b6056da87debc598f9c73 https://git.kernel.org/stable/c/8eb42d6d10f8fe509117859defddf9e72b4fa4d0 https://git.kernel.org/stable/c/205e039fead72e87ad2838f5e649a4c4834f648b https://git.kernel.org/stable/c/a2882b8baad068d21c99fb2ab5a85a2bdbd5b834 https://git.kernel.org/stable/c/7288ff561de650d4139fab80e9cb0da9b5b32434