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

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

Pull ubifs updates from Richard Weinberger:

- Kernel-doc fixes

- Fixes for memory leaks in authentication option parsing

* tag 'for-linus-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
ubifs: mount_ubifs: Release authentication resource in error handling path
ubifs: Don't parse authentication mount options in remount process
ubifs: Fix a memleak after dumping authentication mount options
ubifs: Fix some kernel-doc warnings in tnc.c
ubifs: Fix some kernel-doc warnings in replay.c
ubifs: Fix some kernel-doc warnings in gc.c
ubifs: Fix 'hash' kernel-doc warning in auth.c

+34 -21
+1 -1
fs/ubifs/auth.c
··· 54 54 * ubifs_prepare_auth_node - Prepare an authentication node 55 55 * @c: UBIFS file-system description object 56 56 * @node: the node to calculate a hash for 57 - * @hash: input hash of previous nodes 57 + * @inhash: input hash of previous nodes 58 58 * 59 59 * This function prepares an authentication node for writing onto flash. 60 60 * It creates a HMAC from the given input hash and writes it to the node.
-4
fs/ubifs/gc.c
··· 57 57 /** 58 58 * switch_gc_head - switch the garbage collection journal head. 59 59 * @c: UBIFS file-system description object 60 - * @buf: buffer to write 61 - * @len: length of the buffer to write 62 - * @lnum: LEB number written is returned here 63 - * @offs: offset written is returned here 64 60 * 65 61 * This function switch the GC head to the next LEB which is reserved in 66 62 * @c->gc_lnum. Returns %0 in case of success, %-EAGAIN if commit is required,
-2
fs/ubifs/replay.c
··· 931 931 * validate_ref - validate a reference node. 932 932 * @c: UBIFS file-system description object 933 933 * @ref: the reference node to validate 934 - * @ref_lnum: LEB number of the reference node 935 - * @ref_offs: reference node offset 936 934 * 937 935 * This function returns %1 if a bud reference already exists for the LEB. %0 is 938 936 * returned if the reference node is new, otherwise %-EINVAL is returned if
+32 -12
fs/ubifs/super.c
··· 1110 1110 break; 1111 1111 } 1112 1112 case Opt_auth_key: 1113 - c->auth_key_name = kstrdup(args[0].from, GFP_KERNEL); 1114 - if (!c->auth_key_name) 1115 - return -ENOMEM; 1113 + if (!is_remount) { 1114 + c->auth_key_name = kstrdup(args[0].from, 1115 + GFP_KERNEL); 1116 + if (!c->auth_key_name) 1117 + return -ENOMEM; 1118 + } 1116 1119 break; 1117 1120 case Opt_auth_hash_name: 1118 - c->auth_hash_name = kstrdup(args[0].from, GFP_KERNEL); 1119 - if (!c->auth_hash_name) 1120 - return -ENOMEM; 1121 + if (!is_remount) { 1122 + c->auth_hash_name = kstrdup(args[0].from, 1123 + GFP_KERNEL); 1124 + if (!c->auth_hash_name) 1125 + return -ENOMEM; 1126 + } 1121 1127 break; 1122 1128 case Opt_ignore: 1123 1129 break; ··· 1145 1139 } 1146 1140 1147 1141 return 0; 1142 + } 1143 + 1144 + /* 1145 + * ubifs_release_options - release mount parameters which have been dumped. 1146 + * @c: UBIFS file-system description object 1147 + */ 1148 + static void ubifs_release_options(struct ubifs_info *c) 1149 + { 1150 + kfree(c->auth_key_name); 1151 + c->auth_key_name = NULL; 1152 + kfree(c->auth_hash_name); 1153 + c->auth_hash_name = NULL; 1148 1154 } 1149 1155 1150 1156 /** ··· 1331 1313 1332 1314 err = ubifs_read_superblock(c); 1333 1315 if (err) 1334 - goto out_free; 1316 + goto out_auth; 1335 1317 1336 1318 c->probing = 0; 1337 1319 ··· 1343 1325 ubifs_err(c, "'compressor \"%s\" is not compiled in", 1344 1326 ubifs_compr_name(c, c->default_compr)); 1345 1327 err = -ENOTSUPP; 1346 - goto out_free; 1328 + goto out_auth; 1347 1329 } 1348 1330 1349 1331 err = init_constants_sb(c); 1350 1332 if (err) 1351 - goto out_free; 1333 + goto out_auth; 1352 1334 1353 1335 sz = ALIGN(c->max_idx_node_sz, c->min_io_size) * 2; 1354 1336 c->cbuf = kmalloc(sz, GFP_NOFS); 1355 1337 if (!c->cbuf) { 1356 1338 err = -ENOMEM; 1357 - goto out_free; 1339 + goto out_auth; 1358 1340 } 1359 1341 1360 1342 err = alloc_wbufs(c); ··· 1629 1611 free_wbufs(c); 1630 1612 out_cbuf: 1631 1613 kfree(c->cbuf); 1614 + out_auth: 1615 + ubifs_exit_authentication(c); 1632 1616 out_free: 1633 1617 kfree(c->write_reserve_buf); 1634 1618 kfree(c->bu.buf); ··· 1670 1650 ubifs_lpt_free(c, 0); 1671 1651 ubifs_exit_authentication(c); 1672 1652 1673 - kfree(c->auth_key_name); 1674 - kfree(c->auth_hash_name); 1653 + ubifs_release_options(c); 1675 1654 kfree(c->cbuf); 1676 1655 kfree(c->rcvrd_mst_node); 1677 1656 kfree(c->mst_node); ··· 2240 2221 out_unlock: 2241 2222 mutex_unlock(&c->umount_mutex); 2242 2223 out_close: 2224 + ubifs_release_options(c); 2243 2225 ubi_close_volume(c->ubi); 2244 2226 out: 2245 2227 return err;
+1 -2
fs/ubifs/tnc.c
··· 360 360 /** 361 361 * lnc_free - remove a leaf node from the leaf node cache. 362 362 * @zbr: zbranch of leaf node 363 - * @node: leaf node 364 363 */ 365 364 static void lnc_free(struct ubifs_zbranch *zbr) 366 365 { ··· 3465 3466 /** 3466 3467 * dbg_check_inode_size - check if inode size is correct. 3467 3468 * @c: UBIFS file-system description object 3468 - * @inum: inode number 3469 + * @inode: inode to check 3469 3470 * @size: inode size 3470 3471 * 3471 3472 * This function makes sure that the inode size (@size) is correct and it does