From patchwork Tue Sep 24 05:08:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 13810107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 701A5CF9C6B for ; Tue, 24 Sep 2024 05:09:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0D226B0089; Tue, 24 Sep 2024 01:09:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC63E6B008A; Tue, 24 Sep 2024 01:09:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B83BE6B008C; Tue, 24 Sep 2024 01:09:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 98C5F6B0089 for ; Tue, 24 Sep 2024 01:09:49 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E15371A17B5 for ; Tue, 24 Sep 2024 05:09:48 +0000 (UTC) X-FDA: 82598454456.08.032933D Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf29.hostedemail.com (Postfix) with ESMTP id 1237512000A for ; Tue, 24 Sep 2024 05:09:46 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="b2ykh/Nk"; spf=pass (imf29.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.182 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727154526; a=rsa-sha256; cv=none; b=bzpGxPoECQUSIt3aXIlIQMYZRMg0UJZSS/swCPqFpomfGnLhIKN0ZkHKFx1HRDaZ+cPPSn 6UYaAkK4ApHrEAA+AdO+xyAxkmV/RiXkgBpyRxS38h4c9yBgvxJRJ3/wnaRcLvsua67Ck9 tA89V6lLNUsoYU+zXKjewlpsn6SGdFs= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="b2ykh/Nk"; spf=pass (imf29.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.182 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727154526; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=ZOYpUvrzwZdtOkSd4gUm2SXn7O9pFSKVomnIDxmxarI=; b=jTWcf6YkJlurWYWBP1RQ8ldAbp/PpC8Q8JsS18aTHGHthWAXzD8kSLMktY3gZBBTx0IEpn dXzjEiAXKL8piYEAA0mkBh5TZMrTTs4P8i0RfgaXGXTPNvA7pNlGnMmehFGgXpvemcmt3h b5DvC3gx6dy+IPScNkWUu+QywXjm71c= Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-718e9c8bd83so4204177b3a.1 for ; Mon, 23 Sep 2024 22:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727154586; x=1727759386; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZOYpUvrzwZdtOkSd4gUm2SXn7O9pFSKVomnIDxmxarI=; b=b2ykh/NkafTGUF3aim5/O0lVvZHMQqWTHdeRhVtNtDKsbVRp7w+yCyH1QlvYy/B7hM uJPZzNWuN84qDvfoSW5x0COjZleEkzgT829dQw9CH/4QfqHpKWxOlWtqMj7kICHeDa0b HbuLQHRTwWFSgwoZkJL528tqvMXvBbnk2VE0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727154586; x=1727759386; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZOYpUvrzwZdtOkSd4gUm2SXn7O9pFSKVomnIDxmxarI=; b=xJpEtxsp1IdPuyt+Uv687bcmHbOvyIMQ0Zny9zGzIYixGepYo4387MPZg9UGWyG2Vw vJPnHKCX/4Bu5rTs8p8CGjhKAbWVl4BPsy8awVTs2xOgvSYc+IuxaM1F7NTX9JCp5Pd+ GN/qwC3RrjecXGxtcP3Hzy2IIAkEEqw/1gj/ITT9pFYirD89laOWxqpvKbrC/NTmrGDV tqRCk9YPIAA2TYUAFF6Kq0EH0W17pVbSqARPF44xAhkp0nDiQmN/s73WUkmmhHLIv7gq nf3nsWNW7KBxFE7beIazllqAC1VH3PAuU+tbQ/gPu/+RRdkfQ+lYpsgENyLgHw9kGSmD Dh5g== X-Forwarded-Encrypted: i=1; AJvYcCUyB4Mb3VHiS4nyyoiL1F+WvCmtGrw/baA0Ov50Dqm9B1cYSC9hCkJkJJEgauhtih8HxGPTwmS0kQ==@kvack.org X-Gm-Message-State: AOJu0Yw+3+/7Ms5uAf6DRHV4TOe+zv4zgPr8CSNsVC0HFL5YQvbcmEkM Kv0qxL54Zmt+ae+Boh5y+5RkCh/j7c3yqyzU1BCl655ElL7Cb9dXMJFCMfVprw== X-Google-Smtp-Source: AGHT+IE+Yf9VOaIeSQAGvHRM9wd8PE6iBTLD4Yw1UXiqbMkcR3rjs2z4coe9TQqe14JyB9eVir5STw== X-Received: by 2002:a05:6a20:d81a:b0:1d2:e458:404b with SMTP id adf61e73a8af0-1d343c60c82mr2895416637.14.1727154585655; Mon, 23 Sep 2024 22:09:45 -0700 (PDT) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:93d1:1107:fd24:adf0]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71afc834175sm435128b3a.43.2024.09.23.22.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 22:09:45 -0700 (PDT) From: Sergey Senozhatsky To: Andrew Morton Cc: Christophe JAILLET , Andrey Skvortsov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCHv2] mm: do not export const kfree and kstrdup variants Date: Tue, 24 Sep 2024 14:08:37 +0900 Message-ID: <20240924050937.697118-1-senozhatsky@chromium.org> X-Mailer: git-send-email 2.46.0.792.g87dc391469-goog MIME-Version: 1.0 X-Stat-Signature: bky8rtxhdfb3seqghi7yp85tp3wnfsbp X-Rspamd-Queue-Id: 1237512000A X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1727154586-64033 X-HE-Meta: U2FsdGVkX19VNgDkRM2T3fNn+nKtiy4TON2p3xy8Huqe1mLoYeZZR8bsvsvR5S0MVDre5ajVVBR4A/s70pKYdgBrkuN/ZsQ1PGLrlpyh9fP+0dPLntn/KjR5hZMTU4W6uIzOVGUwzh8nZoox449Tym20g9XOAISLeSt2zZ+KKMtCnQKyvpS88l+UBYLxNCN6TtFYAiaEk9vkIW1VZjYehk0xbUl7SU/pgPzIBQpB6+9WkhfegnXPTZWWDydcwwMvaiaF+f0Q9l1MZvAztaFxnyo2UL21Xe0ISIfxOxAPpSENywqtXKAhK7UgfyJQK2w34Jl1XN9zY8RfE/WWsu5YnmZ9WQqW7izJJj+VzlU8lKCs04giBNWa9FJKQiMJuh5lhl3Jz9A+bSdtNXwWUl8g6wdEzwLnqF7HxrJ0f5vm6QKH+xIGdeoCj1RGd4cY9xqSZJSocpfGsMXEMHuqH0qWQe7fXg5N49svczXxYx06w/Ka7oZ6/Zsv2m0Q485fvr40LMU1JTBXaZhjP6UN6BaSq3p9O6ACxWAwFMoRoG8msvSN85+mYf3Utr/IkRxobPR2gwLt8Qa76TjvDTQosi0ZCQfmU2o3aoXBq7ee4adajrYHkMI5KN2pKFmb72ZVjsfCLZqSjtUx4BYEBiJkPl6kWl8xwskXrptbZQr6poiRZMt71707cLhZygeP43xd79PkYcTuSrKDPF24NymSPrq7Wz+imXt8lS2UhWMxW/exKZjJ3PD2Olx9F3/NWUrAZ0Sw5nToAgWg1HtAOwHRXELOhZKlBnxqTguLKjcvnZi490Dc55HQuPXQZ69CxpVmAbdMwe7RbfDiM+Z8H+fR447mk8Zcri+Iu9fif1b4JZihtn9sUOZonWHaW3m0cbtsd56HdZTQXDeZAsHmMLxzSh9dVNo4SAvRhfGdRXgo+Y3CoQ6YMmMcdyD1C3ZQLip+hWjU2aEbJYQGKuQx4fjvfIz Hp4aPQGQ baFofLfRhlXNw7AXZ6YNaLsNDQGmhQiyu2v8F+6p+sbYz1KnBFrfJllkBIefKf1dONXPhIrowY57KA+tiEjIWPV58t8Kt2SkTqYNWoJasn2NW7AmP5FUlksat2mxsVRlu/LKS131KpTBIIE0QJ0hrpwn3jNRrlaiANBZ3xhp/4kG/MY3JMkQiZISGTclYSEFX739O9YLqd+p7/1ctGWau9xC09ls4/4m/GEnG9113e0lkV3SQYkU0KiRCgDGb8HdTTbYHA3IKz4YMPa2/NHFHws2sWLPHbAMWGU9a/x6l+9jSb6hIkhyVY/w8g6q/+oeGofqTe+bJM9r5OBa2ZYY9oy54XepAI7hAlyjjzKX/GNfMR8mB9sNZ/dQQjg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Both kfree_const() and kstrdup_const() use __start_rodata and __end_rodata, which do not work for modules. This is especially important for kfree_const(). Stop exporting these functions, as they cannot be used in the modules. Signed-off-by: Sergey Senozhatsky --- mm/util.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/util.c b/mm/util.c index 4f1275023eb7..24dadbd5727a 100644 --- a/mm/util.c +++ b/mm/util.c @@ -42,7 +42,6 @@ void kfree_const(const void *x) if (!is_kernel_rodata((unsigned long)x)) kfree(x); } -EXPORT_SYMBOL(kfree_const); /** * kstrdup - allocate space for and copy an existing string @@ -86,7 +85,6 @@ const char *kstrdup_const(const char *s, gfp_t gfp) return kstrdup(s, gfp); } -EXPORT_SYMBOL(kstrdup_const); /** * kstrndup - allocate space for and copy an existing string