umount crashes when trying to umount a non-mountpoint
If I run umount /foo where /foo is an existing directory, but not a mountpoint, umount (v2.23-rc1) crashes in mnt_copy_fs() instead of printing the usual "not mounted" message:
Quoted 29 lines
Program terminated with signal 11, Segmentation fault. #0
mnt_copy_fs(dest=0x1fd2ea0, src=0x2) atlibmount/src/fs.c:140
140dest->id=src->id;
(gdb) bt
#0mnt_copy_fs(dest=0x1fd2ea0, src=0x2) atlibmount/src/fs.c:140org = 0x1fd2ea0 #1 0x00007f5adb9a8a70 in lookup_umount_fs (cxt=0x1fd2da0) at libmount/src/context_umount.c:212 tgt = 0x1fd2f70 "\200@\375\001" fs = 0x2 rc = 1 #2 mnt_context_prepare_umount (cxt=cxt@entry=0x1fd2da0) at libmount/src/context_umount.c:684 rc = <optimized out> __PRETTY_FUNCTION__ = "mnt_context_prepare_umount" #3 0x00007f5adb9a9e48 in mnt_context_umount (cxt=cxt@entry=0x1fd2da0) at libmount/src/context_umount.c:839 rc = <optimized out> __PRETTY_FUNCTION__ = "mnt_context_umount" #4 0x00000000004035a5 in umount_one (cxt=0x1fd2da0, spec=<optimized out>) at sys-utils/umount.c:296 rc = <optimized out> #5 0x0000000000402c58 in main (argc=<optimized out>, argv=<optimized out>) at sys-utils/umount.c:627...
(gdb) p dest
$1 = (structlibmnt_fs*)0x608ea0
(gdb) p src
$2 = (const structlibmnt_fs*)0x2
Signature · 1 line
Mantas Mikulėnas <[email protected]>
Karel Zak
maintainerQuoted 3 lines · Mantas Mikulėnas
If I run
umount /foowhere /foo is an existing directory, but not a mountpoint,umount(v2.23-rc1) crashes inmnt_copy_fs()instead of printing the usual "not mounted" message:
Fixed. Thanks!
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com