From: Cyril Hrubis <chrubis@suse.cz>
To: Michael Menasherov <mmenashe@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] read_all: Fix buffer too small for long paths
Date: Tue, 15 Sep 2026 14:57:27 +0200 [thread overview]
Message-ID: <aqlAt5wCGegscwBS@yuki.lan> (raw)
In-Reply-To: <20260908092248.15774-1-mmenashe@redhat.com>
Hi!
> diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
> index 5720ffb99..ec9454fc9 100644
> --- a/testcases/kernel/fs/read_all/read_all.c
> +++ b/testcases/kernel/fs/read_all/read_all.c
> @@ -51,8 +51,8 @@
> #include "tst_timer.h"
>
> #define QUEUE_SIZE 16384
> -#define BUFFER_SIZE 1024
> -#define MAX_PATH 4096
> +#define BUFFER_SIZE PATH_MAX
> +#define MAX_PATH PATH_MAX
> #define MAX_DISPLAY 40
This part looks good.
> struct queue {
> @@ -131,7 +131,7 @@ static int queue_pop(struct queue *q)
> while (q->data[i]) {
> q->popped[j] = q->data[i];
>
> - if (++j >= BUFFER_SIZE - 1)
> + if (++j >= BUFFER_SIZE)
> tst_brk(TBROK, "Buffer is too small for path");
>
> i = (i + 1) % QUEUE_SIZE;
However here we do:
q->popped[j] = '\0';
So j must be at most BUFFER_SIZE-1 and with the change above j may end
up equal to BUFFER_SIZE and we will land off by one in the array.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-09-15 12:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 9:22 [LTP] [PATCH v3] read_all: Fix buffer too small for long paths Michael Menasherov via ltp
2026-09-08 10:42 ` [LTP] " linuxtestproject.agent
2026-09-11 7:17 ` [LTP] [PATCH v3] " Andrea Cervesato via ltp
2026-09-15 12:57 ` Cyril Hrubis [this message]
2026-09-15 14:00 ` Michael Menasherov via ltp
2026-09-15 14:44 ` Cyril Hrubis
2026-09-15 14:52 ` Cyril Hrubis
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=aqlAt5wCGegscwBS@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=mmenashe@redhat.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.