linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch/x86/um: Disable UBSAN sanitization
@ 2024-05-13 12:27 Roberto Sassu
  2024-05-13 12:29 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Roberto Sassu @ 2024-05-13 12:27 UTC (permalink / raw)
  To: richard, anton.ivanov, johannes, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-um, linux-kernel, zohar, linux-integrity, Roberto Sassu

From: Roberto Sassu <roberto.sassu@huawei.com>

Disable UBSAN sanitization on UML, since UML does not support it.

This fixes the error message when building the kernel:

  CALL    scripts/checksyscalls.sh
  VDSO    arch/x86/um/vdso/vdso.so.dbg
arch/x86/um/vdso/vdso.so.dbg: undefined symbols found

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
---
 arch/x86/um/vdso/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/um/vdso/Makefile b/arch/x86/um/vdso/Makefile
index b86d634730b2..ca79c0de582e 100644
--- a/arch/x86/um/vdso/Makefile
+++ b/arch/x86/um/vdso/Makefile
@@ -3,8 +3,10 @@
 # Building vDSO images for x86.
 #
 
-# do not instrument on vdso because KASAN is not compatible with user mode
+# do not instrument on vdso because KASAN/UBSAN are not compatible with user
+# mode
 KASAN_SANITIZE			:= n
+UBSAN_SANITIZE			:= n
 
 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
 KCOV_INSTRUMENT                := n
-- 
2.34.1


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

* Re: [PATCH] arch/x86/um: Disable UBSAN sanitization
  2024-05-13 12:27 [PATCH] arch/x86/um: Disable UBSAN sanitization Roberto Sassu
@ 2024-05-13 12:29 ` Johannes Berg
  2024-05-13 12:42   ` Roberto Sassu
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2024-05-13 12:29 UTC (permalink / raw)
  To: Roberto Sassu, richard, anton.ivanov, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-um, linux-kernel, zohar, linux-integrity, Roberto Sassu

On Mon, 2024-05-13 at 14:27 +0200, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@huawei.com>
> 
> Disable UBSAN sanitization on UML, since UML does not support it.
> 

Luckily, that isn't actually true, nor does it actually do this at all.
Please fix the commit message.

johannes

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

* Re: [PATCH] arch/x86/um: Disable UBSAN sanitization
  2024-05-13 12:29 ` Johannes Berg
@ 2024-05-13 12:42   ` Roberto Sassu
  2024-05-13 12:52     ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Roberto Sassu @ 2024-05-13 12:42 UTC (permalink / raw)
  To: Johannes Berg, richard, anton.ivanov, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-um, linux-kernel, zohar, linux-integrity, Roberto Sassu

On Mon, 2024-05-13 at 14:29 +0200, Johannes Berg wrote:
> On Mon, 2024-05-13 at 14:27 +0200, Roberto Sassu wrote:
> > From: Roberto Sassu <roberto.sassu@huawei.com>
> > 
> > Disable UBSAN sanitization on UML, since UML does not support it.
> > 
> 
> Luckily, that isn't actually true, nor does it actually do this at all.
> Please fix the commit message.

Thanks, I was actually wondering. I based that statement based on
ARCH_HAS_UBSAN=n.

Any other solution would be ok.

Thanks

Roberto


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

* Re: [PATCH] arch/x86/um: Disable UBSAN sanitization
  2024-05-13 12:42   ` Roberto Sassu
@ 2024-05-13 12:52     ` Johannes Berg
  2024-05-13 12:58       ` Roberto Sassu
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2024-05-13 12:52 UTC (permalink / raw)
  To: Roberto Sassu, richard, anton.ivanov, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-um, linux-kernel, zohar, linux-integrity, Roberto Sassu

On Mon, 2024-05-13 at 14:42 +0200, Roberto Sassu wrote:
> On Mon, 2024-05-13 at 14:29 +0200, Johannes Berg wrote:
> > On Mon, 2024-05-13 at 14:27 +0200, Roberto Sassu wrote:
> > > From: Roberto Sassu <roberto.sassu@huawei.com>
> > > 
> > > Disable UBSAN sanitization on UML, since UML does not support it.
> > > 
> > 
> > Luckily, that isn't actually true, nor does it actually do this at all.
> > Please fix the commit message.
> 
> Thanks, I was actually wondering. I based that statement based on
> ARCH_HAS_UBSAN=n.
> 
> Any other solution would be ok.

Not sure I get it. What you're doing in the patch is perfectly fine and
almost certainly required, but you're definitely not disabling UBSAN on
ARCH=um as you described in the commit message?

johannes

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

* Re: [PATCH] arch/x86/um: Disable UBSAN sanitization
  2024-05-13 12:52     ` Johannes Berg
