LKML Archive on
 help / color / Atom feed
* [PATCH] ubsan: mark ubsan_type_mismatch_common inline
@ 2019-06-17 12:31 Arnd Bergmann
  2019-06-17 14:02 ` Peter Zijlstra
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2019-06-17 12:31 UTC (permalink / raw)
  To: Andrey Ryabinin, akpm
  Cc: Josh Poimboeuf, Peter Zijlstra, linux-kernel, Arnd Bergmann, stable

objtool points out a condition that it does not like:

lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch()+0x4a: call to stackleak_track_stack() with UACCESS enabled
lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch_v1()+0x4a: call to stackleak_track_stack() with UACCESS enabled

I guess this is related to the call ubsan_type_mismatch_common()
not being inline before it calls user_access_restore(), though
I don't fully understand why that is a problem.

Marking the function inline shuts up the warning and might be
the right thing to do. The patch that caused this is marked
for stable backports, so this one should probably be backported
as well.

Fixes: 42440c1f9911 ("lib/ubsan: add type mismatch handler for new GCC/Clang")
Signed-off-by: Arnd Bergmann <>
 lib/ubsan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ubsan.c b/lib/ubsan.c
index ecc179338094..3d8836f0fc5c 100644
--- a/lib/ubsan.c
+++ b/lib/ubsan.c
@@ -309,7 +309,7 @@ static void handle_object_size_mismatch(struct type_mismatch_data_common *data,
-static void ubsan_type_mismatch_common(struct type_mismatch_data_common *data,
+static __always_inline void ubsan_type_mismatch_common(struct type_mismatch_data_common *data,
 				unsigned long ptr)
 	unsigned long flags = user_access_save();

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 12:31 [PATCH] ubsan: mark ubsan_type_mismatch_common inline Arnd Bergmann
2019-06-17 14:02 ` Peter Zijlstra
2019-06-18 12:56   ` Arnd Bergmann
2019-06-18 13:27     ` Andrey Ryabinin
2019-06-18 13:59       ` Peter Zijlstra
2019-06-18 15:06         ` Arnd Bergmann
2019-06-19  7:57           ` Peter Zijlstra

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

	# 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