Unexpected root access (1777) reported on Android 7.1.2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unexpected root access (1777) reported on Android 7.1.2

686 Views
gsteimle
Contributor II

We have Android 7.1.2 (Nougat) running on a device with imx6. When I use 'adb shell' to access the device, then run 'stat /' to get statistics on the root directory, it returns the following:

File: `/'
  Size: 920      Blocks: 0       IO Blocks: 4096        directory
Device: 2h/2d    Inode: 2        Links: 18
Access: (1777/drwxrwxrwt)       Uid: (0/    root)       Gid: (0/    root)
Access: 1970-01-01 00:00:00.000000000
Modify: 2019-03-22 21:29:14.240000000
Change: 2019-03-22 21:29:14.240000000

Why is the Access being reported as 1777? Indeed, if I try to copy anything into root, I get the 'Read-only file system' error, which is what I expect. But why doesn't 'stat' reflect this?

When we had JellyBean loaded on this device, the Access returned by 'stat' was the more expected 0755:

  File: /
  Size: 0               Blocks: 0          IO Block: 4096   directory
Device: 1h/1d   Inode: 1           Links: 16
Access: (0755/drwxr-xr-x)  Uid: (    0/ UNKNOWN)   Gid: (    0/ UNKNOWN)
Access: 1970-01-01 00:00:00.000000000
Modify: 2019-03-22 20:03:05.000000000
Change: 2019-03-22 20:03:05.000000000

Please advise on how to get the root configured so that it reports its access as 0755 on Nougat?

Thank you.

Labels (2)
0 Kudos
3 Replies

585 Views
b36401
NXP Employee
NXP Employee

I have no idea what is going wrong.

You can check which device is used for root:
mount | grep " / "
And check the permissions with ls:
ls -ld /

By the way if the device is readonly "777" permission takes no actual effect.
However I still do not know why 1777 is set.
Please try to perform "chmod 755 /" to drop it.

0 Kudos

585 Views
gsteimle
Contributor II

Thanks for that reply.

Here is the output of 'mount | grep "/"':

rootfs on / type rootfs (ro,seclabel,size=279528k,nr_inodes=69882)

and here is the output of 'ls -ld /':

drwxrwxrwt 17 root root 920 2019-04-09 11:34 /

I still don't know how it's reporting that permission, but I am able to change it to 755 by adding 'chmod 0755' to the init.rc file.

0 Kudos

585 Views
b36401
NXP Employee
NXP Employee

Is your rootfs a ramdisk? Possibly it has wrong permissions before to be packed and stored.

0 Kudos