Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Kanishka De Silva <kpskanna1915@gmail.com>
Cc: tom.leiming@gmail.com, security@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] ublk: clear VM_MAYWRITE on read-only ublk char device mmap
Date: Sun, 30 Aug 2026 09:23:06 +0200	[thread overview]
Message-ID: <2026083059-next-process-bd8e@gregkh> (raw)
In-Reply-To: <20260830070133.559-1-kpskanna1915@gmail.com>

On Sun, Aug 30, 2026 at 12:31:33PM +0530, Kanishka De Silva wrote:
> ublk_ch_mmap() rejects mmap requests with VM_WRITE set, but never
> clears VM_MAYWRITE on the resulting read-only mapping. This allows
> a userspace daemon to mmap the per-queue command buffer PROT_READ,
> then upgrade it to PROT_WRITE via mprotect(), since VM_MAYWRITE was
> never cleared.
> 
> The command buffer holds struct ublksrv_io_desc entries that are
> kernel-written ABI; a writable mapping lets an unprivileged daemon
> process corrupt fields such as addr, op_flags, nr_sectors, and
> start_sector.
> 
> Same bug class as the drm/panthor and drm/vc4 VM_MAYWRITE fixes, and
> the 2026-08-13 ptp/vmclock fix (a5edadbae57e).
> 
> Verified via mprotect() PoC: before the fix, a PROT_READ mapping can
> be upgraded to PROT_READ|PROT_WRITE and a write into the command
> buffer corrupts io_desc fields (confirmed under KASAN). After the
> fix, mprotect() returns -EACCES.
> 
> Fixes: 3fee8d7599e1 ("ublk_drv: add io_uring based userspace block driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kanishka De Silva <kpskanna1915@gmail.com>
> ---
>  drivers/block/ublk_drv.c | 6 ++++++
>  1 file changed, 6 insertions(+)

You only sent this to the stable list in public, and didn't cc: any of
the relevant maintainers or the proper mailing list.  Please use
scripts/get_maintainer.pl on your patch to determine who to send stuff
to.

thanks,

greg k-h

  parent reply	other threads:[~2026-08-30  7:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2026083055-isotope-broiler-88e5@gregkh>
2026-08-30  7:01 ` [PATCH] ublk: clear VM_MAYWRITE on read-only ublk char device mmap Kanishka De Silva
2026-08-30  7:21   ` Ming Lei
2026-08-30  7:23   ` Greg KH [this message]
2026-09-01 14:44   ` Jens Axboe
2026-08-30  7:33 ` [PATCH v2] " Kanishka De Silva

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=2026083059-next-process-bd8e@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=kpskanna1915@gmail.com \
    --cc=security@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tom.leiming@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