From: Greg KH <gregkh@linuxfoundation.org>
To: Zubin Mithra <zsm@chromium.org>
Cc: stable@vger.kernel.org, jasowang@redhat.com, davem@davemloft.net,
groeck@chromium.org
Subject: Re: [PATCH v4.14.y] tun: fix use after free for ptr_ring
Date: Fri, 31 Aug 2018 20:53:05 -0700 [thread overview]
Message-ID: <20180901035305.GE27141@kroah.com> (raw)
In-Reply-To: <20180831213642.251705-1-zsm@chromium.org>
On Fri, Aug 31, 2018 at 02:36:42PM -0700, Zubin Mithra wrote:
> From: Jason Wang <jasowang@redhat.com>
>
> commit b196d88aba8ac72b775137854121097f4c4c6862 upstream.
>
> We used to initialize ptr_ring during TUNSETIFF, this is because its
> size depends on the tx_queue_len of netdevice. And we try to clean it
> up when socket were detached from netdevice. A race were spotted when
> trying to do uninit during a read which will lead a use after free for
> pointer ring. Solving this by always initialize a zero size ptr_ring
> in open() and do resizing during TUNSETIFF, and then we can safely do
> cleanup during close(). With this, there's no need for the workaround
> that was introduced by commit 4df0bfc79904 ("tun: fix a memory leak
> for tfile->tx_array").
>
> Backport Note :-
> This is a backport of following 2 upstream patches(the second fixes the
> first).
> b196d88aba ("tun: fix use after free for ptr_ring")
> 7063efd33b ("tuntap: fix use after free during release")
Please backport the two patches individually, do not mush anything
together.
thanks,
greg k-h
prev parent reply other threads:[~2018-09-01 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 21:36 [PATCH v4.14.y] tun: fix use after free for ptr_ring Zubin Mithra
2018-09-01 3:53 ` Greg KH [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=20180901035305.GE27141@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=groeck@chromium.org \
--cc=jasowang@redhat.com \
--cc=stable@vger.kernel.org \
--cc=zsm@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.