On Fri, 27 Mar 2009, Pascal Terjan wrote:
> On Fri, Mar 27, 2009 at 6:00 PM, Szabolcs Szakacsits <sz...@ntfs-3g.org> 
> wrote:
> > On Fri, 27 Mar 2009, Pascal Terjan wrote:
> >
> >> I finally have some interesting information!
> >>
> >> This issue happens when audit is enabled:
> >>
> >> auditctl -e 1
> >> auditctl -w /etc
> >> mount /dev/sda1 /mnt/windows
> >
> > I suppose then the problem is in the kernel audit code? This is how
> > ntfs-3g mount happens considering the /etc directory:
> >
> >   /bin/mount calls /bin/ntfs-3g
> >   /bin/ntfs-3g calls /bin/mount to update /etc/mtab
> >   the second /bin/mount hangs
> >
> > Hopefully this will help the developer who is writing the kernel
> > audit code.
> 
> The second /bin/mount hangs on readlink("/mnt/windows",
> 
> mount         S 00004cca     0 11821  11819
>  c3401dcc 00200082 00004cca 00004cca c3401d7c c0134709 00200086 386e9131
>  000003e1 00004cca dfb8d540 dfb5a000 c05ebcd9 c05b7380 df88a490 df88a6f0
>  c1409380 00000000 00000000 38734404 000003e1 c3401db0 c3401da8 df88a6f0
> Call Trace:
>  [<c0134709>] ? release_console_sem+0x199/0x1e0
>  [<c014934a>] ? prepare_to_wait+0x3a/0x70
>  [<e0d4a77c>] wait_answer_interruptible+0x6c/0xa0 [fuse]
>  [<c01490f0>] ? autoremove_wake_function+0x0/0x50
>  [<e0d4a9f1>] fuse_request_send+0x181/0x250 [fuse]
>  [<e0d4bba5>] ? fuse_get_req+0xc5/0x120 [fuse]
>  [<e0d4c403>] fuse_getxattr+0xe3/0x140 [fuse]
>  [<e0d4c320>] ? fuse_getxattr+0x0/0x140 [fuse]
>  [<c022d940>] get_vfs_caps_from_disk+0x60/0xe0
>  [<c01ba5eb>] ? __link_path_walk+0x26b/0xd70
>  [<c016cfa7>] audit_copy_inode+0x77/0xb0
>  [<c016d410>] __audit_inode+0xf0/0x280
>  [<c01bb4da>] do_path_lookup+0x13a/0x1a0
>  [<c01bc0aa>] user_path_at+0x4a/0x80
>  [<c01c770d>] ? mntput_no_expire+0x1d/0x140
>  [<c01c770d>] ? mntput_no_expire+0x1d/0x140
>  [<c01b45fe>] sys_readlinkat+0x2e/0x90
>  [<c01b4687>] sys_readlink+0x27/0x30
>  [<c0103fdb>] sysenter_do_call+0x12/0x2f
>  [<c03a0000>] ? serial_pnp_probe+0xb0/0x240

Very useful information, thank you.
 
> So it looks like the issue is that when mount does readlink on the
> mountpoint audit will do a request to get the xattr which will hang
> because ntfs-3g is not ready to reply, probably waiting for mount to
> finish

Yes. 

> Is it necessary to wait for the child mount in main process ?

Yes. 

I forwarded the issue to FUSE development. I'll let you know ASAP when 
there is a solution or suggestion where/how the "mount on a symlink with 
audit turned on for the /etc directory" scenario could be fixed.

Thanks,
           Szaka

------------------------------------------------------------------------------
_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to