* [PATCH] check-execstack: Permit sysdeps to xfail some libs
@ 2018-06-13 20:38 Samuel Thibault
2018-06-23 22:53 ` Samuel Thibault
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Thibault @ 2018-06-13 20:38 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault
* scripts/check-execstack.awk: Consider `xfail' variable containing a list
of libraries whose stack executability is expected.
* elf/Makefile ($(objpfx)check-execstack.out): Pass
$(check-execstack-xfail) to check-execstack.awk through `xfail' variable.
* sysdeps/mach/hurd/i386/Makefile (check-execstack-xfail): Set to ld.so
libc.so libpthread.so.
---
elf/Makefile | 2 +-
scripts/check-execstack.awk | 27 ++++++++++++++++++++++-----
sysdeps/mach/hurd/i386/Makefile | 6 ++++++
3 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/elf/Makefile b/elf/Makefile
index f221422de3..b55f457d98 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1094,7 +1094,7 @@ common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr)
$(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \
$(objpfx)execstack-default \
$(all-built-dso:=.phdr)
- LC_ALL=C $(AWK) -f $^ > $@; \
+ LC_ALL=C $(AWK) -v "xfail=$(check-execstack-xfail)" -f $^ > $@; \
$(evaluate-test)
generated += check-execstack.out
diff --git a/scripts/check-execstack.awk b/scripts/check-execstack.awk
index 21d37e9f47..cd6b30ed3c 100644
--- a/scripts/check-execstack.awk
+++ b/scripts/check-execstack.awk
@@ -6,7 +6,12 @@
# It fails (1) if any did indicate executable stack.
# It fails (2) if the input did not take the expected form.
-BEGIN { result = sanity = 0; default_exec = -1 }
+BEGIN {
+ result = sanity = 0; default_exec = -1;
+ split(xfail, xfails, " ");
+ for (x in xfails)
+ expected_fails[xfails[x] ".phdr"] = 1;
+}
/^execstack-no$/ { default_exec = 0; next }
/^execstack-yes$/ { default_exec = 1; next }
@@ -17,6 +22,10 @@ function check_one(name) {
result = 2;
}
+ n = split(name, parts, "/");
+ basename = parts[n];
+ expected_fail = basename in expected_fails;
+
if (!sanity) {
print name ": *** input did not look like readelf -l output";
result = 2;
@@ -24,12 +33,20 @@ function check_one(name) {
if (stack_line ~ /^.*RW .*$/) {
print name ": OK";
} else if (stack_line ~ /^.*E.*$/) {
- print name ": *** executable stack signaled";
- result = result ? result : 1;
+ if (expected_fail) {
+ print name ": *** executable stack signaled, expected";
+ } else {
+ print name ": *** executable stack signaled";
+ result = result ? result : 1;
+ }
}
} else if (default_exec) {
- print name ": *** no PT_GNU_STACK entry";
- result = result ? result : 1;
+ if (expected_fail) {
+ print name ": *** no PT_GNU_STACK entry, expected";
+ } else {
+ print name ": *** no PT_GNU_STACK entry";
+ result = result ? result : 1;
+ }
} else {
print name ": no PT_GNU_STACK but default is OK";
}
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index 0b509d9499..9a824fadf3 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -96,3 +96,9 @@ endif
ifeq ($(subdir),mach)
test-xfail-check-abi-libmachuser = yes
endif
+
+ifeq ($(subdir),elf)
+# We do use nested functions involving creation of trampolines, notably for
+# callbacks whose parameters don't permit to get the context parameters.
+check-execstack-xfail += ld.so libc.so libpthread.so
+endif
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] check-execstack: Permit sysdeps to xfail some libs
2018-06-13 20:38 [PATCH] check-execstack: Permit sysdeps to xfail some libs Samuel Thibault
@ 2018-06-23 22:53 ` Samuel Thibault
2018-07-15 14:45 ` Samuel Thibault
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Thibault @ 2018-06-23 22:53 UTC (permalink / raw)
To: libc-alpha
Hello,
Samuel Thibault, le mer. 13 juin 2018 22:38:28 +0200, a ecrit:
> * scripts/check-execstack.awk: Consider `xfail' variable containing a list
> of libraries whose stack executability is expected.
> * elf/Makefile ($(objpfx)check-execstack.out): Pass
> $(check-execstack-xfail) to check-execstack.awk through `xfail' variable.
> * sysdeps/mach/hurd/i386/Makefile (check-execstack-xfail): Set to ld.so
> libc.so libpthread.so.
Ping?
> ---
> elf/Makefile | 2 +-
> scripts/check-execstack.awk | 27 ++++++++++++++++++++++-----
> sysdeps/mach/hurd/i386/Makefile | 6 ++++++
> 3 files changed, 29 insertions(+), 6 deletions(-)
>
> diff --git a/elf/Makefile b/elf/Makefile
> index f221422de3..b55f457d98 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -1094,7 +1094,7 @@ common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr)
> $(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \
> $(objpfx)execstack-default \
> $(all-built-dso:=.phdr)
> - LC_ALL=C $(AWK) -f $^ > $@; \
> + LC_ALL=C $(AWK) -v "xfail=$(check-execstack-xfail)" -f $^ > $@; \
> $(evaluate-test)
> generated += check-execstack.out
>
> diff --git a/scripts/check-execstack.awk b/scripts/check-execstack.awk
> index 21d37e9f47..cd6b30ed3c 100644
> --- a/scripts/check-execstack.awk
> +++ b/scripts/check-execstack.awk
> @@ -6,7 +6,12 @@
> # It fails (1) if any did indicate executable stack.
> # It fails (2) if the input did not take the expected form.
>
> -BEGIN { result = sanity = 0; default_exec = -1 }
> +BEGIN {
> + result = sanity = 0; default_exec = -1;
> + split(xfail, xfails, " ");
> + for (x in xfails)
> + expected_fails[xfails[x] ".phdr"] = 1;
> +}
>
> /^execstack-no$/ { default_exec = 0; next }
> /^execstack-yes$/ { default_exec = 1; next }
> @@ -17,6 +22,10 @@ function check_one(name) {
> result = 2;
> }
>
> + n = split(name, parts, "/");
> + basename = parts[n];
> + expected_fail = basename in expected_fails;
> +
> if (!sanity) {
> print name ": *** input did not look like readelf -l output";
> result = 2;
> @@ -24,12 +33,20 @@ function check_one(name) {
> if (stack_line ~ /^.*RW .*$/) {
> print name ": OK";
> } else if (stack_line ~ /^.*E.*$/) {
> - print name ": *** executable stack signaled";
> - result = result ? result : 1;
> + if (expected_fail) {
> + print name ": *** executable stack signaled, expected";
> + } else {
> + print name ": *** executable stack signaled";
> + result = result ? result : 1;
> + }
> }
> } else if (default_exec) {
> - print name ": *** no PT_GNU_STACK entry";
> - result = result ? result : 1;
> + if (expected_fail) {
> + print name ": *** no PT_GNU_STACK entry, expected";
> + } else {
> + print name ": *** no PT_GNU_STACK entry";
> + result = result ? result : 1;
> + }
> } else {
> print name ": no PT_GNU_STACK but default is OK";
> }
> diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
> index 0b509d9499..9a824fadf3 100644
> --- a/sysdeps/mach/hurd/i386/Makefile
> +++ b/sysdeps/mach/hurd/i386/Makefile
> @@ -96,3 +96,9 @@ endif
> ifeq ($(subdir),mach)
> test-xfail-check-abi-libmachuser = yes
> endif
> +
> +ifeq ($(subdir),elf)
> +# We do use nested functions involving creation of trampolines, notably for
> +# callbacks whose parameters don't permit to get the context parameters.
> +check-execstack-xfail += ld.so libc.so libpthread.so
> +endif
> --
> 2.17.1
>
--
Samuel
/*
* [...] Note that 120 sec is defined in the protocol as the maximum
* possible RTT. I guess we'll have to use something other than TCP
* to talk to the University of Mars.
* PAWS allows us longer timeouts and large windows, so once implemented
* ftp to mars will work nicely.
*/
(from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] check-execstack: Permit sysdeps to xfail some libs
2018-06-23 22:53 ` Samuel Thibault
@ 2018-07-15 14:45 ` Samuel Thibault
0 siblings, 0 replies; 3+ messages in thread
From: Samuel Thibault @ 2018-07-15 14:45 UTC (permalink / raw)
To: libc-alpha
Hello,
Samuel Thibault, le dim. 24 juin 2018 00:53:19 +0200, a ecrit:
> Samuel Thibault, le mer. 13 juin 2018 22:38:28 +0200, a ecrit:
> > * scripts/check-execstack.awk: Consider `xfail' variable containing a list
> > of libraries whose stack executability is expected.
> > * elf/Makefile ($(objpfx)check-execstack.out): Pass
> > $(check-execstack-xfail) to check-execstack.awk through `xfail' variable.
> > * sysdeps/mach/hurd/i386/Makefile (check-execstack-xfail): Set to ld.so
> > libc.so libpthread.so.
>
> Ping?
Ping?
This is the last issue of the testsuite when cross-building from Linux,
it'd be really useful to fix it before 2.28 :)
> > ---
> > elf/Makefile | 2 +-
> > scripts/check-execstack.awk | 27 ++++++++++++++++++++++-----
> > sysdeps/mach/hurd/i386/Makefile | 6 ++++++
> > 3 files changed, 29 insertions(+), 6 deletions(-)
> >
> > diff --git a/elf/Makefile b/elf/Makefile
> > index f221422de3..b55f457d98 100644
> > --- a/elf/Makefile
> > +++ b/elf/Makefile
> > @@ -1094,7 +1094,7 @@ common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr)
> > $(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \
> > $(objpfx)execstack-default \
> > $(all-built-dso:=.phdr)
> > - LC_ALL=C $(AWK) -f $^ > $@; \
> > + LC_ALL=C $(AWK) -v "xfail=$(check-execstack-xfail)" -f $^ > $@; \
> > $(evaluate-test)
> > generated += check-execstack.out
> >
> > diff --git a/scripts/check-execstack.awk b/scripts/check-execstack.awk
> > index 21d37e9f47..cd6b30ed3c 100644
> > --- a/scripts/check-execstack.awk
> > +++ b/scripts/check-execstack.awk
> > @@ -6,7 +6,12 @@
> > # It fails (1) if any did indicate executable stack.
> > # It fails (2) if the input did not take the expected form.
> >
> > -BEGIN { result = sanity = 0; default_exec = -1 }
> > +BEGIN {
> > + result = sanity = 0; default_exec = -1;
> > + split(xfail, xfails, " ");
> > + for (x in xfails)
> > + expected_fails[xfails[x] ".phdr"] = 1;
> > +}
> >
> > /^execstack-no$/ { default_exec = 0; next }
> > /^execstack-yes$/ { default_exec = 1; next }
> > @@ -17,6 +22,10 @@ function check_one(name) {
> > result = 2;
> > }
> >
> > + n = split(name, parts, "/");
> > + basename = parts[n];
> > + expected_fail = basename in expected_fails;
> > +
> > if (!sanity) {
> > print name ": *** input did not look like readelf -l output";
> > result = 2;
> > @@ -24,12 +33,20 @@ function check_one(name) {
> > if (stack_line ~ /^.*RW .*$/) {
> > print name ": OK";
> > } else if (stack_line ~ /^.*E.*$/) {
> > - print name ": *** executable stack signaled";
> > - result = result ? result : 1;
> > + if (expected_fail) {
> > + print name ": *** executable stack signaled, expected";
> > + } else {
> > + print name ": *** executable stack signaled";
> > + result = result ? result : 1;
> > + }
> > }
> > } else if (default_exec) {
> > - print name ": *** no PT_GNU_STACK entry";
> > - result = result ? result : 1;
> > + if (expected_fail) {
> > + print name ": *** no PT_GNU_STACK entry, expected";
> > + } else {
> > + print name ": *** no PT_GNU_STACK entry";
> > + result = result ? result : 1;
> > + }
> > } else {
> > print name ": no PT_GNU_STACK but default is OK";
> > }
> > diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
> > index 0b509d9499..9a824fadf3 100644
> > --- a/sysdeps/mach/hurd/i386/Makefile
> > +++ b/sysdeps/mach/hurd/i386/Makefile
> > @@ -96,3 +96,9 @@ endif
> > ifeq ($(subdir),mach)
> > test-xfail-check-abi-libmachuser = yes
> > endif
> > +
> > +ifeq ($(subdir),elf)
> > +# We do use nested functions involving creation of trampolines, notably for
> > +# callbacks whose parameters don't permit to get the context parameters.
> > +check-execstack-xfail += ld.so libc.so libpthread.so
> > +endif
> > --
> > 2.17.1
> >
>
> --
> Samuel
> /*
> * [...] Note that 120 sec is defined in the protocol as the maximum
> * possible RTT. I guess we'll have to use something other than TCP
> * to talk to the University of Mars.
> * PAWS allows us longer timeouts and large windows, so once implemented
> * ftp to mars will work nicely.
> */
> (from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])
--
Samuel
<k> faut en profiter, aujourd'hui, les blagues bidon sont à 100 dollars
-+- #sos-bourse -+-
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-15 14:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13 20:38 [PATCH] check-execstack: Permit sysdeps to xfail some libs Samuel Thibault
2018-06-23 22:53 ` Samuel Thibault
2018-07-15 14:45 ` Samuel Thibault
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 read-only IMAP folder(s) and NNTP newsgroup(s).