mailing list of musl libc
 help / color / mirror / code / Atom feed
From: jvoisin <julien.voisin@dustri.org>
To: musl@lists.openwall.com
Cc: jvoisin <julien.voisin@dustri.org>
Subject: Re: [musl] [PATCH] Zero the leading stack canary byte
Date: Mon, 13 Dec 2021 13:24:38 +0100	[thread overview]
Message-ID: <cca0e62d-3798-2d7b-95f2-ec0d638b16ae@dustri.org> (raw)
In-Reply-To: <20211212193502.GF7074@brightrain.aerifal.cx>

> As written this patch assumes a 64-bit uintptr_t, which isn't ok.
> Indeed 56 bits should be fine on a 64-bit arch, but dropping from 32
> to 24 on a 32-bit arch severely weakens the protection. So it probably
> needs to be conditional on 64-bit.
Will do.

> Also, zeroing the first byte means we can no longer catch buffer
> overflows of the form "off-by-one string length". This seems
> unfortunate. Putting the 0 byte at the end would solve that at the
> expense of allowing the canary value to be leaked via missing
> termination bugs, and overall I would lean towards catching actual
> buffer overflow bugs vs stopping canary leaks.
As discussed on IRC, what about zero'ing the second byte instead? This
would allow to catch overflows, as well as preventing canary
leaks/overwrite via string-manipulating functions.

  reply	other threads:[~2021-12-13 12:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 18:34 jvoisin
2021-12-12 19:35 ` Rich Felker
2021-12-13 12:24   ` jvoisin [this message]
2021-12-13 14:23     ` Rich Felker
2021-12-13 20:05       ` jvoisin

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=cca0e62d-3798-2d7b-95f2-ec0d638b16ae@dustri.org \
    --to=julien.voisin@dustri.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).