gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Alexander Aring <aahringo@redhat.com>
Cc: David Teigland <teigland@redhat.com>,
	gfs2@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dlm: check negative length in dlm_search_rsb_tree
Date: Sun, 17 May 2026 09:30:06 +0800	[thread overview]
Message-ID: <a32e5105-a573-4918-9fe9-166dad67df5e@linux.alibaba.com> (raw)
In-Reply-To: <CAK-6q+iOFTdw0caweFQ7tw_amBHzW5xXM+H0_FicBAkHVz5OKA@mail.gmail.com>



On 5/15/26 9:30 PM, Alexander Aring wrote:
> Hi,
> 
> On Fri, May 15, 2026 at 3:39 AM Joseph Qi <joseph.qi@linux.alibaba.com> wrote:
>>
>> commit 080e5563f878 only checks for len > DLM_RESNAME_MAXLEN, which does
>> not catch negative values. While the input 'len' can be negative and a
>> negative int passed to memcpy() is implicitly converted to a large
>> size_t, causing a stack buffer overflow on the key[] array.
>>
>> Fix this by also rejecting len <= 0.
> 
> or change the parameter to unsigned?
> 

Yes, it would be fine. I'll work on it and send v2 later.

Thanks,
Joseph


      reply	other threads:[~2026-05-17  1:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15  7:39 [PATCH] dlm: check negative length in dlm_search_rsb_tree Joseph Qi
2026-05-15 13:30 ` Alexander Aring
2026-05-17  1:30   ` Joseph Qi [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=a32e5105-a573-4918-9fe9-166dad67df5e@linux.alibaba.com \
    --to=joseph.qi@linux.alibaba.com \
    --cc=aahringo@redhat.com \
    --cc=gfs2@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=teigland@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox