All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Chaun <olegchaun@gmail.com>
To: stable@vger.kernel.org
Cc: regressions@lists.linux.dev, willy@infradead.org, brauner@kernel.org
Subject: Subject:[REGRESSION] fs/qnx6: incorrect pointer arithmetic breaks dir scanning completely
Date: Tue, 26 May 2026 12:40:12 +0200	[thread overview]
Message-ID: <d02905f7-6ef8-4df0-bb55-dea44fda6ce2@gmail.com> (raw)


#regzbot introduced: b2aa615

Hello,

A change to fs/qnx6/dir.c:qnx6_readdir() introduced in commit b2aa615 
contains an incorrect pointer arithmetic (adding an offset expressed in 
QNX6_DIR_ENTRY_SIZE units to a plain char * pointer) which breaks QNX6 
directory reading completely: only few entries are visible, kernel log 
is spammed with "invalid direntry size" messages.

The following patch seems to fix the issue:

--- /tmp/temp/linux-6.17/fs/qnx6/dir.c    2025-09-28 23:39:22.000000000 
+0200
+++ ./dir.c    2026-02-13 18:52:56.000000000 +0100
@@ -138,8 +138,8 @@
              ctx->pos = (n + 1) << PAGE_SHIFT;
              return PTR_ERR(kaddr);
          }
-        de = (struct qnx6_dir_entry *)(kaddr + offset);
-        limit = kaddr + last_entry(inode, n);
+        de = ((struct qnx6_dir_entry *)kaddr) + offset;
+        limit = kaddr + last_entry(inode, n) * QNX6_DIR_ENTRY_SIZE;
          for (; (char *)de < limit; de++, ctx->pos += 
QNX6_DIR_ENTRY_SIZE) {
              int size = de->de_size;
              u32 no_inode = fs32_to_cpu(sbi, de->de_inode);

I can test any further changes on real QNX6 fs images if necessary.

BR,
Oleg

             reply	other threads:[~2026-05-26 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 10:40 Oleg Chaun [this message]
2026-05-26 11:02 ` Subject:[REGRESSION] fs/qnx6: incorrect pointer arithmetic breaks dir scanning completely Thorsten Leemhuis
2026-05-26 13:12   ` Arpith Kalaginanavoor
2026-05-26 13:38 ` Sasha Levin

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=d02905f7-6ef8-4df0-bb55-dea44fda6ce2@gmail.com \
    --to=olegchaun@gmail.com \
    --cc=brauner@kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=willy@infradead.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 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.