GNOME Bugzilla – Bug 682775
shmsink shmsrc permission problems
Last modified: 2016-12-28 11:58:32 UTC
when we try to use shmsink and shmsrc from 2 different users eg. user1 and user2. in this case currently gstreamer apps segfault eg from gstreamer-java we simple got a segfault. the reason for this (may be) comes from 2 reason: the shmsink has a perms flag, but it's only used for the shm area: shm_open (path, flags, perms); but do not applied to the control socket and in this case the two different user are not able to communicate each other since the shmsrc has no permission (by default) to the socket. another strange thing we got in the log: shm_open failed on /shmpipe. 2910. 0 (13): Permission denied but we do give a socket path to the shmsrc so why use the generated file in the above message?
not to mention that it shouldn't segfault in any case. anyway why the shmsrc create a pipe? according to the docs only the shmsink create socket....
Please provide a stack trace for the segfault.
Created attachment 232804 [details] [review] Control socket permission patch With this patch, shm area permissions are also applied to the control socket. As for the segfault and log message, it is reproducible with at least 0.10.23, on the shmsrc side, if the user has write, but not read permission as set in the shmsink perms property (with the patch applied). I'll attach the stack trace as the next attachment. AFAICT, the /shmpipe. 2910. 0 in the log message is a shared memory object name (man 3 shm_open is my source) always auto-generated on the shmsink side, and sent to the shmsrc side as a control packet. Thus, it is unrelated to the socket path.
Created attachment 232806 [details] shmsrc segfault stack trace Rebuilt with CFLAGS='-O0 -ggdb', shmsrc side run in gdb.
Created attachment 232906 [details] [review] socket permission patch v2 Corrected previous patch.
Comment on attachment 232906 [details] [review] socket permission patch v2 committed commit 2cacfa293214a2c840cfe422ae7a6f3c0c77e69b Author: Roland Elek <relek.f2@gmail.com> Date: Mon Jan 7 13:32:06 2013 +0100 shm: apply shm area permissions to shmpipe control socket Apply shared memory area permissions to the control socket (more precisely, the path it is bound to) as well. https://bugzilla.gnome.org/show_bug.cgi?id=682775
please apply to 0.10 too.
The shmsrc doesn't create a socket, it opens the shared memory area so it can read from it. I don't see how your crash is related to the patch your provided. Can you try with G_SLICE=debug-blocks and see if you get something different? It sounds like there is corruption somewhere in your application.
(In reply to comment #8) > The shmsrc doesn't create a socket, it opens the shared memory area so it can > read from it. I don't see how your crash is related to the patch your provided. > > Can you try with G_SLICE=debug-blocks and see if you get something different? > It sounds like there is corruption somewhere in your application. see #3
Is it still reproducible ?
i'm just apply all of the shm patches (i find some more differences in the 0.10 and our version). we'll check it in the next days..
Ping.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!