mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Zhu Yanjun <zyjzyj2000@gmail.com>,
	 Andrew Stellman <astellman@stellman-greene.com>
Cc: Zhu Yanjun <yanjun.zhu@linux.dev>, Jason Gunthorpe <jgg@ziepe.ca>,
	 linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH rdma-rc] RDMA/rxe: Zero struct rxe_mmap_info on allocation
Date: Thu, 26 Nov 2026 07:18:59 -0500	[thread overview]
Message-ID: <179569553925.1262876.4833992620993528543.b4-ty@kernel.org> (raw)
In-Reply-To: <20261123140620.64393-1-astellman@stellman-greene.com>


On Mon, 23 Nov 2026 09:06:20 -0500, Andrew Stellman wrote:
> rxe_create_mmap_info() allocates the structure with kmalloc_obj() and
> does not set info.pad. do_mmap_info() copies ip->info to userspace with
> copy_to_user(), so the 4 pad bytes of struct mminfo come from
> uninitialized kernel heap memory.
> 
> On x86_64 v7.4-rc3 under QEMU with init_on_alloc=0, an unprivileged
> user (CapEff 0) issued 300 CQ_CREATE ioctls on rxe0 and read the driver
> response. After the guest had run ls -lR on /proc and /sys and read
> /proc/*/status and /proc/*/stat, 101 of the 300 pads were nonzero. In a
> separate boot with slub_debug=P, all 300 pads were 0x6b6b6b6b. With
> this patch, all 300 pads were zero in both configurations.
> 
> [...]

Applied, thanks!

[1/1] RDMA/rxe: Zero struct rxe_mmap_info on allocation
      https://git.kernel.org/rdma/rdma/c/5d298f34048ba4

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


      parent reply	other threads:[~2026-11-26 12:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 14:06 Andrew Stellman
2026-11-24 21:41 ` Zhu Yanjun
2026-11-24 21:46   ` Andrew Stellman
2026-11-26 12:18 ` Leon Romanovsky [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=179569553925.1262876.4833992620993528543.b4-ty@kernel.org \
    --to=leon@kernel.org \
    --cc=astellman@stellman-greene.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yanjun.zhu@linux.dev \
    --cc=zyjzyj2000@gmail.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

all inboxes | Powered by JetHome®