@ 2024-05-13 12:58       ` Roberto Sassu
  2024-05-13 13:08         ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Roberto Sassu @ 2024-05-13 12:58 UTC (permalink / raw)
  To: Johannes Berg, richard, anton.ivanov, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-um, linux-kernel, zohar, linux-integrity, Roberto Sassu

On Mon, 2024-05-13 at 14:52 +0200, Johannes Berg wrote:
> On Mon, 2024-05-13 at 14:42 +0200, Roberto Sassu wrote:
> > On Mon, 2024-05-13 at 14:29 +0200, Johannes Berg wrote:
> > > On Mon, 2024-05-13 at 14:27 +0200, Roberto Sassu wrote:
> > > > From: Roberto Sassu <roberto.sassu@huawei.com>
> > > > 
> > > > Disable UBSAN sanitization on UML, since UML does not support it.
> > > > 
> > > 
> > > Luckily, that isn't actually true, nor does it actually do this at all.
> > > Please fix the commit message.
> > 
> > Thanks, I was actually wondering. I based that statement based on
> > ARCH_HAS_UBSAN=n.
> > 
> > Any other solution would be ok.
> 
> Not sure I get it. What you're doing in the patch is perfectly fine and
> almost certainly required, but you're definitely not disabling UBSAN on
> ARCH=um as you described in the commit message?

Ok, I guess the right word is instrumentation (got it from commit
d4be85d068b44). And the reason is that the vDSO is executing in user
space. Will fix it.

Thanks

Roberto


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

* Re: [PATCH] arch/x86/um: Disable UBSAN sanitization
  2024-05-13 12:58       ` Roberto Sassu
@ 2024-05-13 13:08         ` Johannes Berg
  2024-05-13 13:16           ` Roberto Sassu
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2024-05-13 13:08 UTC (permalink / raw)
  To: Roberto Sassu, richard, anton.ivanov, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-um, linux-kernel, zohar, linux-integrity, Roberto Sassu

On Mon, 2024-05-13 at 14:58 +0200, Roberto Sassu wrote:
> On Mon, 2024-05-13 at 14:52 +0200, Johannes Berg wrote:
> > On Mon, 2024-05-13 at 14:42 +0200, Roberto Sassu wrote:
> > > On Mon, 2024-05-13 at 14:29 +0200, Johannes Berg wrote:
> > > > On Mon, 2024-05-13 at 14:27 +0200, Roberto Sassu wrote:
> > > > > From: Roberto Sassu <roberto.sassu@huawei.com>
> > > > > 
> > > > > Disable UBSAN sanitization on UML, since UML does not support it.
> > > > > 
> > > > 
> > > > Luckily, that isn't actually true, nor does it actually do this at all.
> > > > Please fix the commit message.
> > > 
> > > Thanks, I was actually wondering. I based that statement based on
> > > ARCH_HAS_UBSAN=n.
> > > 
> > > Any other solution would be ok.
> > 
> > Not sure I get it. What you're doing in the patch is perfectly fine and
> > almost certainly required, but you're definitely not disabling UBSAN on
> > ARCH=um as you described in the commit message?
> 
> Ok, I guess the right word is instrumentation (got it from commit
> d4be85d068b44). And the reason is that the vDSO is executing in user
> space. Will fix it.

No, UBSAN is fine, but you're only disabling it for the vDSO :) The
commit message doesn't even mention the vDSO though.

johannes

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

* Re: [PATCH] arch/x86/um: Disable UBSAN sanitization
  2024-05-13 13:08         ` Johannes Berg
@ 2024-05-13 13:16           ` Roberto Sassu
  0 siblings, 0 replies; 7+ messages in thread
From: Roberto Sassu @ 2024-05-13 13:16 UTC (permalink / raw)
  To: Johannes Berg, richard, anton.ivanov, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, linux-um, linux-kernel, zohar, linux-integrity, Roberto Sassu

On Mon, 2024-05-13 at 15:08 +0200, Johannes Berg wrote:
> On Mon, 2024-05-13 at 14:58 +0200, Roberto Sassu wrote:
> > On Mon, 2024-05-13 at 14:52 +0200, Johannes Berg wrote:
> > > On Mon, 2024-05-13 at 14:42 +0200, Roberto Sassu wrote:
> > > > On Mon, 2024-05-13 at 14:29 +0200, Johannes Berg wrote:
> > > > > On Mon, 2024-05-13 at 14:27 +0200, Roberto Sassu wrote:
> > > > > > From: Roberto Sassu <roberto.sassu@huawei.com>
> > > > > > 
> > > > > > Disable UBSAN sanitization on UML, since UML does not support it.
> > > > > > 
> > > > > 
> > > > > Luckily, that isn't actually true, nor does it actually do this at all.
> > > > > Please fix the commit message.
> > > > 
> > > > Thanks, I was actually wondering. I based that statement based on
> > > > ARCH_HAS_UBSAN=n.
> > > > 
> > > > Any other solution would be ok.
> > > 
> > > Not sure I get it. What you're doing in the patch is perfectly fine and
> > > almost certainly required, but you're definitely not disabling UBSAN on
> > > ARCH=um as you described in the commit message?
> > 
> > Ok, I guess the right word is instrumentation (got it from commit
> > d4be85d068b44). And the reason is that the vDSO is executing in user
> > space. Will fix it.
> 
> No, UBSAN is fine, but you're only disabling it for the vDSO :) The
> commit message doesn't even mention the vDSO though.

You are right, the commit message was misleading without vDSO.

Thanks

Roberto


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

end of thread, other threads:[~2024-05-13 13:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13 12:27 [PATCH] arch/x86/um: Disable UBSAN sanitization Roberto Sassu
2024-05-13 12:29 ` Johannes Berg
2024-05-13 12:42   ` Roberto Sassu
2024-05-13 12:52     ` Johannes Berg
2024-05-13 12:58       ` Roberto Sassu
2024-05-13 13:08         ` Johannes Berg
2024-05-13 13:16           ` Roberto Sassu

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).