Re: [PATCH] Btrfs-progs: check return value of realpath(3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 15, 2013 at 06:49:41PM +0200, David Sterba wrote:
> On Sat, Oct 12, 2013 at 11:47:52PM +0800, Eryu Guan wrote:
> > I hit a segfault when deleting a subvolume with very long name(>4096),
> 
> How do you get a valid pathname longer than PATH_MAX which is 4096 ?

Just as the steps in reproducer, you can try the following

path=/mnt/btrfs
for i in `seq 1 381`;do
	path="$path/subvol_$i"
	btrfs sub create $path
done
echo ${#path}  # len is 4093 here

((i++))
path="$path/subvol_$i"
btrfs sub create $path
echo ${#path}  # The length of absolute path of this subvolume is greater than 4096 now

Maybe just another bug of btrfs-progs?
> 
> > Fix it by checking return value of realpath(3), also fix the one in
> > find_mount_root().
> 
> The error handling itself is ok.

Thanks for the review!

Eryu
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux