9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
To: 9front@9front.org
Subject: [9front] commit df04ea8d6c2e1e75307a77f2b086a836f480ab72
Date: Wed, 28 Jul 2021 12:38:42 -0700	[thread overview]
Message-ID: <YQGyQoABNvJHAVdj@alice> (raw)

+char bin[] = "/bin";
...
 	char buf[32];
...
+	buf[0] = '/';
+	buf[1+read(open("/env/cputype", OREAD|OCEXEC), buf+1, sizeof buf - 5)] = '\0';
+	strcat(buf, bin);
+	bind(buf, bin, MAFTER);

That's an out of bounds write if $cputype has a
length greater than or equal to (sizeof buf - 5):
strcat will write a NUL just past the end of buf.

Should be sizeof buf - 6.

Cheers,
  Anthony

             reply	other threads:[~2021-07-29  3:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 19:38 Anthony Martin [this message]
2021-07-28 22:55 ` cinap_lenrek

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=YQGyQoABNvJHAVdj@alice \
    --to=ality@pbrane.org \
    --cc=9front@9front.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 NNTP newsgroup(s).