linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>, akpm@linux-foundation.org
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	stable@vger.kernel.org
Subject: [PATCH] ubsan: mark ubsan_type_mismatch_common inline
Date: Mon, 17 Jun 2019 14:31:09 +0200	[thread overview]
Message-ID: <20190617123109.667090-1-arnd@arndb.de> (raw)

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")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 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,
 	ubsan_epilogue(&flags);
 }
 
-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();
-- 
2.20.0


             reply	other threads:[~2019-06-17 12:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 12:31 Arnd Bergmann [this message]
2019-06-17 14:02 ` [PATCH] ubsan: mark ubsan_type_mismatch_common inline 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

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=20190617123109.667090-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.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).