1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 07:53:11 -05:00

pstore updates for v6.14-rc1

- pstore/blk: trivial typo fixes (Eugen Hristev)
 
 - pstore/zone: reject zero-sized allocations (Eugen Hristev)
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRSPkdeREjth1dHnSE2KwveOeQkuwUCZ4hRFwAKCRA2KwveOeQk
 u9nXAQCieFhSxc1peuUzbN2HENIIu2S/agsE9CIOQrnZEFVixAD/bIj5EMfw4sF0
 T7v140vGsk7Bg9apbWhnGdoI/vzzcQg=
 =j5zd
 -----END PGP SIGNATURE-----

Merge tag 'pstore-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull pstore updates from Kees Cook:

 - pstore/blk: trivial typo fixes (Eugen Hristev)

 - pstore/zone: reject zero-sized allocations (Eugen Hristev)

* tag 'pstore-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore/zone: avoid dereferencing zero sized ptr after init zones
  pstore/blk: trivial typo fixes
This commit is contained in:
Linus Torvalds 2025-01-20 13:37:14 -08:00
commit 5d8a4bd6b2
2 changed files with 7 additions and 2 deletions

View file

@ -89,7 +89,7 @@ static struct pstore_device_info *pstore_device_info;
_##name_ = check_size(name, alignsize); \ _##name_ = check_size(name, alignsize); \
else \ else \
_##name_ = 0; \ _##name_ = 0; \
/* Synchronize module parameters with resuls. */ \ /* Synchronize module parameters with results. */ \
name = _##name_ / 1024; \ name = _##name_ / 1024; \
dev->zone.name = _##name_; \ dev->zone.name = _##name_; \
} }
@ -121,7 +121,7 @@ static int __register_pstore_device(struct pstore_device_info *dev)
if (pstore_device_info) if (pstore_device_info)
return -EBUSY; return -EBUSY;
/* zero means not limit on which backends to attempt to store. */ /* zero means no limit on which backends attempt to store. */
if (!dev->flags) if (!dev->flags)
dev->flags = UINT_MAX; dev->flags = UINT_MAX;

View file

@ -1212,6 +1212,11 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
} }
c = total_size / record_size; c = total_size / record_size;
if (unlikely(!c)) {
pr_err("zone %s total_size too small\n", name);
return ERR_PTR(-EINVAL);
}
zones = kcalloc(c, sizeof(*zones), GFP_KERNEL); zones = kcalloc(c, sizeof(*zones), GFP_KERNEL);
if (!zones) { if (!zones) {
pr_err("allocate for zones %s failed\n", name); pr_err("allocate for zones %s failed\n", name);