From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="SuU30flu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FLA3zNdd" X-Greylist: delayed 523 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 18 Nov 2023 03:45:46 PST Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBF7D57; Sat, 18 Nov 2023 03:45:46 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id F40B02B001EC; Sat, 18 Nov 2023 06:36:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 18 Nov 2023 06:36:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1700307416; x=1700314616; bh=Zr /fWLNv0kQk17CJyVu6sxw75RSfVWR6vntD48RKtB4=; b=SuU30flu847g5XcV0f FCQZFqm3Cdo7HbjwSBgbZC8Ee2oQreEHsvnKXcTzEamHIQUm3Sru5Nhhsy7xtTzt zni0ZEL0FrSMXJYQ7/g/DYSR3XDdAmsXeP1ZYQMrI4qASl1KWI6qbGLOT9m650EP odvcvAAVH+wAk+CeVY2PHqr7hnOCxHm4Lc4qEn58KK92Rq0GA5byA50gYnpdEwg0 sZpHq82Tau12tqPEH4Vg9E9P7SRM3k4WN3xKnfVQBeOraHeGgCKEhr2as6kpl37E gpNQh1f1UtaArUoCpRMjMk8AKUNQAyUdMrMyG7hghPUVv90Bgy/7uYXflFnB/6m+ KwtQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1700307416; x=1700314616; bh=Zr/fWLNv0kQk1 7CJyVu6sxw75RSfVWR6vntD48RKtB4=; b=FLA3zNddW4gd6JJNZkKHZpGU2ZSoE x1ROSDleHA8aDXPIRG7MqlrSQHO4EXldW0XNoPnLOwASmCHom0scuPp3GgKJwbG5 +WKLSANtEOiyWlyDR9IjWbmaviCatb4aLCbjCh3Cv00FCgR0sWVTM0FItdVW48OR ftxX5U/P0w1Rbfm5VQfgJ+TyZvDjgCZYzUTMXGGsJ9kpWChIP7K94inv1dEmFIP7 R9oD+pzExldpFURss+edLIyuNonCFiGqBjlWAgWfhGXiPPTZODgqhQy35/SkO/up 3rFxWPAGnxNzZyEz1MLFn+34jn4e14lRU6qpX1xbBPlEnsMHC4WdawNwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudegvddgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepheegvd evvdeljeeugfdtudduhfekledtiefhveejkeejuefhtdeufefhgfehkeetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorg hhrdgtohhm X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 18 Nov 2023 06:36:55 -0500 (EST) Date: Sat, 18 Nov 2023 06:36:49 -0500 From: Greg KH To: Matthew Maurer Cc: Masahiro Yamada , Nick Desaulniers , Miguel Ojeda , Gary Guo , Luis Chamberlain , Nathan Chancellor , Nicolas Schier , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, rust-for-linux@vger.kernel.org, Laura Abbott Subject: Re: [PATCH v2 2/5] modules: Refactor + kdoc elf_validity_cached_copy Message-ID: <2023111818-agent-verdict-99a5@gregkh> References: <20231118025748.2778044-1-mmaurer@google.com> <20231118025748.2778044-3-mmaurer@google.com> Precedence: bulk X-Mailing-List: rust-for-linux@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: <20231118025748.2778044-3-mmaurer@google.com> On Sat, Nov 18, 2023 at 02:54:43AM +0000, Matthew Maurer wrote: > Functionality is almost identical, just structured for better > documentation and readability. Changes: > > * Section names are checked for *all* non-SHT_NULL sections, not just > SHF_ALLOC sections. We have code that accesses section names of > non-SHF_ALLOC sections (see find_any_sec for example) > * The section name check occurs *before* strcmping on section names. > Previously, it was possible to use an out-of-bounds offset to strcmp > against ".modinfo" or ".gnu.linkonce.this_module" > * strtab is checked for NUL lead+termination and nonzero size > * The symbol table is swept to ensure offsets are inbounds of strtab > > While some of these oversights would normally be worrying, all of the > potentially unverified accesses occur after signature check, and only in > response to a user who can load a kernel module. > > Signed-off-by: Matthew Maurer > --- > kernel/module/internal.h | 7 +- > kernel/module/main.c | 585 +++++++++++++++++++++++++++++---------- > 2 files changed, 444 insertions(+), 148 deletions(-) Again, this needs to be broken into much smaller pieces before we can even review it. Would you want to review this? thanks, greg "think of the reviewers" k-h