This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DRA746: Application can not access VIDDEC3_create directly?

Part Number: DRA746


Tool/software: Linux

Hi Ram,

I have a problem about right control.

I created exectuable test to decode 264 stream, whose uid/gid are root.

But, application which is created the same as exectuable test cannot work well. It failed on VIDDEC3_create, which seems to be right control issue.

So, I chmod 777 to all the device in /dev folder, like below:

chmod 777 /dev/

But it seems not work.

  • Hi Gao,
    I didn't get how to reproduce this. Is it specific to one application?
    Please confirm if Engine_open is passing, if this passes, VIDDEC3_create also should work.
    What is the error you are seeing?

    Ram
  • Hi Ram,
    Application calls Engine_open first, and also is failed.
    I add some logs to debug, and the error code is Engine_EOK when Engine_open returns NULL.

    In my application, Engine_open is called directly in normal process, not system process like media_server.
    It seems to be right control, because the same code can be run in exectuable test which has root authority.
  • Ram,

    We write a wrapper decoder (known as V4l2 codec) on top of libdce to fit TI HW codec into our multimedia framework.

    The problem is if we run cmdline test as root, things work fine; when run another non-root test, we get error as Gao described. Is it a must to call libdce with root privilege?

    Best Regards,
    Li
  • 1. is there any quick way to bypass access check for video decoding?

    for example, to change the access right for drm device;

    is there any special access control for dce/MmRpc_create.

    2. we are trying to make the final solution to use media server for decoding, which user group is required for codec (to grant to media server)?

    thanks

  • Hi Ram,

    I add some logs to debug
    1. First enter adb shell mode
    2. input 'su news'
    3. run cmdline test, whose uid and gid are 'news' now.

    The test is failed on dce_ipc_init inside Engine_open method, the error info is "MmRpc_create: Error: open failed, name=/dev/rpmsg-dce"
    Then I change /dev/rpmsg-dce mode to 777, run the test again, I get the different result, which is failed memplugin_alloc method now.
    The kernel info is below:
    =========================
    <7>[ 1045.695002] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_VERSION
    <7>[ 1045.695016] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_VERSION
    <7>[ 1045.696063] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_SET_VERSION
    <7>[ 1045.696715] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_SET_VERSION
    <7>[ 1045.696737] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_GET_UNIQUE
    <7>[ 1045.696770] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_GET_UNIQUE
    ======================================
  • Hi Ram,

    There are 5 replies for you which makes a little mess, let me summary these things:

    The request is to run libdce decoder in non-root process, the problem is we are ok with root privilege but fail with non-root.

    1. First of all, we add log in libdce and find the error is "MmRpc_create: Error: open failed, name=/dev/rpmsg-dce". This is because rpmsg-dce's owner is root:root but the running process is non-root.
    2. chmod 777 /dev/rpmsg-dce, then run test. We get fail with drm auth, see below. For drm auth, do we need to pass a drm authenticated fd to dce? Any other suggestion do you have?
    <7>[ 1045.695002] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_VERSION
    <7>[ 1045.695016] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_VERSION
    <7>[ 1045.696063] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_SET_VERSION
    <7>[ 1045.696715] [drm:drm_ioctl], pid=4974, dev=0xe200, auth=0, DRM_IOCTL_SET_VERSION

    Anyway we are able to handle drm auth. Now the problem is about /dev/rpmsg-dce, why its owner is root:root, is it feasible to make it root:graphics or root:video?

    Best Regards,
    Li
  • Hi Li,

    I don't have knowledge of this. I am checking with experts here. I will get back to you.

    Is the issue with accessing only libdce/libdrm library functions? or any other libraries also same access control issues?

    Ram

  • Hi Ram,

    It's libdce and libdrm, so far we have not see other libraries with the access control issue.

    Best Regards,

            Li