linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ben Wolsieffer <ben.wolsieffer@hefring.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Greg Ungerer <gerg@uclinux.org>, Oleg Nesterov <oleg@redhat.com>,
	Giulio Benetti <giulio.benetti@benettiengineering.com>,
	Ben Wolsieffer <Ben.Wolsieffer@hefring.com>
Subject: Re: [PATCH] proc: nommu: /proc/<pid>/maps: release mmap read lock
Date: Thu, 14 Sep 2023 10:02:03 -0700	[thread overview]
Message-ID: <20230914100203.e5905ee145b7cb580c8df9c4@linux-foundation.org> (raw)
In-Reply-To: <20230914163019.4050530-2-ben.wolsieffer@hefring.com>

On Thu, 14 Sep 2023 12:30:20 -0400 Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote:

> The no-MMU implementation of /proc/<pid>/map doesn't normally release
> the mmap read lock, because it uses !IS_ERR_OR_NULL(_vml) to determine
> whether to release the lock. Since _vml is NULL when the end of the
> mappings is reached, the lock is not released.
> 
> This code was incorrectly adapted from the MMU implementation, which
> at the time released the lock in m_next() before returning the last entry.
> 
> The MMU implementation has diverged further from the no-MMU version
> since then, so this patch brings their locking and error handling into
> sync, fixing the bug and hopefully avoiding similar issues in the
> future.

Thanks.  Is this bug demonstrable from userspace?  If so, how?

  reply	other threads:[~2023-09-14 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 16:30 [PATCH] proc: nommu: /proc/<pid>/maps: release mmap read lock Ben Wolsieffer
2023-09-14 17:02 ` Andrew Morton [this message]
2023-09-14 17:30   ` Ben Wolsieffer
2023-09-15 15:42     ` Ben Wolsieffer
2023-09-15 12:15 ` Oleg Nesterov
2023-09-15 15:44   ` Ben Wolsieffer

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=20230914100203.e5905ee145b7cb580c8df9c4@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ben.wolsieffer@hefring.com \
    --cc=gerg@uclinux.org \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@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;
as well as URLs for NNTP newsgroup(s).