Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f12aeeff authored by Tejaswi Tanikella's avatar Tejaswi Tanikella Committed by Gerrit - the friendly Code Review server
Browse files

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.

Change-Id: I37851f32a1b7ce3307644998c2cc7dd617bb7022
Signed-off-by: default avatarTejaswi Tanikella <tejaswit@codeaurora.org>
parent ea7861da
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * 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);