Comment 1 for bug 1948470

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Steps to Reproduce:

1) test app

 # cat openat.c
 #include <stdio.h>
 #include <fcntl.h>

 int main() {
  int rc;
  rc = openat(AT_FDCWD, "test", O_RDWR | O_CREAT | S_IRWXU);
  if (rc < 0) {
          perror("openat");
          return 1;
  }
  return 0;
 }

 # gcc -o openat openat.c

2) ntfs-3g mount (fuseblk)

 # truncate -s 1g ntfs.img
 # DEV=$(losetup -f --show ntfs.img)
 # mkfs.ntfs --fast $DEV

 # mkdir ntfs
 # mount -t ntfs-3g $DEV ntfs

 # mount | grep ntfs | grep fuseblk
 /dev/loop6 on /home/ubuntu/ntfs type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

3) aufs mount (with 'test' file in the read-only branch)

 # mkdir ro aufs
 # touch ro/test
 # mount -t aufs -o br=ntfs:ro none aufs

4) enable apparmor for the test app (even in complain mode with aa-genprof)

 # aa-genprof ./openat &
 ...
 Please start the application to be profiled in
 another window and exercise its functionality now.
 ...
 <press enter>
 [1]+ Stopped aa-genprof ./openat

5) remove 'test' file from read-write branch (still exists in read-only branch)

 # cd aufs
 # rm test

6) run the test app

 # ../openat
 Killed

7) check kernel logs

 # dmesg