Skip to content

Commit 5d8a4bd

Browse files
committed
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
2 parents fadc3ed + 067cdf0 commit 5d8a4bd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

fs/pstore/blk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static struct pstore_device_info *pstore_device_info;
8989
_##name_ = check_size(name, alignsize); \
9090
else \
9191
_##name_ = 0; \
92-
/* Synchronize module parameters with resuls. */ \
92+
/* Synchronize module parameters with results. */ \
9393
name = _##name_ / 1024; \
9494
dev->zone.name = _##name_; \
9595
}
@@ -121,7 +121,7 @@ static int __register_pstore_device(struct pstore_device_info *dev)
121121
if (pstore_device_info)
122122
return -EBUSY;
123123

124-
/* zero means not limit on which backends to attempt to store. */
124+
/* zero means no limit on which backends attempt to store. */
125125
if (!dev->flags)
126126
dev->flags = UINT_MAX;
127127

fs/pstore/zone.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,11 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
12121212
}
12131213

12141214
c = total_size / record_size;
1215+
if (unlikely(!c)) {
1216+
pr_err("zone %s total_size too small\n", name);
1217+
return ERR_PTR(-EINVAL);
1218+
}
1219+
12151220
zones = kcalloc(c, sizeof(*zones), GFP_KERNEL);
12161221
if (!zones) {
12171222
pr_err("allocate for zones %s failed\n", name);

0 commit comments

Comments
 (0)