After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730559 - dmabuf: fix checking mmap flags
dmabuf: fix checking mmap flags
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-22 09:03 UTC by Michael Olbrich
Modified: 2014-06-04 14:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.05 KB, patch)
2014-05-22 09:03 UTC, Michael Olbrich
committed Details | Review

Description Michael Olbrich 2014-05-22 09:03:30 UTC
Created attachment 276970 [details] [review]
patch

A simple '&' is not sufficiant. With mmapping_flags == PROT_READ and
prot == PROT_READ|PROT_WRITE the check produces the wrong result.
Change the check to make sure that prot is a subset of mmapping_flags.
Comment 1 Nicolas Dufresne (ndufresne) 2014-05-22 13:07:54 UTC
It's conceptually correct of course, thanks for the patch. Though, now that I look at that closely I wonder if we didn't got something wrong.

Normally the rules to allow mapping or not a memory are handled in GstMemory code and we should never end-up rejecting a map accepted by GStreamer. I would need to review does rules as I realize I don't know them, but is there a risk that GStreamer rules would allow mapping a buffers, but because of the previous mapping we have done, only read, or only write, we would fail doing so ?
Comment 2 Nicolas Dufresne (ndufresne) 2014-06-04 14:02:19 UTC
Comment on attachment 276970 [details] [review]
patch

commit 42623c995e97a4eda3ca641b37584a4f66f9e095
Author: Michael Olbrich <m.olbrich@pengutronix.de>
Date:   Tue May 20 12:28:15 2014 +0200

    dmabuf: fix checking mmap flags
    
    A simple '&' is not sufficiant. With mmapping_flags == PROT_READ and
    prot == PROT_READ|PROT_WRITE the check produces the wrong result.
    Change the check to make sure that prot is a subset of mmapping_flags.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730559
Comment 3 Nicolas Dufresne (ndufresne) 2014-06-04 14:03:39 UTC
Thanks for this patch. As said, it's clearly correct way of checking it's a subset of prot, otherwise it conly check that at least one of the flags is there, and may fail if none are there.