* [LTP] [PATCH] cve-2016-10044: Check sscanf matches and syntax fixups
@ 2023-09-05 8:37 Richard Palethorpe via ltp
2023-09-05 8:45 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Richard Palethorpe via ltp @ 2023-09-05 8:37 UTC (permalink / raw)
To: ltp; +Cc: Richard Palethorpe
The test appears to work, but we were not checking that sscanf fills
the expected number of fields. Also the trailing 7 probably had no
effect, but is a confusing typo.
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Reported-by: Avinesh Kumar <akumar@suse.de>
---
testcases/cve/cve-2016-10044.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/testcases/cve/cve-2016-10044.c b/testcases/cve/cve-2016-10044.c
index 9ac644fc2..6a8c77f3e 100644
--- a/testcases/cve/cve-2016-10044.c
+++ b/testcases/cve/cve-2016-10044.c
@@ -19,7 +19,7 @@
#include "tst_safe_stdio.h"
#include "lapi/syscalls.h"
-static FILE *f;
+static FILE * f;
static void cleanup(void)
{
@@ -29,7 +29,7 @@ static void cleanup(void)
static void run(void)
{
- void* ctx = 0;
+ void *ctx = 0;
char perms[8], line[BUFSIZ];
SAFE_PERSONALITY(READ_IMPLIES_EXEC);
@@ -44,7 +44,7 @@ static void run(void)
tst_brk(TCONF, "Could not find mapping in /proc/self/maps");
found_mapping:
- if (sscanf(line, "%*x-%*x %s7", perms) < 0)
+ if (sscanf(line, "%*x-%*x %s", perms) != 1)
tst_brk(TBROK, "failed to find permission string in %s", line);
if (strchr(perms, (int)'x'))
tst_res(TFAIL, "AIO mapping is executable: %s!", perms);
--
2.40.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] cve-2016-10044: Check sscanf matches and syntax fixups
2023-09-05 8:37 [LTP] [PATCH] cve-2016-10044: Check sscanf matches and syntax fixups Richard Palethorpe via ltp
@ 2023-09-05 8:45 ` Cyril Hrubis
2023-09-05 8:53 ` Richard Palethorpe
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2023-09-05 8:45 UTC (permalink / raw)
To: Richard Palethorpe; +Cc: ltp
Hi!
Good catch.
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] cve-2016-10044: Check sscanf matches and syntax fixups
2023-09-05 8:45 ` Cyril Hrubis
@ 2023-09-05 8:53 ` Richard Palethorpe
0 siblings, 0 replies; 3+ messages in thread
From: Richard Palethorpe @ 2023-09-05 8:53 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
thanks pushed
Cyril Hrubis <chrubis@suse.cz> writes:
> Hi!
> Good catch.
>
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-05 8:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-05 8:37 [LTP] [PATCH] cve-2016-10044: Check sscanf matches and syntax fixups Richard Palethorpe via ltp
2023-09-05 8:45 ` Cyril Hrubis
2023-09-05 8:53 ` Richard Palethorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox