提交 4030b278 编写于 作者: N Namjae Jeon 提交者: Steve French

cifsd: prevent a integer overflow in wm_alloc()

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: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 9cca7516
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册