Util-Linux package development
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH 1/4] uuidparse: fix stack-buffer-overflow [asan]
Date: Mon, 11 Sep 2017 20:57:14 +0100	[thread overview]
Message-ID: <20170911195717.817-1-kerolasa@iki.fi> (raw)

ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffee13b8f05 at
pc 0x55debcc9fda4 bp 0x7ffee13b8d70 sp 0x7ffee13b8520
WRITE of size 38 at 0x7ffee13b8f05 thread T0
    #0 0x55debcc9fda3 in scanf_common(void*, int, bool, char const*, __va_list_tag*) (/home/src/util-linux/.libs/lt-uuidparse+0x63da3)
    #1 0x55debcca077b in vscanf (/home/src/util-linux/.libs/lt-uuidparse+0x6477b)
    #2 0x55debcca085f in scanf (/home/src/util-linux/.libs/lt-uuidparse+0x6485f)
    #3 0x55debcd50fad in print_output /home/src/util-linux/misc-utils/uuidparse.c:284:10
    #4 0x55debcd4fcc5 in main /home/src/util-linux/misc-utils/uuidparse.c:355:2

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 misc-utils/uuidparse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc-utils/uuidparse.c b/misc-utils/uuidparse.c
index 5fa34b23d..3347dc0af 100644
--- a/misc-utils/uuidparse.c
+++ b/misc-utils/uuidparse.c
@@ -279,7 +279,7 @@ static void print_output(struct control const *const ctrl, int argc,
 		fill_table_row(tb, argv[i]);
 
 	if (i == 0) {
-		char uuid[UUID_STR_LEN];
+		char uuid[UUID_STR_LEN + 1];
 
 		while (scanf(" %" stringify_value(UUID_STR_LEN)
 			     "[^ \t\n]%*c", uuid) && !feof(stdin))
-- 
2.14.1


             reply	other threads:[~2017-09-11 19:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 19:57 Sami Kerola [this message]
2017-09-11 19:57 ` [PATCH 2/4] libsmartcols: fix heap-buffer-overflow [asan] Sami Kerola
2017-09-15 11:47   ` Karel Zak
2017-09-11 19:57 ` [PATCH 3/4] logger: fix memory leaks [asan] Sami Kerola
2017-09-15 11:05   ` Karel Zak
2017-09-16  0:54     ` J William Piggott
2017-09-16  7:31       ` Sami Kerola
2017-09-18  8:55         ` Karel Zak
2017-09-18  9:40         ` Karel Zak
2017-09-11 19:57 ` [PATCH 4/4] partx: fix memory leak [asan] Sami Kerola
2017-09-15 11:33 ` [PATCH 1/4] uuidparse: fix stack-buffer-overflow [asan] Karel Zak

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=20170911195717.817-1-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@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