public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "siddhesh at sourceware dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/29536] syslog fail to create large messages
Date: Mon, 29 Aug 2022 19:36:22 +0000	[thread overview]
Message-ID: <bug-29536-131-DT4NLMIyTJ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29536-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29536

--- Comment #3 from Siddhesh Poyarekar <siddhesh at sourceware dot org> ---
OK, some more analysis on what's going on:

There are two invalid reads here:

    __dprintf (STDERR_FILENO, "%s%s", buf + msgoff,
               "\n" + (buf[bufsize - 1] == '\n')); 

one that's a byte under the malloc'd block, through buf[bufsize - 1].  The
other is a read of uninitialized memory through buf + msgoff, which will end up
revealing contents of buf if it has been reused.  At best it will reveal a free
list pointer, which we mangle, so that's less of a problem.  At worst it could
be a block of interest for the attacker.

The byte under the malloc'd block is less interesting because it is merely used
to decide whether or not to print the '\n'.

So I'm going to leave the security+ in place and file a CVE request.  The fix
should get backported to 2.36, where the flaw was introduced.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-08-29 19:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 12:26 [Bug libc/29536] New: " adhemerval.zanella at linaro dot org
2022-08-29 13:16 ` [Bug libc/29536] " carlos at redhat dot com
2022-08-29 16:51 ` siddhesh at sourceware dot org
2022-08-29 19:36 ` siddhesh at sourceware dot org [this message]
2022-08-30 12:02 ` adhemerval.zanella at linaro dot org
2022-08-31 11:13 ` [Bug libc/29536] syslog fail to create large messages (CVE-2022-39046) siddhesh at sourceware dot org
2022-08-31 13:19 ` adhemerval.zanella at linaro dot org
2022-09-06 13:27 ` fweimer at redhat dot com
2022-09-06 14:52 ` sjon at hortensius dot net
2022-09-06 14:58 ` siddhesh at sourceware dot org
2022-09-08 17:59 ` brunni at netestate dot de
2022-09-08 18:51 ` siddhesh at sourceware dot org
2022-09-08 18:53 ` brunni at netestate dot de
2022-09-08 18:59 ` siddhesh at sourceware dot org

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=bug-29536-131-DT4NLMIyTJ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).