]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: fix corner case of conflicting lower layer uuid
authorAmir Goldstein <amir73il@gmail.com>
Sat, 16 Nov 2019 16:52:20 +0000 (18:52 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 24 Jan 2020 08:46:45 +0000 (09:46 +0100)
commitafd47c44942f6aa91f8a02f739e96882fbb9da0e
treecbd7bb2a96384c3ab2430e95ce5e0e8ccf67b5a3
parent4665f56076661802331a09ca07216fd36ba30665
ovl: fix corner case of conflicting lower layer uuid

This fixes ovl_lower_uuid_ok() to correctly detect the corner case:
 - two filesystems, A and B, both have null uuid
 - upper layer is on A
 - lower layer 1 is also on A
 - lower layer 2 is on B

In this case, bad_uuid would not have been set for B, because the check
only involved the list of lower fs.  Hence we'll try to decode a layer 2
origin on layer 1 and fail.

We check for conflicting (and null) uuid among all lower layers, including
those layers that are on the same fs as the upper layer.

Reported-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/ovl_entry.h
fs/overlayfs/super.c