Return-Path: Received: from mail-dm3nam03on0131.outbound.protection.outlook.com ([104.47.41.131]:48288 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032562AbeCAPji (ORCPT ); Thu, 1 Mar 2018 10:39:38 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Johannes Berg , Sasha Levin Subject: [added to the 4.1 stable tree] cfg80211: fix cfg80211_beacon_dup Date: Thu, 1 Mar 2018 15:27:53 +0000 Message-ID: <20180301152116.1486-507-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit bee92d06157fc39d5d7836a061c7d41289a55797 ] gcc-8 warns about some obviously incorrect code: net/mac80211/cfg.c: In function 'cfg80211_beacon_dup': net/mac80211/cfg.c:2896:3: error: 'memcpy' source argument is the same as d= estination [-Werror=3Drestrict] >From the context, I conclude that we want to copy from beacon into new_beacon, as we do in the rest of the function. Cc: stable@vger.kernel.org Fixes: 73da7d5bab79 ("mac80211: add channel switch command and beacon callb= acks") Signed-off-by: Arnd Bergmann Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 37e0aa4891a2..cd85cbf9bf39 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2857,7 +2857,7 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beac= on) } if (beacon->probe_resp_len) { new_beacon->probe_resp_len =3D beacon->probe_resp_len; - beacon->probe_resp =3D pos; + new_beacon->probe_resp =3D pos; memcpy(pos, beacon->probe_resp, beacon->probe_resp_len); pos +=3D beacon->probe_resp_len; } --=20 2.14.1