Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp517021pxa; Tue, 11 Aug 2020 08:30:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL1EgOvseV+3fnWKfzB8F8Ryhmpd+Pbl3hHNRdolYK1HxoyUX/8cXXPLSQ5b7Krr8Ap8Pm X-Received: by 2002:a17:906:9609:: with SMTP id s9mr23318080ejx.232.1597159843523; Tue, 11 Aug 2020 08:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597159843; cv=none; d=google.com; s=arc-20160816; b=jvvnhG8/5xnw5U2KSSgE1BR7Kn2chBh1yTUFtWCMMiCHli1Fm8voHyBVHwsba5iTzG jWwTu7R385mSXAYpraSqITll6D4177ZkkjBGTJjinXFoehNz+zNV1tndBXMIq9Ax5pJj WH/VM3IAvIkESlZJgAbFFTnNqvP4MyseuiIxf8Ia2bL4bu+BMHZF+51jb7IeyxFBriNM aYzJ6qaid6MxawcY16UoJ+KgPw14Y9AJrrgTz0eAXOHeq1X7Oso5baNLronlr7fHmwWO rSO8OuBNvKFKsRJ/YKKKgrFYyEDlEfhiy2/ylR9rjfcx2uq/F5a5+7MVLciQd8CvnTVf V3Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=WOeoKZ7W9rPT7egKYGPIAqaedSbinj9zPfe3jEUZHRU=; b=cTMUkTVvFUjXAY0lxw7adtyaWCOy5la/lkuOjNnv2twfob40rrJjcEuhylpv/wrxr9 b8aLyptrp+GMASvmX13LuYyqmiHNmaI5W4SuqZGIQAC5EFDHNw4Cp/6AknEqBGqDjCUC V8hKzWlkibNmH903JwJIlLDQ9frlR3djgZ/JSJTOfhoNwJEJXFcx2f3rAkdhV2v7MpTL dSE3zS9D1wZF5uGxCYSeZei/Mpuj5ulxA576xXgKbPGInEVcZY02LkKMZY5OOyMooBC4 8jf1ksVuqjLReracbCOjPffMfXdVGpSOIPrpEbqbsEJ4MX73sb3M/gSV1MLsf0DwkjIR NYgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VxS0aKjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by29si12925938edb.452.2020.08.11.08.30.19; Tue, 11 Aug 2020 08:30:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VxS0aKjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728893AbgHKP1n (ORCPT + 99 others); Tue, 11 Aug 2020 11:27:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:42952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728833AbgHKP1n (ORCPT ); Tue, 11 Aug 2020 11:27:43 -0400 Received: from coco.lan (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 32C1F2078E; Tue, 11 Aug 2020 15:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597159663; bh=F5Au2QencG0Uq++GUgB+02riOEgxtOOIblwGIT8wvLI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VxS0aKjCXSiP7qflto20mBRjPz47NV/sdbDFuxnl6vEsEPgSRcHVKGIAwz1xESNrX IftH9QhriPOjJq7XLqo3P0Asme+gtXExwDwdPpfHbRlntfDWuc/tSXUd2l1opGORGU pzY5h48v6Pfm6abiD+lVDUJcBdEdYOdkk9AvLkns= Date: Tue, 11 Aug 2020 17:27:38 +0200 From: Mauro Carvalho Chehab To: peterz@infradead.org Cc: Jessica Yu , linux-kernel@vger.kernel.org, Thomas Gleixner , keescook@chromium.org, Josh Poimboeuf , Miroslav Benes , Mark Rutland Subject: Re: [PATCH v2] module: Harden STRICT_MODULE_RWX Message-ID: <20200811172738.2d632a09@coco.lan> In-Reply-To: <20200811145524.GE2674@hirez.programming.kicks-ass.net> References: <20200403171303.GK20760@hirez.programming.kicks-ass.net> <20200808101222.5103093e@coco.lan> <20200810092523.GA8612@linux-8ccs> <20200810150647.GB8612@linux-8ccs> <20200811163427.6edbf343@coco.lan> <20200811145524.GE2674@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, 11 Aug 2020 16:55:24 +0200 peterz@infradead.org escreveu: > On Tue, Aug 11, 2020 at 04:34:27PM +0200, Mauro Carvalho Chehab wrote: > > [33] .plt PROGBITS 0000000000000340 00035c80 > > 0000000000000001 0000000000000000 WAX 0 0 1 > > [34] .init.plt NOBITS 0000000000000341 00035c81 > > 0000000000000001 0000000000000000 WA 0 0 1 > > [35] .text.ftrace[...] PROGBITS 0000000000000342 00035c81 > > 0000000000000001 0000000000000000 WAX 0 0 1 > > .plt and .text.ftrace_tramplines are buggered. > > arch/arm64/kernel/module.lds even marks then as NOLOAD. Hmm... Shouldn't the code at module_enforce_rwx_sections() or at load_module() ignore such sections instead of just rejecting probing all modules? I mean, if the existing toolchain is not capable of excluding those sections, either the STRICT_MODULE_RWX hardening should be disabled, if a broken toolchain is detected or some runtime code should handle such sections on a different way. Thanks, Mauro