Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Lin Ma <linma@zju.edu.cn>, David Howells <dhowells@redhat.com>,
	Marc Dionne <marc.dionne@auristor.com>
Cc: netdev@vger.kernel.org, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] rxrpc: Fix overread of short key descriptions
Date: Mon, 30 Nov 2026 19:10:10 +0100	[thread overview]
Message-ID: <be6e2fd6-3bd5-4f26-8a16-91a6472e9a88@redhat.com> (raw)
In-Reply-To: <20261123011302.4032262-1-linma@zju.edu.cn>

On 11/23/26 02:13, Lin Ma wrote:
> rxrpc_read() checks whether the key description starts with "afs@" by
> calling memcmp() with a length of 4.  The description is an arbitrary
> NUL-terminated string supplied when the key is created and is only
> required to be non-empty, so it can be as short as one character.  In
> that case memcmp() reads up to two bytes past the end of the
> kmemdup()'d description (which is strlen(description) + 1 bytes long).
> 
> The result of the comparison is not affected because the NUL terminator
> is reached within the first four bytes, and the overread is normally
> confined to the slab object, but it is still an out-of-bounds read.
> 
> Use str_has_prefix(), which stops at the NUL terminator.
> 
> Fixes: ed6dd18b5aceb ("RxRPC: Allow RxRPC keys to be read")
> Signed-off-by: Lin Ma <linma@zju.edu.cn>
Not 'net' worthy. Possibly not even mailing list worthy, but we
can still take it if David acks it.

/P

      parent reply	other threads:[~2026-11-30 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  1:13 [PATCH net] rxrpc: Fix overread of short key descriptions Lin Ma
2026-11-23  1:18 ` netdev-bot+sinfo
2026-11-23  2:12   ` Lin Ma
2026-11-30 18:10 ` Paolo Abeni [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=be6e2fd6-3bd5-4f26-8a16-91a6472e9a88@redhat.com \
    --to=pabeni@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linma@zju.edu.cn \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@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