linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: bsauce <bsauce00@gmail.com>
Cc: alexander.h.duyck@intel.com, vbabka@suse.cz, mgorman@suse.de,
	l.stach@pengutronix.de, vdavydov.dev@gmail.com,
	akpm@linux-foundation.org, alex@ghiti.fr, adobriyan@gmail.com,
	mike.kravetz@oracle.com, rientjes@google.com,
	rppt@linux.vnet.ibm.com, mhocko@suse.com, ksspiers@google.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/seq_file.c: Fix a UAF vulnerability in seq_release()
Date: Wed, 10 Jul 2019 05:25:49 -0700	[thread overview]
Message-ID: <20190710122549.GM32320@bombadil.infradead.org> (raw)
In-Reply-To: <1562754389-29217-1-git-send-email-bsauce00@gmail.com>

On Wed, Jul 10, 2019 at 06:26:29PM +0800, bsauce wrote:
> In seq_release(), 'm->buf' points to a chunk. It is freed but not cleared to null right away. It can be reused by seq_read() or srm_env_proc_write().

Well, no.  The ->release method is called when there are no more file
descriptors referring to this file.  So there's no way to call seq_read()
or srm_env_proc_write() after seq_release() is called.

> For example, /arch/alpha/kernel/srm_env.c provide several interfaces to userspace, like 'single_release', 'seq_read' and 'srm_env_proc_write'.
> Thus in userspace, one can exploit this UAF vulnerability to escape privilege.

Please provide a PoC.


  parent reply	other threads:[~2019-07-10 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 10:26 bsauce
2019-07-10 10:58 ` Eric Dumazet
2019-07-10 12:25 ` Matthew Wilcox [this message]
2019-07-10 15:01 ` Alexander Duyck

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=20190710122549.GM32320@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=alexander.h.duyck@intel.com \
    --cc=bsauce00@gmail.com \
    --cc=ksspiers@google.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=rientjes@google.com \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=vbabka@suse.cz \
    --cc=vdavydov.dev@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