Re: [PATCH] Validate pointer when copying mount namespace.

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

 



On Wed, Apr 29, 2015 at 09:56:43AM +0800, Leon Ma wrote:
> We encountered following panic. Validate the pointer to avoid this.

> @@ -2788,7 +2788,7 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
>  		q = next_mnt(q, new);
>  		if (!q)
>  			break;
> -		while (p->mnt.mnt_root != q->mnt.mnt_root)
> +		while (p && p->mnt.mnt_root != q->mnt.mnt_root)
>  			p = next_mnt(p, old);
>  	}
>  	namespace_unlock();

Details, please.  How do you reproduce that behaviour?  

I don't like that loop in its current form (it relies upon _not_ encountering
the same ->mnt_root in the parts of tree we hadn't copied), but your change
doesn't make it any better.  Seeing a reproducer would be useful in sorting
it out; in this form the patch papers over the bug rather than fixing it.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux