Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3746741pxb; Fri, 11 Feb 2022 06:57:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvEsu/pcAsCuFE/ix6MbZlMp7U3Mwn1XNi1pb2NiVovFNMF89/ryRh1tEoKGGRYhIbMYwr X-Received: by 2002:a17:902:6b4a:: with SMTP id g10mr1853782plt.57.1644591474237; Fri, 11 Feb 2022 06:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644591474; cv=none; d=google.com; s=arc-20160816; b=hhplnTYrKaC+a8/S96jX6FCVd/v/444yuckOK5OtIxBJeWp+d98SUHEDUzgfdAfxWb /bNsxolnd+act5efSc2TNBUZSOVYmwxfWAr++x6bTgrYSA9sndAdLizpzcBKH6yGHyEb +ENhT1RnhJzlDkbQzs0s+z/RR5puC5PD814eB9aUV9Smr6rDMBdbYyUlVhMwkBn7t2Hm KE/LJltyJjrhNpzH5JFCab5+SDxXVAie/gAKSz8Y0TfJJntvvi3O5+4nA/vHz3Q7hJcb R2jyJMtRk0geIjjYgoiZhh6ysUoc11pa0Cf+tPQprdb87xK8fTyf9SkPRdaBRs1LqkvW 6wnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=G8D3Rc9SIkOcfBa1vDejqDTP/HXsHXl7xRg9X0I4XWw=; b=FZ3l2fQGfC2Fdg82myORr3Q44n2oPfSG54z4UJgtVZdGSY+WGMganFHNlVvkQTHs+x wONURaaDKCKv4/6pSjWW43GjuWZQXGwWAT7/KyDw8r3W5sGXtSgyjXpTQrZm1yLhLF5A HetpMolZeRPANeKddnTGkHkRQFOZJIXaroIfMHuxvaOT1nz6HR86G2YlwiMZWqvKz8Xt W6Z/hC0XtyWISa5oIus+LPuR9DlPikAqzeqrKBojwLf5TovWCSW7GT/WLAXTSkWSKxt2 r7r7IlTM+ZgdxuirhcQ7yk1J1+f+V5uCSwgKV0/mMwYHp5FBE402wt+37kjACjrkz+k2 STyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UOjTLSVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12si4282617pjr.127.2022.02.11.06.57.38; Fri, 11 Feb 2022 06:57:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UOjTLSVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344524AbiBKLJi (ORCPT + 99 others); Fri, 11 Feb 2022 06:09:38 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241778AbiBKLJh (ORCPT ); Fri, 11 Feb 2022 06:09:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1CBAAE45 for ; Fri, 11 Feb 2022 03:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644577774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G8D3Rc9SIkOcfBa1vDejqDTP/HXsHXl7xRg9X0I4XWw=; b=UOjTLSVatDCTKGfC1iFVInXy4y8F8qTwGHzg52isyDBMSBBHaUyJSM45kKSLliOHszzKsM uyZ6cO64YQOVMyQQ1vHLWS3bvbRcJTt0MeJNvHhvsRb2iak++lJyN97vzBnRsdaQZyk/XF diyu+Rk9N2glzlq7SRiJAFbRVCpl+jE= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-660-h_Fme-p_OPiSa0ORMPT-nw-1; Fri, 11 Feb 2022 06:09:33 -0500 X-MC-Unique: h_Fme-p_OPiSa0ORMPT-nw-1 Received: by mail-lf1-f72.google.com with SMTP id z24-20020a056512371800b0043ea4caa07cso2066478lfr.17 for ; Fri, 11 Feb 2022 03:09:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G8D3Rc9SIkOcfBa1vDejqDTP/HXsHXl7xRg9X0I4XWw=; b=a7AOEaaVrZhWigDK9yrsZFDPHqoTwHpOPpxpA2yJu6crEudB4uh45BRTtzFO6oFwmE BGZWJgfJAriZszh+jtlnuLu1vurgOaSWr+SuoY+b4m2NI83ogWLG6ExJl/YDrz45PdF0 7Bn+wNwUoXOVARRMHPycqG7xbm7CxSKId9GqF9kmvKDTqh6Xc6usE2Vht+epAfGkOjnl Tep70/AWVQCSyb86p/lJdIqf5KgxuyhO3Umf1w3dnL4xYMCf1Qdu9sgYjXoJAAZOGyOw ftKEzeqNpXgwjacxe4+U7ll5cWqCegcqUBy1yc0CogLJR5EcTFO5YEBTaOTbf5Mg9kQ0 hF/g== X-Gm-Message-State: AOAM5316yZRd7ONvawt+SLPSdsaugvSoXyL5cHuzL5GKmqRxT8C3CIz5 qEhf6FdiPaXOY2ekXiUhv/3MZhuBcz685JchHHH9nu/POgEepJ8paLQ4YKeMZkt+8m9CxZKcqlL AweQnWm+9PQ1cREzn4940pJvnFSM6fc45OGGTjxY= X-Received: by 2002:ac2:4f03:: with SMTP id k3mr864295lfr.163.1644577771614; Fri, 11 Feb 2022 03:09:31 -0800 (PST) X-Received: by 2002:ac2:4f03:: with SMTP id k3mr864268lfr.163.1644577771401; Fri, 11 Feb 2022 03:09:31 -0800 (PST) MIME-Version: 1.0 References: <20220209170358.3266629-1-atomlin@redhat.com> <20220209170358.3266629-7-atomlin@redhat.com> In-Reply-To: From: Aaron Tomlin Date: Fri, 11 Feb 2022 11:09:19 +0000 Message-ID: Subject: Re: [PATCH v5 06/13] module: Move strict rwx support to a separate file To: Christophe Leroy Cc: "mcgrof@kernel.org" , "cl@linux.com" , "pmladek@suse.com" , "mbenes@suse.cz" , "akpm@linux-foundation.org" , "jeyu@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-modules@vger.kernel.org" , "live-patching@vger.kernel.org" , "atomlin@atomlin.com" , "ghalat@redhat.com" , "allen.lkml@gmail.com" , "void@manifault.com" , "joe@perches.com" , "msuchanek@suse.de" , "oleksandr@natalenko.name" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2022-02-10 12:21 +0000, Christophe Leroy wrote: > This file generates many checkpatch WARNINGs and CHECKs. > Don't worry too much about the ones telling you to use WARN_ON() instead > of BUG_ON() for the time being, but others should be handled. Yes, with ./scripts/checkpatch.pl --strict'. Please note: I have used '--ignore=ASSIGN_IN_IF,AVOID_BUG' previously on that file. Albeit, I will resolve the check violations e.g. "Alignment should match open parenthesis" etc. > > +# define debug_align(X) ALIGN(X, PAGE_SIZE) > > You can use PAGE_ALIGN() instead. Agreed: PAGE_ALIGN(X) does expand to ALIGN(X, PAGE_SIZE) > > +#ifdef CONFIG_ARCH_HAS_STRICT_MODULE_RWX > > This #ifdef is not needed, frob_text() always exists. I will leave this for you to remove, in your patch [1]. > > + BUG_ON((unsigned long)layout->base & (PAGE_SIZE-1)); > > Could be: > > BUG_ON(!PAGE_ALIGNED(layout->base)); > > > Same for all others. Agreed. [1]: https://lore.kernel.org/lkml/203348805c9ac9851d8939d15cb9802ef047b5e2.1643919758.git.christophe.leroy@csgroup.eu/ Kind regards, -- Aaron Tomlin