Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1111879rdb; Sat, 18 Nov 2023 03:46:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgOzz5xp0CCUWSCNi6xzRFzHT3yiVZvtPnQv1g3FPq1bso6esJoc19WYvPD55/uo5z7yBc X-Received: by 2002:a17:902:eccf:b0:1cf:53ca:ba2d with SMTP id a15-20020a170902eccf00b001cf53caba2dmr495632plh.9.1700307977033; Sat, 18 Nov 2023 03:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700307977; cv=none; d=google.com; s=arc-20160816; b=F5lHzuyVRMbXAzoKp7ZvIj184Eo+FpAVDUOeUB6oIBrtvgqpY+5nMCM+M2zl7hsHjo dh2IgFmvKHJfqZclNFDSV1xSvEpFeG1xS+V/KLR+bkIZW8eLsC+tnBH0YEsioQ9p0aSD 9OamIw/kMyYXqcSNsRqROVqNk+0hsZS9OYCKB04pE80IFKL74zBhsuftGtLOBbADXY1y gt0cd4vSvSTgktb78kSsJGEiBR4Tp5HeG1yZwMQ1zvqGLX/UwmJ5+mAuLFOZod6LgGMm SxrYystEYFWgQHHIizPSX0GLfGwpvyBrcPj4YIctVl1mTQWiRM6EoWkmVrI2LD8/Z17K vDww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=Zr/fWLNv0kQk17CJyVu6sxw75RSfVWR6vntD48RKtB4=; fh=gLSCYh25+6tf6lS23bFbt3c3muyZSV2UE9IIKXay2Rc=; b=s+o1Oas7lvR9X/EVPdZ1MjgGHiDiUb0n7N/CuIV3G7WXlAZZIFIuoDhZS6Errwq2pN gVt8eCbakBjurFvh6qGLIqJ7vBGfvjd54nRgJcOLz4KkPEaMFIi4qvcnrgPt4S2EM9b3 oqhMjYlchXcGH+pdR0VXvIEuZgR8piwTEeiFAH+m/cpUZjuWeB2UZ2uDyEpjHD0+11ZG UDM1eeGiYL+7Ed5mX1DBOX3G0f2x4NaZozJEpWif2qoEVbJEVjms7rbu9+iwDyZMOVj/ K+CyALAn2vVHLbFNnfsum9XypHcy1UEXZ1gJ/D9aUlrZ/2jDovbqUzsBqNmENV4Bx+G3 w8aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=SuU30flu; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=FLA3zNdd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z15-20020a170903018f00b001ce675c396fsi1926287plg.138.2023.11.18.03.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 03:46:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=SuU30flu; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=FLA3zNdd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CE9A48032F84; Sat, 18 Nov 2023 03:46:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjKRLpv (ORCPT + 99 others); Sat, 18 Nov 2023 06:45:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjKRLpu (ORCPT ); Sat, 18 Nov 2023 06:45:50 -0500 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231118025748.2778044-3-mmaurer@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 18 Nov 2023 03:46:13 -0800 (PST) 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