Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1251600lql; Tue, 12 Mar 2024 11:21:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHoM7J+Ka9/9BJGMCKoAoMK5fGBiddriHdrnuQWMjoK+sBvkttprFE3coHydDuAW5P2puqGLLpNU9e5vkZOi2FdSJo6MdbW2YtrzkeSA== X-Google-Smtp-Source: AGHT+IGddQYT7Pg5PeJiD4BnHioSOOU8yQkTKGym23klbyHN7QLIep91r5wfou5iwB++A4YnNMMW X-Received: by 2002:a05:6a21:3994:b0:1a1:6d59:2e0b with SMTP id ad20-20020a056a21399400b001a16d592e0bmr3153226pzc.10.1710267709365; Tue, 12 Mar 2024 11:21:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710267709; cv=pass; d=google.com; s=arc-20160816; b=BSXecPZbF+Wf81xfuIT0NDG8b55pCzYCgeopEeoXqPteGOZfPcPuqHeZ3Wx/BtJ4od g2ezMl/ckNO97p+wl0VjFRgO9qKnbaFhEPTgq6KfBmVVNr4i134ABm86fkPEnjSXx3xw QXmQMh2pHF5eMqm0JiltnHDn+hOEw4TcHJXV+LeI5BtDTU5YSWK0x2oB007mfI46/R0R pfiO5GsUQMfLpT8wyNxVbhan+p1E73xNC6XtAHvYF39J0rJZMQIegUgiHUgI2C1vj3Wl ereuqPAc60HxgbJRw4UM76CZQfuh2xP5OwRvLC0KeFiK9T5fj4aq9Sk140BSCtd+sQSO GDtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=BxMNXhCM/KFz8Y7nf+UlFxJyjujwiOzBHhW0CCs32LQ=; fh=EeWBYsFI9J7eJ8uYHKwwCYIzRtlTX8Ay/uEj0c1AyaI=; b=VMgw54gdJlQwSkdmcNtBiTk3/FliLP366D48IVvTEjyO8h86km8yf/oKlNldtMg0A0 2XJZmarlOzn+HR8Dd2m5/vT24Jo5TQJgOSjXkiAMU2dg4odDEKKMzO9Rko8JsyEJrl/U eAzblJr1TfV1z7kzbWqQ9Z+yuMpDu6NJ7vjstjZg4S7wscSKAlm+A79gmFwhnjOtI3ad IaRx9DXo1SYKYyZHcGc0i/hjOv66sSWXRQLd1WOPqD8w9w6+9dBT9DDcEIOFDI59n8us 8nTQe38qHMIdPMo7O0TfnCap3ISxQmdhSMwZ8Bj0yqCRGhNq41Mg3nuW9cvcJlo6KmNC jnXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=2vKUe73U; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w17-20020a62c711000000b006e64d973847si7107470pfg.275.2024.03.12.11.21.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 11:21:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=2vKUe73U; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E0587B210F7 for ; Tue, 12 Mar 2024 15:12:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B8247C095; Tue, 12 Mar 2024 15:11:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="2vKUe73U" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BA9176997A for ; Tue, 12 Mar 2024 15:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710256315; cv=none; b=DMDI1fr+N4OYQKTEVr1+xshnYLrL7GiHWz7+wcH4X9a4jjGX24L7Slnb9A053U5P9Lv4tCovXu+3ZPyF6p4id+N5g4iVqj+HdYDzgn1B6U+dIRdT7f+cORXpmtVYv6boJJOHg/cP0KhT73VmGjRDDglkOTV1qm9bgUWlycDV69E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710256315; c=relaxed/simple; bh=V7zXgBHa7JMrubQ33eVoCvMw3s3BKUf2E4GG2ktRgUE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bZjUPGx5ySqSjphCc4gZrCXG5EheA+7B8oBkjjEbPfD7R33z5faIGJ/LZbmMTmDOvYCwYK2mFUoNXYvDNQoeoNfCg0j49n7pSoAdRYXbU/WeRaZrH7Ae56SWIT2dwlQjiu19eICDPLeHq4Pbml51Roq6mT5kW5S+fjMUAVV8Gj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=2vKUe73U; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BxMNXhCM/KFz8Y7nf+UlFxJyjujwiOzBHhW0CCs32LQ=; b=2vKUe73U2rA47MGpDb6wS6UmPu 12gk6++6IwnZh39s7oWgiodpXE6OYU9haEvIxkfua7kV0nI8ERaptbRBULpbBPuSsKX354lD7eICG R5IeqC6Q3eNYyv211VVCKOHg5ZchLJ9nqu6JuTe5Z52aA+ZQ/W329CdUDxHfbcCwfMZE5f1c43ybz +xIgcnT0aCDY119+OFt0aWpuxE6R6vkmik6lazpgwZhVh/AUQKYiLojB/26aeInUS+CjzgVgg3oRm YbJITTikwyhlaJrkEsa0wmo+BOcRP/3SPqeZB4yjcgEkA3CJocSjy/hG2rJPbkXd+MYhwYFJq7sKl U6S5ncEw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk3nE-00000006JDw-0WZV; Tue, 12 Mar 2024 15:11:52 +0000 Date: Tue, 12 Mar 2024 08:11:52 -0700 From: Luis Chamberlain To: Michal Hocko Cc: Lee Jones , cve@kernel.org, linux-kernel@vger.kernel.org, Joel Granados , Greg Kroah-Hartman Subject: Re: CVE-2023-52596: sysctl: Fix out of bounds access for empty sysctl registers Message-ID: References: <2024030645-CVE-2023-52596-b98e@gregkh> <20240312091730.GU86322@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain On Tue, Mar 12, 2024 at 10:45:28AM +0100, Michal Hocko wrote: > On Tue 12-03-24 09:17:30, Lee Jones wrote: > [...] > > > Backporting this is fine, but wouldn't fix an issue unless an external > > > module had empty sysctls. And exploiting this is not possible unless > > > you purposely build an external module which could end up with empty > > > sysctls. > > Thanks for the clarification Luis! > > > Thanks for the amazing explanation Luis. > > > > If I'm reading this correctly, an issue does exist, but an attacker > > would have to lay some foundations before it could be triggered. Sounds > > like loading of a malicious or naive module would be enough. > > If the bar is set as high as a kernel module to create and empty sysctl > directory then I think it is safe to say that the security aspect is > mostly moot. There are much simpler ways to attack the system if you are > able to load a kernel module. Indeed, a simple BUG_ON(1) on external modules cannot possible be a source of a CVE. And so this becomes BUG_ON(when_sysctl_empty()) where when_sysctl_empty() is hypotethical and I think the source of this question for CVE. Today's that not at boot time or dynamically with any linux kernel sources released, and so its only possible if: a) As Joel indicated if you backported an empty sysctl array (which would be unless you carried all the infrastructure to support it). b) an external module has an empty sysctl HTH. Luis