diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-10-01 07:57:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-10-01 07:57:27 -0400 |
commit | f97b870eced0ec562f953d32eda03906c7dacad6 (patch) | |
tree | 232ce6b9dc47eecd3f69cf64b0018431397009cc | |
parent | 9522f476d932eb23ebf8dbbc6b4e2f966f3fe911 (diff) | |
parent | 7c7feb2ebfc9c0552c51f0c050db1d1a004faac5 (diff) |
Merge tag 'upstream-4.3-rc4' of git://git.infradead.org/linux-ubifs
Pull UBI/UBIFS fixes from Richard Weinberger:
"This contains three bug fixes for both UBI and UBIFS"
* tag 'upstream-4.3-rc4' of git://git.infradead.org/linux-ubifs:
UBI: return ENOSPC if no enough space available
UBI: Validate data_size
UBIFS: Kill unneeded locking in ubifs_init_security
-rw-r--r-- | drivers/mtd/ubi/io.c | 5 | ||||
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 1 | ||||
-rw-r--r-- | drivers/mtd/ubi/wl.c | 1 | ||||
-rw-r--r-- | fs/ubifs/xattr.c | 3 |
4 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 5bbd1f094f4e..1fc23e48fe8e 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
@@ -926,6 +926,11 @@ static int validate_vid_hdr(const struct ubi_device *ubi, | |||
926 | goto bad; | 926 | goto bad; |
927 | } | 927 | } |
928 | 928 | ||
929 | if (data_size > ubi->leb_size) { | ||
930 | ubi_err(ubi, "bad data_size"); | ||
931 | goto bad; | ||
932 | } | ||
933 | |||
929 | if (vol_type == UBI_VID_STATIC) { | 934 | if (vol_type == UBI_VID_STATIC) { |
930 | /* | 935 | /* |
931 | * Although from high-level point of view static volumes may | 936 | * Although from high-level point of view static volumes may |
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 80bdd5b88bac..d85c19762160 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
@@ -649,6 +649,7 @@ static int init_volumes(struct ubi_device *ubi, | |||
649 | if (ubi->corr_peb_count) | 649 | if (ubi->corr_peb_count) |
650 | ubi_err(ubi, "%d PEBs are corrupted and not used", | 650 | ubi_err(ubi, "%d PEBs are corrupted and not used", |
651 | ubi->corr_peb_count); | 651 | ubi->corr_peb_count); |
652 | return -ENOSPC; | ||
652 | } | 653 | } |
653 | ubi->rsvd_pebs += reserved_pebs; | 654 | ubi->rsvd_pebs += reserved_pebs; |
654 | ubi->avail_pebs -= reserved_pebs; | 655 | ubi->avail_pebs -= reserved_pebs; |
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 275d9fb6fe5c..eb4489f9082f 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
@@ -1601,6 +1601,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai) | |||
1601 | if (ubi->corr_peb_count) | 1601 | if (ubi->corr_peb_count) |
1602 | ubi_err(ubi, "%d PEBs are corrupted and not used", | 1602 | ubi_err(ubi, "%d PEBs are corrupted and not used", |
1603 | ubi->corr_peb_count); | 1603 | ubi->corr_peb_count); |
1604 | err = -ENOSPC; | ||
1604 | goto out_free; | 1605 | goto out_free; |
1605 | } | 1606 | } |
1606 | ubi->avail_pebs -= reserved_pebs; | 1607 | ubi->avail_pebs -= reserved_pebs; |
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 96f3448b6eb4..fd65b3f1923c 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c | |||
@@ -652,11 +652,8 @@ int ubifs_init_security(struct inode *dentry, struct inode *inode, | |||
652 | { | 652 | { |
653 | int err; | 653 | int err; |
654 | 654 | ||
655 | mutex_lock(&inode->i_mutex); | ||
656 | err = security_inode_init_security(inode, dentry, qstr, | 655 | err = security_inode_init_security(inode, dentry, qstr, |
657 | &init_xattrs, 0); | 656 | &init_xattrs, 0); |
658 | mutex_unlock(&inode->i_mutex); | ||
659 | |||
660 | if (err) { | 657 | if (err) { |
661 | struct ubifs_info *c = dentry->i_sb->s_fs_info; | 658 | struct ubifs_info *c = dentry->i_sb->s_fs_info; |
662 | ubifs_err(c, "cannot initialize security for inode %lu, error %d", | 659 | ubifs_err(c, "cannot initialize security for inode %lu, error %d", |