Commit a1a67109 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull isofs and udf fixes from Jan Kara:
 "Several isofs and udf fixes"

* tag 'fs_for_v7.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  docs: isofs: replace dead ECMA-119 FTP link
  udf: reject descriptors with oversized CRC length
  isofs: use QSTR_LEN() in isofs_cmp
  isofs: validate block number from NFS file handle in isofs_export_iget
  isofs: validate Rock Ridge CE continuation extent against volume size
parents 53b61563 13917f71
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ Mount options unique to the isofs filesystem.
Recommended documents about ISO 9660 standard are located at:

- http://www.y-adagio.com/
- ftp://ftp.ecma.ch/ecma-st/Ecma-119.pdf
- https://ecma-international.org/wp-content/uploads/ECMA-119_2nd_edition_december_1987.pdf

Quoting from the PDF "This 2nd Edition of Standard ECMA-119 is technically
identical with ISO 9660.", so it is a valid and gratis substitute of the
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ isofs_export_iget(struct super_block *sb,
{
	struct inode *inode;

	if (block == 0)
	if (block == 0 || block >= ISOFS_SB(sb)->s_nzones)
		return ERR_PTR(-ESTALE);
	inode = isofs_iget(sb, block, offset);
	if (IS_ERR(inode))
+2 −9
Original line number Diff line number Diff line
@@ -10,20 +10,13 @@
#include <linux/gfp.h>
#include "isofs.h"

/*
 * ok, we cannot use strncmp, as the name is not in our data space.
 * Thus we'll have to use isofs_match. No big problem. Match also makes
 * some sanity tests.
 */
static int
isofs_cmp(struct dentry *dentry, const char *compare, int dlen)
{
	struct qstr qstr;
	qstr.name = compare;
	qstr.len = dlen;
	if (likely(!dentry->d_op))
		return dentry->d_name.len != dlen || memcmp(dentry->d_name.name, compare, dlen);
	return dentry->d_op->d_compare(NULL, dentry->d_name.len, dentry->d_name.name, &qstr);
	return dentry->d_op->d_compare(NULL, dentry->d_name.len, dentry->d_name.name,
				       &QSTR_LEN(compare, dlen));
}

/*
+9 −0
Original line number Diff line number Diff line
@@ -101,6 +101,15 @@ static int rock_continue(struct rock_state *rs)
		goto out;
	}

	if ((unsigned)rs->cont_extent >= ISOFS_SB(rs->inode->i_sb)->s_nzones) {
		printk(KERN_NOTICE "rock: corrupted directory entry. "
			"extent=%u out of volume (nzones=%lu)\n",
			(unsigned)rs->cont_extent,
			ISOFS_SB(rs->inode->i_sb)->s_nzones);
		ret = -EIO;
		goto out;
	}

	if (rs->cont_extent) {
		struct buffer_head *bh;

+6 −2
Original line number Diff line number Diff line
@@ -230,8 +230,12 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
	}

	/* Verify the descriptor CRC */
	if (le16_to_cpu(tag_p->descCRCLength) + sizeof(struct tag) > sb->s_blocksize ||
	    le16_to_cpu(tag_p->descCRC) == crc_itu_t(0,
	if (le16_to_cpu(tag_p->descCRCLength) + sizeof(struct tag) > sb->s_blocksize) {
		udf_err(sb, "block %u: CRC length %u exceeds block size\n",
			block, le16_to_cpu(tag_p->descCRCLength));
		goto error_out;
	}
	if (le16_to_cpu(tag_p->descCRC) == crc_itu_t(0,
					bh->b_data + sizeof(struct tag),
					le16_to_cpu(tag_p->descCRCLength)))
		return bh;