Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-linus-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs

Pull JFFS2/UBIFS and UBI updates from Richard Weinberger:
"JFFS2:
- Fix for use-after-free in jffs2_sum_write_data()
- Fix for out-of-bounds access in jffs2_zlib_compress()

UBI:
- Remove dead/useless code

UBIFS:
- Fix for a memory leak in ubifs_init_authentication()
- Fix for high stack usage
- Fix for a off-by-one error in xattrs code"

* tag 'for-linus-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
ubifs: Fix error return code in alloc_wbufs()
jffs2: check the validity of dstlen in jffs2_zlib_compress()
ubifs: Fix off-by-one error
ubifs: replay: Fix high stack usage, again
ubifs: Fix memleak in ubifs_init_authentication
jffs2: fix use after free in jffs2_sum_write_data()
ubi: eba: Delete useless kfree code
ubi: remove dead code in validate_vid_hdr()

+16 -12
-1
drivers/mtd/ubi/eba.c
··· 142 142 return tbl; 143 143 144 144 err: 145 - kfree(tbl->entries); 146 145 kfree(tbl); 147 146 148 147 return ERR_PTR(err);
+1 -6
drivers/mtd/ubi/io.c
··· 913 913 ubi_err(ubi, "bad data_size"); 914 914 goto bad; 915 915 } 916 - } else if (lnum == used_ebs - 1) { 917 - if (data_size == 0) { 918 - ubi_err(ubi, "bad data_size at last LEB"); 919 - goto bad; 920 - } 921 - } else { 916 + } else if (lnum > used_ebs - 1) { 922 917 ubi_err(ubi, "too high lnum"); 923 918 goto bad; 924 919 }
+3
fs/jffs2/compr_rtime.c
··· 37 37 int outpos = 0; 38 38 int pos=0; 39 39 40 + if (*dstlen <= 3) 41 + return -1; 42 + 40 43 memset(positions,0,sizeof(positions)); 41 44 42 45 while (pos < (*sourcelen) && outpos <= (*dstlen)-2) {
+3
fs/jffs2/summary.c
··· 783 783 dbg_summary("Writing unknown RWCOMPAT_COPY node type %x\n", 784 784 je16_to_cpu(temp->u.nodetype)); 785 785 jffs2_sum_disable_collecting(c->summary); 786 + /* The above call removes the list, nothing more to do */ 787 + goto bail_rwcompat; 786 788 } else { 787 789 BUG(); /* unknown node in summary information */ 788 790 } ··· 796 794 797 795 c->summary->sum_num--; 798 796 } 797 + bail_rwcompat: 799 798 800 799 jffs2_sum_reset_collected(c->summary); 801 800
+1 -1
fs/ubifs/auth.c
··· 327 327 ubifs_err(c, "hmac %s is bigger than maximum allowed hmac size (%d > %d)", 328 328 hmac_name, c->hmac_desc_len, UBIFS_HMAC_ARR_SZ); 329 329 err = -EINVAL; 330 - goto out_free_hash; 330 + goto out_free_hmac; 331 331 } 332 332 333 333 err = crypto_shash_setkey(c->hmac_tfm, ukp->data, ukp->datalen);
+1 -1
fs/ubifs/journal.c
··· 881 881 struct inode *xino; 882 882 struct ubifs_dent_node *xent, *pxent = NULL; 883 883 884 - if (ui->xattr_cnt >= ubifs_xattr_max_cnt(c)) { 884 + if (ui->xattr_cnt > ubifs_xattr_max_cnt(c)) { 885 885 ubifs_err(c, "Cannot delete inode, it has too much xattrs!"); 886 886 goto out_release; 887 887 }
+3 -1
fs/ubifs/replay.c
··· 559 559 } 560 560 561 561 /* authenticate_sleb_hash is split out for stack usage */ 562 - static int authenticate_sleb_hash(struct ubifs_info *c, struct shash_desc *log_hash, u8 *hash) 562 + static int noinline_for_stack 563 + authenticate_sleb_hash(struct ubifs_info *c, 564 + struct shash_desc *log_hash, u8 *hash) 563 565 { 564 566 SHASH_DESC_ON_STACK(hash_desc, c->hash_tfm); 565 567
+3 -1
fs/ubifs/super.c
··· 838 838 c->jheads[i].wbuf.jhead = i; 839 839 c->jheads[i].grouped = 1; 840 840 c->jheads[i].log_hash = ubifs_hash_get_desc(c); 841 - if (IS_ERR(c->jheads[i].log_hash)) 841 + if (IS_ERR(c->jheads[i].log_hash)) { 842 + err = PTR_ERR(c->jheads[i].log_hash); 842 843 goto out; 844 + } 843 845 } 844 846 845 847 /*
+1 -1
fs/ubifs/xattr.c
··· 498 498 struct fscrypt_name nm = {0}; 499 499 int err; 500 500 501 - if (ubifs_inode(host)->xattr_cnt < ubifs_xattr_max_cnt(c)) 501 + if (ubifs_inode(host)->xattr_cnt <= ubifs_xattr_max_cnt(c)) 502 502 return 0; 503 503 504 504 ubifs_warn(c, "inode %lu has too many xattrs, doing a non-atomic deletion",