From: Kees Cook <kees@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Brian Mak <makb@juniper.net>, Arnd Bergmann <arnd@arndb.de>,
David Hildenbrand <david@redhat.com>,
Peter Xu <peterx@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>,
John Hubbard <jhubbard@nvidia.com>,
Steve Sistare <steven.sistare@oracle.com>,
Vivek Kasireddy <vivek.kasireddy@intel.com>,
Yang Shi <yang@os.amperecomputing.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: unhide get_dump_page() function
Date: Mon, 24 Feb 2025 10:40:19 -0800 [thread overview]
Message-ID: <202502241038.A4A1ED25A1@keescook> (raw)
In-Reply-To: <20250224151225.3637934-1-arnd@kernel.org>
On Mon, Feb 24, 2025 at 04:12:21PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The definition of get_dump_page() is guarded by CONFIG_ELF_CORE, but
> the caller has now moved into a function that is built based on
> CONFIG_COREDUMP, which leads to a possible link failure:
>
> ld.lld-21: error: undefined symbol: get_dump_page
> >>> referenced by coredump.c
> >>> fs/coredump.o:(dump_vma_snapshot) in archive vmlinux.a
>
> Change the #ifdef block around the definition to match the caller.
> In practice there is very little difference, as setting COREDUMP
> but not ELF_CORE is not useful.
>
> Fixes: ff41385709f0 ("coredump: Only sort VMAs when truncating or core_sort_vma sysctl is set")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for this! I think I'm going to split up ff41385709f0 -- between
this #ifdef and the recent prototype changes, it's going to be not a
great backport, so I'll pick this up too. I expect I'll have a simple
sysctl fix for -rc5 and then the rest in -next.
-Kees
> ---
> mm/gup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index d846c0ce41d6..15d6d7b5df1d 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -2266,7 +2266,7 @@ EXPORT_SYMBOL(fault_in_readable);
> *
> * Called without mmap_lock (takes and releases the mmap_lock by itself).
> */
> -#ifdef CONFIG_ELF_CORE
> +#ifdef CONFIG_COREDUMP
> struct page *get_dump_page(unsigned long addr, int *locked)
> {
> struct page *page;
> @@ -2276,7 +2276,7 @@ struct page *get_dump_page(unsigned long addr, int *locked)
> FOLL_FORCE | FOLL_DUMP | FOLL_GET);
> return (ret == 1) ? page : NULL;
> }
> -#endif /* CONFIG_ELF_CORE */
> +#endif /* CONFIG_COREDUMP */
>
> #ifdef CONFIG_MIGRATION
>
> --
> 2.39.5
>
--
Kees Cook
next prev parent reply other threads:[~2025-02-24 18:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 15:12 Arnd Bergmann
2025-02-24 18:40 ` Kees Cook [this message]
2025-02-24 18:42 ` Brian Mak
2025-02-24 19:06 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202502241038.A4A1ED25A1@keescook \
--to=kees@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=david@redhat.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=makb@juniper.net \
--cc=peterx@redhat.com \
--cc=steven.sistare@oracle.com \
--cc=vivek.kasireddy@intel.com \
--cc=yang@os.amperecomputing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox