Skip to contentSkip to conversation

s390x: explicitly mark stack as not executable

PATCH In review Nico Boehr 3 participants 4 messages Aug 9, 2023 – Sep 4, 2023

Subsystems (2)
lore
Share & tools
lore

Nico Boehr

author
#0 lore raw

PATCH 1/1 s390x: explicitly mark stack as not executable

With somewhat recent GCC versions, we get this warning on s390x:

/usr/bin/ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies executable stack /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

We don't really care whether stack is executable or not since we set it up ourselves and we're running DAT off mostly anyways.

Silence the warning by explicitly marking the stack as not executable.

---
 s390x/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
s390x/Makefile +1 -1
index 706be7920406..afa47ccbeb93 100644
@@ -79,7 +79,7 @@ CFLAGS += -O2
 CFLAGS += -march=zEC12
 CFLAGS += -mbackchain
 CFLAGS += -fno-delete-null-pointer-checks
-LDFLAGS += -nostdlib -Wl,--build-id=none
+LDFLAGS += -nostdlib -Wl,--build-id=none -z noexecstack
 
 # We want to keep intermediate files
 .PRECIOUS: %.o %.lds
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · On Wed, 9 Aug 2023 11:17:08 +0200 Nico Boehr <[email protected]> wrote:

With somewhat recent GCC versions, we get this warning on s390x:

/usr/bin/ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies executable stack /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

We don't really care whether stack is executable or not since we set it up ourselves and we're running DAT off mostly anyways.

Silence the warning by explicitly marking the stack as not executable.

Quoted 17 lines
---
 s390x/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
s390x/Makefile +1 -1
index 706be7920406..afa47ccbeb93 100644
@@ -79,7 +79,7 @@ CFLAGS += -O2
 CFLAGS += -march=zEC12
 CFLAGS += -mbackchain
 CFLAGS += -fno-delete-null-pointer-checks
-LDFLAGS += -nostdlib -Wl,--build-id=none
+LDFLAGS += -nostdlib -Wl,--build-id=none -z noexecstack
 
 # We want to keep intermediate files
 .PRECIOUS: %.o %.lds
#2 lore raw
In reply to Nico Boehr
Quoted 20 lines · Nico Boehr

With somewhat recent GCC versions, we get this warning on s390x:

/usr/bin/ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies executable stack /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

We don't really care whether stack is executable or not since we set it up ourselves and we're running DAT off mostly anyways.

Silence the warning by explicitly marking the stack as not executable.

---
  s390x/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
s390x/Makefile +0 -0
index 706be7920406..afa47ccbeb93 100644

s390x/Makefile CFLAGS += -O2 · line 82

Quoted 5 lines
s390x/Makefile +1 -1
@@ -79,7 +79,7 @@ CFLAGS += -O2
  CFLAGS += -march=zEC12
  CFLAGS += -mbackchain
  CFLAGS += -fno-delete-null-pointer-checks
-LDFLAGS += -nostdlib -Wl,--build-id=none
+LDFLAGS += -nostdlib -Wl,--build-id=none -z noexecstack

I already did a similar patch some weeks ago:

https://lore.kernel.org/kvm/[email protected]/

... we need it for x86, too, so I guess I should go ahead and commit it - and ask Sean to respin his conflicting series.

Thomas

author
#3 lore raw

Quoting Thomas Huth (2023-08-13 11:50:00)

Quoted 29 lines · Nico Boehr
Quoted 20 lines

With somewhat recent GCC versions, we get this warning on s390x:

/usr/bin/ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies executable stack /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

We don't really care whether stack is executable or not since we set it up ourselves and we're running DAT off mostly anyways.

Silence the warning by explicitly marking the stack as not executable.

---
  s390x/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
s390x/Makefile +0 -0
index 706be7920406..afa47ccbeb93 100644

s390x/Makefile CFLAGS += -O2 · line 82

Quoted 5 lines
s390x/Makefile +1 -1
@@ -79,7 +79,7 @@ CFLAGS += -O2
  CFLAGS += -march=zEC12
  CFLAGS += -mbackchain
  CFLAGS += -fno-delete-null-pointer-checks
-LDFLAGS += -nostdlib -Wl,--build-id=none
+LDFLAGS += -nostdlib -Wl,--build-id=none -z noexecstack

I already did a similar patch some weeks ago:

Quoted 4 lines

https://lore.kernel.org/kvm/[email protected]/

... we need it for x86, too, so I guess I should go ahead and commit it - and ask Sean to respin his conflicting series.

Thanks!