Re: [PATCH] Btrfs: fix various things with the listing ioctl

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

 



(2009/12/15 4:17), Josef Bacik wrote:
> With slab poisoning on you could panic the box simply by running btrfsctl -l
> multiple times in a row on the same volume.  This patch fixes up the ioctl stuff
> to be a bit cleaner, makes sure we always call btrfs_free_path() instead of
> kfree(path) and make sure we do not kfree() our work names before we are done
> using them.  There were several memory leaks and use after free problems
> previously, they appear to be gone now, and as an added bonus doing btrfsctl -l
> no longer panic's the box.  Thanks,
> 
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxx>
> ---

Thank you for your patch. I've tested this patch and
I found it works. And I'd like to add one line to
prevent from another tiny leak.

Signed-off-by: TARUISI Hiroaki <taruishi.hiroak@xxxxxxxxxxxxxx>
---
 fs/btrfs/ioctl.c |    1 +
 1 file changed, 1 insertion(+)

Index: b/fs/btrfs/ioctl.c
===================================================================
--- a/fs/btrfs/ioctl.c	2009-12-15 11:31:18.000000000 +0900
+++ b/fs/btrfs/ioctl.c	2009-12-15 11:33:28.000000000 +0900
@@ -989,6 +989,7 @@ static noinline int btrfs_ioctl_snap_lis
 		if (rest < sizeof(struct btrfs_ioctl_subvol_items) +
 			name_len + strlen(work_path) + 1) {
 			svol->next_len = name_len + strlen(work_path);
+			kfree(name);
 			if (copy_to_user(arg, svol, sizeof(*svol))) {
 				ret = -EFAULT;
 				goto out;

--
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