LKML Archive on
 help / color / Atom feed
From: Paul Bolle <>
To: Eric Biederman <>
Cc: Maximilian Attems <>,
	Andrew Morton <>,
	Linus Torvalds <>,,
Subject: [PATCH] kexec.h: stop exporting kexec_load() to userspace
Date: Wed, 15 Jan 2014 14:17:04 +0100
Message-ID: <1389791824.17407.9.camel@x220> (raw)

Since v3.5 kexec.h is exported to userspace. That includes its
declaration of kexec_load():
    extern int kexec_load(void *, size_t, struct kexec_segment *,
                   unsigned long int);

This declaration isn't very useful to userspace programs on itself. They
still have to define a matching function (which basically wraps the
kexec_load syscall). I'm not aware of programs or libraries that actually
do that.

It can be removed. The programs that actually use it, if there
are any, should then provide their own declaration to keep compiling.
Already compiled binaries will not be affected.

This gets rid of the headers_check warning that can be seen ever since
this header was exported:
    [...]/usr/include/linux/kexec.h:49: userspace cannot reference function or variable defined in the kernel

Signed-off-by: Paul Bolle <>
This declaration of kexec_load() was added to kexec.h in commit
29a5c67e7a ("kexec: export kexec.h to user space").

 include/uapi/linux/kexec.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
index 104838f..c7897b6 100644
--- a/include/uapi/linux/kexec.h
+++ b/include/uapi/linux/kexec.h
@@ -42,13 +42,6 @@ struct kexec_segment {
 	const void *mem;
 	size_t memsz;
-/* Load a new kernel image as described by the kexec_segment array
- * consisting of passed number of segments at the entry-point address.
- * The flags allow different useage types.
- */
-extern int kexec_load(void *, size_t, struct kexec_segment *,
-		unsigned long int);
 #endif /* __KERNEL__ */
 #endif /* _UAPILINUX_KEXEC_H */

             reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 13:17 Paul Bolle [this message]
2014-01-15 13:38 ` Maximilian Attems
2014-01-15 14:12   ` Paul Bolle
2014-01-15 15:28   ` H. Peter Anvin

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1389791824.17407.9.camel@x220 \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git
	git clone --mirror lkml/git/10.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone