Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-4076

Permission denied when agl-compositor process trying to open /dev/*

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • NXP i.MX6

      I add a new device /dev/xen/gntalloc, and try to open /dev/xen/gntalloc in agl-compositor process. But it failed to open the device and the errno is "Permission denied". 

      Code: agl/build/tmp/work/aarch64-mx8-agl-linux/agl-compositor/0.0.10+gitAUTOINC+4d3727ec24-ro/git/src/main.c
      int main(int argc, char *argv[])
      {
      struct ivi_compositor ivi =

      { 0 };
      struct wl_display *display = NULL;
      struct wl_event_loop *loop;
      struct wl_event_source *signals[3] = { 0 }

      ;
      struct weston_config_section *section;
      /* Command line options */
      char *backend = NULL;
      char *socket_name = NULL;
      char *log = NULL;
      int help = 0;
      int version = 0;
      int no_config = 0;
      int debug = 0;
      char *config_file = NULL;
      struct weston_log_context *log_ctx = NULL;
      struct weston_log_subscriber *logger;
      int ret = EXIT_FAILURE;
      //test
      int fd1 = -1;

      const struct weston_option core_options[] = {

      { WESTON_OPTION_STRING, "backend", 'B', &backend }

      ,

      { WESTON_OPTION_STRING, "socket", 'S', &socket_name }

      ,

      { WESTON_OPTION_STRING, "log", 0, &log }

      ,

      { WESTON_OPTION_BOOLEAN, "help", 'h', &help }

      ,

      { WESTON_OPTION_BOOLEAN, "version", 0, &version }

      ,

      { WESTON_OPTION_BOOLEAN, "no-config", 0, &no_config }

      ,

      { WESTON_OPTION_BOOLEAN, "debug", 0, &debug }

      ,

      { WESTON_OPTION_STRING, "config", 'c', &config_file }

      ,
      };

      //test
      fd1 = open("/dev/xen/gntalloc", O_RDWR);
      if ( fd1 == -1 )

      { fprintf(stderr, "~~open gntalloc failed\n"); fprintf(stderr, "~~errno:%s\n", strerror(errno)); }

      }
       
      Error log:
      [03:07:09.903] ~~~open gntalloc failed
      [03:07:09.904] ~~~errno:Permission denied
      [03:07:09.904] osdep open failed
      [03:07:09.904] xengntshr_open() fail

      [ 35.662117] audit: type=1400 audit(1593400029.900:5): lsm=SMACK fn=smack_inode_permission action=denied subject="System::Weston" object="_" requested=rw pid=529 comm="agl-compositor" name="gntalloc" dev="devtmpfs" ino=3174

      Also, I tried to open the same device in other process like vm-cluster-receiver which started manually, it's successful. I guess I should config device access permission for the process agl-compositor, but I don't know how to do that. Please tell me how. Thanks a lot!

      Best regards!

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            xiangdongxian xian xiangdong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: