lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190225123849.50574-1-yuehaibing@huawei.com>
Date:   Mon, 25 Feb 2019 12:38:49 +0000
From:   YueHaibing <yuehaibing@...wei.com>
To:     Johannes Berg <johannes@...solutions.net>
CC:     YueHaibing <yuehaibing@...wei.com>,
        <linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: [PATCH] cfg80211: Use kmemdup in cfg80211_gen_new_ie()

Use kmemdup rather than duplicating its implementation

Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
 net/wireless/scan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 287518c6caa4..04d888628f29 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -190,10 +190,9 @@ static size_t cfg80211_gen_new_ie(const u8 *ie, size_t ielen,
 	/* copy subelement as we need to change its content to
 	 * mark an ie after it is processed.
 	 */
-	sub_copy = kmalloc(subie_len, gfp);
+	sub_copy = kmemdup(subelement, subie_len, gfp);
 	if (!sub_copy)
 		return 0;
-	memcpy(sub_copy, subelement, subie_len);
 
 	pos = &new_ie[0];



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