Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp797208rda; Sun, 22 Oct 2023 10:06:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6OVstPMzLfDfDUWujFAY+JTm39VYp+0ZMvWEGGk9pQ3anIvodhcglzRjrjym9O8u9aJRQ X-Received: by 2002:a05:6a20:a128:b0:16a:4f24:d30 with SMTP id q40-20020a056a20a12800b0016a4f240d30mr8634726pzk.53.1697994404970; Sun, 22 Oct 2023 10:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697994404; cv=none; d=google.com; s=arc-20160816; b=IOsvgh/LIzw0o9sgY3ios08j8HQN3XOj/zFwIugHlvpPhNGoMcvcbeHXjy7SQ80BD2 3tCFV6pvV88j/pgXNQ3ejVxwD8hvkITgofChGP5dMHwGYWlHT+OnH+fOW2wF5y7oR1UB 0+koLDl1Oa7Q+Iw/k/WMziLIxoLExDl32fxGK9YujIkETdfnPbaHicJ7CJH4aaN89Vx9 8wUEvrNoI1R4g2bcApwlrmBwCfCqLuUrMyVG+o9+vq6VdMtNiKm5eo1Y8VxWIE7MaEkw dEs2+t6A9gME/cEa7Bu7FFe2kORtPIyayJoLCXsinqMawJD7A8OzgUgjN3y7jyasPjMf LAAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jZOHc4PoFnGPPR/xgDPufwrr/0y9kUMxp8KfE+Gq+ko=; fh=wKrPioF+0wPaktGqmf0aQvlk8PY4Pc32rTAsBSAiP8I=; b=qIJMhpTkDxvdCITu3LyXIdfnUZ1qCaEObkbVX93MsXFvTOMhv6eFYcfzlqS2ZbKPie F21SevIC+MBInJqVQjhcmBabZ5vkzaCeMA3X2fo1WepMuJGJ99bmimSvnme6YhEKd4V8 Xbgi2SD2A693uMVEmCy+uJ8qp5U4vbsofzeRkXm2X/ZVJyRm0SDC8LRYQFPovvBYAYP8 uvBQtMBj1Evs0NfXUHVqoYRvQ7pB199ev2lewX8SQECgNwVIwlmdprpd8mrMgAZd3Azt nC8t25yxuqw8bJk4Cn8e8e2rB9XD/hsbGWo3MYa33YCj1L9msVjHGZWPuvbJyv/xVIQl I5Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jg1DbiRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h17-20020a633851000000b005abfb781154si5200334pgn.97.2023.10.22.10.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 10:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jg1DbiRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3AD2A80A73C5; Sun, 22 Oct 2023 10:06:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232462AbjJVRGZ (ORCPT + 99 others); Sun, 22 Oct 2023 13:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232225AbjJVRGW (ORCPT ); Sun, 22 Oct 2023 13:06:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E465EE; Sun, 22 Oct 2023 10:06:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B20DEC433C7; Sun, 22 Oct 2023 17:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697994380; bh=aTiLuP4Ust/jrgVbBMYTU3kLN1U+pxnaKRT4WTs91Ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jg1DbiRh1IPvX12jNdpnak/QyZ5ZFyN8mhTCC/tRkLBZJ7Zl6krum94admfzOjbF2 03KncXSoHzbgA10LiuocV6c9uwjMhSDExdWQsjEfoLbjxpoyY124uLqdHvGA9dPRYi asL6tVM7itdGLLRG8DYxhibwXqk6VZ3bPaZyEnClc8ZGCoQn6PEm7I+6SMJxiZGL+f GKR0NpucI7AguDOxFi5AJeTc3MvY8FNKZvBbP3kZtw9nUO5K4+yMZejfCKsGMf4hsT LfdWazAAiQJ2YSdQh3a283unvXZ/W3xKEXfddBEFnm7E7XAsRfRXbTbXRdLxf85Olo vY7j18pTmyHyQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 03/10] modpost: disallow *driver to reference .meminit* sections Date: Mon, 23 Oct 2023 02:06:06 +0900 Message-Id: <20231022170613.2072838-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231022170613.2072838-1-masahiroy@kernel.org> References: <20231022170613.2072838-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 22 Oct 2023 10:06:34 -0700 (PDT) Drivers must not reference .meminit* sections, which are discarded when CONFIG_MEMORY_HOTPLUG=n. The reason for whitelisting "*driver" in the section mismatch check was to allow drivers to reference symbols annotated as __devinit or __devexit that existed in the past. Those annotations were removed by the following commits: - 54b956b90360 ("Remove __dev* markings from init.h") - 92e9e6d1f984 ("modpost.c: Stop checking __dev* section mismatches") Remove the wrong whitelist. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index bcc334b28a2c..792ba9da0f27 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1006,12 +1006,6 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, "*_console"))) return 0; - /* symbols in data sections that may refer to meminit sections */ - if (match(fromsec, PATTERNS(DATA_SECTIONS)) && - match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) && - match(fromsym, PATTERNS("*driver"))) - return 0; - /* * symbols in data sections must not refer to .exit.*, but there are * quite a few offenders, so hide these unless for W=1 builds until -- 2.40.1