projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9cca751
)
cifsd: prevent a integer overflow in wm_alloc()
author
Namjae Jeon
<namjae.jeon@samsung.com>
Sun, 4 Apr 2021 08:52:58 +0000
(17:52 +0900)
committer
Steve French
<stfrench@microsoft.com>
Tue, 11 May 2021 00:15:37 +0000
(19:15 -0500)
Dan Carpenter pointed out that there there is a possibility of
integer overflow. This patch prevent a integer overflow in wm_alloc().
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifsd/buffer_pool.c
patch
|
blob
|
history
diff --git
a/fs/cifsd/buffer_pool.c
b/fs/cifsd/buffer_pool.c
index caf22c1906348be45b6a4c14cc1a7d73ecbda697..1ee1feef1bb4566971771913c78f16fca0bbbf15 100644
(file)
--- a/
fs/cifsd/buffer_pool.c
+++ b/
fs/cifsd/buffer_pool.c
@@
-42,6
+42,9
@@
static struct wm *wm_alloc(size_t sz, gfp_t flags)
struct wm *wm;
size_t alloc_sz = sz + sizeof(struct wm);
+ if (sz > SIZE_MAX - sizeof(struct wm))
+ return NULL;
+
wm = kvmalloc(alloc_sz, flags);
if (!wm)
return NULL;