udf: avoid info leak on export
Mathias Krause [Thu, 12 Jul 2012 06:46:55 +0000 (08:46 +0200)]
commit 0143fc5e9f6f5aad4764801015bc8d4b4a278200 upstream.

For type 0x51 the udf.parent_partref member in struct fid gets copied
uninitialized to userland. Fix this by initializing it to 0.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

fs/udf/namei.c

index 38de8f2..78bff11 100644 (file)
@@ -1280,6 +1280,7 @@ static int udf_encode_fh(struct dentry *de, __u32 *fh, int *lenp,
        *lenp = 3;
        fid->udf.block = location.logicalBlockNum;
        fid->udf.partref = location.partitionReferenceNum;
+       fid->udf.parent_partref = 0;
        fid->udf.generation = inode->i_generation;
 
        if (connectable && !S_ISDIR(inode->i_mode)) {