linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-um@lists.infradead.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 2/4] um: don't export printf()
Date: Fri, 10 Feb 2023 22:05:09 +0100	[thread overview]
Message-ID: <20230210220511.d230e7374dac.Ib7df1cfd6f3b55ad7fe4f3a931e4562ba9d6edda@changeid> (raw)
In-Reply-To: <20230210220511.fe9e2c4d805b.I2c7f7e32c861bfb10ff13860e80ef7daf4f60df9@changeid>

From: Johannes Berg <johannes.berg@intel.com>

Since printf() cannot be used in kernel threads (it
uses too much stack space) don't export it for modules
either.

This should leave us exporting only things that are
absolutely critical (such as memset and friends) and
things that are injected by the compiler (stack guard
and similar.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 arch/um/os-Linux/user_syms.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 22ed13a9b3e7..1e9e92740b32 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -18,7 +18,6 @@
 extern size_t strlen(const char *);
 extern void *memmove(void *, const void *, size_t);
 extern void *memset(void *, int, size_t);
-extern int printf(const char *, ...);
 
 /* If it's not defined, the export is included in lib/string.c.*/
 #ifdef __HAVE_ARCH_STRSTR
@@ -32,8 +31,6 @@ EXPORT_SYMBOL(memmove);
 EXPORT_SYMBOL(memset);
 #endif
 
-EXPORT_SYMBOL(printf);
-
 #ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
 EXPORT_SYMBOL(vsyscall_ehdr);
 EXPORT_SYMBOL(vsyscall_end);
-- 
2.39.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

  reply	other threads:[~2023-02-10 21:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 21:05 [PATCH 1/4] um: hostfs: define our own API boundary Johannes Berg
2023-02-10 21:05 ` Johannes Berg [this message]
2023-02-10 21:05 ` [PATCH 3/4] um: further clean up user_syms Johannes Berg
2023-02-10 21:05 ` [PATCH 4/4] um: prevent user code in modules Johannes Berg

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=20230210220511.d230e7374dac.Ib7df1cfd6f3b55ad7fe4f3a931e4562ba9d6edda@changeid \
    --to=johannes@sipsolutions.net \
    --cc=johannes.berg@intel.com \
    --cc=linux-um@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).