mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
- dm: fix reading past the end of allocated memory
- dm: fix missing dm_put_live_table() in dm_keyslot_evict() -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRnH8MwLyZDhyYfesYTAyx9YGnhbQUCaBn8PhQcbXBhdG9ja2FA cmVkaGF0LmNvbQAKCRATAyx9YGnhbVCUAQDDMCRu68hiL5SWai9YXhw40rPTuC7k e/zHIwRsObItgAD/YvRH1d85XBhQY5x3PCHa3j1u9q+S3uF4naG1n1afqw8= =L5lI -----END PGP SIGNATURE----- Merge tag 'for-6.15/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mikulas Patocka: - fix reading past the end of allocated memory - fix missing dm_put_live_table() in dm_keyslot_evict() * tag 'for-6.15/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: fix copying after src array boundaries dm: add missing unlock on in dm_keyslot_evict()
This commit is contained in:
commit
cccd033714
1 changed files with 3 additions and 2 deletions
|
|
@ -524,9 +524,9 @@ static char **realloc_argv(unsigned int *size, char **old_argv)
|
||||||
}
|
}
|
||||||
argv = kmalloc_array(new_size, sizeof(*argv), gfp);
|
argv = kmalloc_array(new_size, sizeof(*argv), gfp);
|
||||||
if (argv) {
|
if (argv) {
|
||||||
*size = new_size;
|
|
||||||
if (old_argv)
|
if (old_argv)
|
||||||
memcpy(argv, old_argv, *size * sizeof(*argv));
|
memcpy(argv, old_argv, *size * sizeof(*argv));
|
||||||
|
*size = new_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(old_argv);
|
kfree(old_argv);
|
||||||
|
|
@ -1173,7 +1173,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
|
||||||
|
|
||||||
t = dm_get_live_table(md, &srcu_idx);
|
t = dm_get_live_table(md, &srcu_idx);
|
||||||
if (!t)
|
if (!t)
|
||||||
return 0;
|
goto put_live_table;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < t->num_targets; i++) {
|
for (unsigned int i = 0; i < t->num_targets; i++) {
|
||||||
struct dm_target *ti = dm_table_get_target(t, i);
|
struct dm_target *ti = dm_table_get_target(t, i);
|
||||||
|
|
@ -1184,6 +1184,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
|
||||||
(void *)key);
|
(void *)key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
put_live_table:
|
||||||
dm_put_live_table(md, srcu_idx);
|
dm_put_live_table(md, srcu_idx);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue