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 6E9BBE567 for ; Thu, 1 May 2025 14:18:01 +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=1746109081; cv=none; b=InVFTbCoJaP/RWGgLIA1oOAT4vEG6pVswF8ItyNpWSyBTrVQ4Z0UJfbeg3Qq8SniCga08/10GCaiKxjKPHPYgtA0eT7SKBJa7RI7cYMi+oPmb7lg8Cm8QYZU8zgyTI6mG2JDnZCrZpBAHHiqwuscFtTbQuMsF2ksQ0O8xABGyUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109081; c=relaxed/simple; bh=Y+0bsSvvKHhROLluA5ARHm8Lx1ep+aiSFa00ugDs65o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qnpB2KTCB5QvlKPVjcavYfIQlofn4nxNmgF1HvcN0H9wEbtd+13trdK2QTkUPQm/ZYzR9ThPwNsmJex41egiRv1LRFmYRIpgY3Kh7PdxDZaBg8wJOrxJ3NDRReTySW3sqg6fLbj5mjUBjwW/f+CbdjFNfNg0PDEqJOVhXS+65Jg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VClsCug/; 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="VClsCug/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEC5EC4CEE3; Thu, 1 May 2025 14:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746109081; bh=Y+0bsSvvKHhROLluA5ARHm8Lx1ep+aiSFa00ugDs65o=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VClsCug/9MuUuNhwgVl+MYHMEpi2l0DjMQfPNUDFWrAeiF/PfSIpbePkxt7x99BCK y1DvU6+c+n/1AGw3xn9iWD9V/TBuJGUJqJmFPzSN8itlV3yXXaRQOXexRO+aVBYiyr fKnKa3Dopqne6zahyvHz4X7ZgGqWWm3LAns9wm18= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49875: bpftool: Fix NULL pointer dereference when pin {PROG, MAP, LINK} without FILE Date: Thu, 1 May 2025 16:11:05 +0200 Message-ID: <2025050152-CVE-2022-49875-9422@gregkh> X-Mailer: git-send-email 2.49.0 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=2636; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=BL4kGwCmVbYUzGTWid6pBYsRu9hI9YtDdFDVz+dxEns=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDRv6vf7a8zy9ajM3RHnXKd+7P59NLri3z/nAi7crr nytelvK2hHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATMd/CMFdiTq6ZTohKXLPz ly3WCzfU/uxiN2FYcKXIS/fMr71VURErDhq80UuZU6k9CQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: bpftool: Fix NULL pointer dereference when pin {PROG, MAP, LINK} without FILE When using bpftool to pin {PROG, MAP, LINK} without FILE, segmentation fault will occur. The reson is that the lack of FILE will cause strlen to trigger NULL pointer dereference. The corresponding stacktrace is shown below: do_pin do_pin_any do_pin_fd mount_bpffs_for_pin strlen(name) <- NULL pointer dereference Fix it by adding validation to the common process. The Linux kernel CVE team has assigned CVE-2022-49875 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 75a1e792c335b5c6d7fdb1014da47aeb64c5944f and fixed in 5.10.155 with commit 8c80b2fca4112d724dde477aed13f7b0510a2792 Issue introduced in 5.7 with commit 75a1e792c335b5c6d7fdb1014da47aeb64c5944f and fixed in 5.15.79 with commit 6dcdd1b68b7f9333d48d48fc77b75e7f235f6a4a Issue introduced in 5.7 with commit 75a1e792c335b5c6d7fdb1014da47aeb64c5944f and fixed in 6.0.9 with commit da5161ba94c5e9182c301dd4f09c94f715c068bd Issue introduced in 5.7 with commit 75a1e792c335b5c6d7fdb1014da47aeb64c5944f and fixed in 6.1 with commit 34de8e6e0e1f66e431abf4123934a2581cb5f133 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-49875 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: tools/bpf/bpftool/common.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/8c80b2fca4112d724dde477aed13f7b0510a2792 https://git.kernel.org/stable/c/6dcdd1b68b7f9333d48d48fc77b75e7f235f6a4a https://git.kernel.org/stable/c/da5161ba94c5e9182c301dd4f09c94f715c068bd https://git.kernel.org/stable/c/34de8e6e0e1f66e431abf4123934a2581cb5f133