From: David Laight <David.Laight@ACULAB.COM>
To: 'Charan Teja Kalla' <charante@codeaurora.org>,
"Ruhl, Michael J" <michael.j.ruhl@intel.com>,
Sumit Semwal <sumit.semwal@linaro.org>,
"open list:DMA BUFFER SHARING FRAMEWORK"
<linux-media@vger.kernel.org>,
"DRI mailing list" <dri-devel@lists.freedesktop.org>
Cc: Linaro MM SIG <linaro-mm-sig@lists.linaro.org>,
"vinmenon@codeaurora.org" <vinmenon@codeaurora.org>,
LKML <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] dmabuf: use spinlock to access dmabuf->name
Date: Wed, 17 Jun 2020 08:21:28 +0000 [thread overview]
Message-ID: <b686a288cff640acaea1111fed650b02@AcuMS.aculab.com> (raw)
In-Reply-To: <5b960c9a-ef9d-b43d-716d-113efc793fe5@codeaurora.org>
From: Charan Teja Kalla
> Sent: 17 June 2020 07:29
...
> >> If name is freed you will copy garbage, but the only way
> >> for that to happen is that _set_name or _release have to be called
> >> at just the right time.
> >>
> >> And the above would probably only be an issue if the set_name
> >> was called, so you will get NULL or a real name.
>
> And there exists a use-after-free to avoid which requires the lock. Say
> that memcpy() in dmabuffs_dname is in progress and in parallel _set_name
> will free the same buffer that memcpy is operating on.
If the name is being looked at while the item is being freed
you almost certainly have much bigger problems that just
the name being a 'junk' pointer.
David.
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2020-06-17 8:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-11 13:39 [PATCH] dmabuf: use spinlock to access dmabuf->name Charan Teja Kalla
2020-06-16 12:40 ` Sumit Semwal
2020-06-16 13:51 ` Ruhl, Michael J
2020-06-16 13:59 ` Ruhl, Michael J
2020-06-17 6:28 ` Charan Teja Kalla
2020-06-17 8:21 ` David Laight [this message]
2020-06-17 13:43 ` Charan Teja Kalla
2020-06-17 17:43 ` Ruhl, Michael J
2020-06-18 9:58 ` Charan Teja Kalla
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=b686a288cff640acaea1111fed650b02@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=charante@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=michael.j.ruhl@intel.com \
--cc=stable@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=vinmenon@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox