public inbox for dash@vger.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Aleksander Ushakov <aushakov@astralinux.ru>
Cc: dash@vger.kernel.org
Subject: Re: [BUG] heap-buffer-overflow(read) padvance_magic() exec.c:232:8
Date: Thu, 28 Aug 2025 16:53:49 +0800	[thread overview]
Message-ID: <aLAZHdSmoYSTnF7Y@gondor.apana.org.au> (raw)
In-Reply-To: <d8cc15e4-7efc-422e-8e5d-e42e8d74dca7@astralinux.ru>

Aleksander Ushakov <aushakov@astralinux.ru> wrote:
> Hello Dash maintainers,
> 
> I encountered a bug in Dash in commit b4ef25d7 and would like to report
> it. The details are provided below.
> =================================================================
> ==19628==ERROR: AddressSanitizer: heap-buffer-overflow on address 
> 0x5020000001f6 at pc 0x653a8d802916 bp 0x7ffd57f3d590 sp 0x7ffd57f3cd50
> READ of size 2 at 0x5020000001f6 thread T0
>     #0 0x653a8d802915 in strcspn (/upstream/dash/src/dash+0x55915) 
> (BuildId: 82ec7cbb990c5349f280ce0bf016a1bca211dffd)
>     #1 0x653a8d8d01af in padvance_magic /upstream/dash/src/exec.c:232:8

This may be a false positive, or strcspn is buggy.  padvance_magic
actually passes vpath.text + 5 to strcspn, and as vpath.text[5] is
NUL, there is no reason for strcspn to read vpath.text + 6.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      reply	other threads:[~2025-08-28  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31 13:10 [BUG] heap-buffer-overflow(read) padvance_magic() exec.c:232:8 Aleksander Ushakov
2025-08-28  8:53 ` Herbert Xu [this message]

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=aLAZHdSmoYSTnF7Y@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=aushakov@astralinux.ru \
    --cc=dash@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