mmap() on a directory should return ENODEV, but on ecryptfs mmap() on Lucid returns
a mmap'd address which causes a SIGBUS when accessed.
Fix: Apply the backported patch, open a directory on an ecryptfs filesystem
and mmap with mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, fd, 0). With the fix
this returns ENODEV, without it mmap returns a mmap'd region which causes a SIGBUS
when accessed.
The attached C test program exercises this bug and works correctly with the fix.
SRU Justification:
mmap() on a directory should return ENODEV, but on ecryptfs mmap() on Lucid returns
a mmap'd address which causes a SIGBUS when accessed.
Fix: Apply the backported patch, open a directory on an ecryptfs filesystem
and mmap with mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, fd, 0). With the fix
this returns ENODEV, without it mmap returns a mmap'd region which causes a SIGBUS
when accessed.
The attached C test program exercises this bug and works correctly with the fix.