aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejaswi Tanikella <tejaswit@codeaurora.org>2018-06-11 16:30:24 +0530
committerShirle Yuen <shirleyshukyee@google.com>2018-08-05 16:48:51 -0700
commitf7a02852d10c96d88c049f3b5b129a13964142a5 (patch)
tree1144704bcf4993a2ce4fc03464d3a1467bb8b92e
parentf366ffa63dde19448b04a37f3478f08fea6e6c09 (diff)
downloadqcom-msm8x09-v3.10-f7a02852d10c96d88c049f3b5b129a13964142a5.tar.gz
net: sockev: fix uninitialized data leak into userspace
Socket event string, notifying userspace of socket event, can leak data into userspace. Memset it before filling it using strlcpy. Bug: 111289931 Change-Id: I37851f32a1b7ce3307644998c2cc7dd617bb7022 Signed-off-by: Tejaswi Tanikella <tejaswit@codeaurora.org> (cherry picked from commit 39d1722d40316ceb59bf6072823f324808b31229)
-rw-r--r--net/core/sockev_nlmcast.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/sockev_nlmcast.c b/net/core/sockev_nlmcast.c
index 749ffb81c87..3d7dabef641 100644
--- a/net/core/sockev_nlmcast.c
+++ b/net/core/sockev_nlmcast.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015, 2018 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -36,6 +36,8 @@ static struct netlink_kernel_cfg nlcfg = {
static void _sockev_event(unsigned long event, __u8 *evstr, int buflen)
{
+ memset(evstr, 0, buflen);
+
switch (event) {
case SOCKEV_SOCKET:
strlcpy(evstr, "SOCKEV_SOCKET", buflen);