From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:50488 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbdHHX31 (ORCPT ); Tue, 8 Aug 2017 19:29:27 -0400 Subject: Patch "rtnetlink: allocate more memory for dev_set_mac_address()" has been added to the 4.12-stable tree To: xiyou.wangcong@gmail.com, davem@davemloft.net, dsahern@gmail.com, gregkh@linuxfoundation.org Cc: , From: Date: Tue, 08 Aug 2017 16:29:21 -0700 Message-ID: <15022349611380@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled rtnetlink: allocate more memory for dev_set_mac_address() to the 4.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: rtnetlink-allocate-more-memory-for-dev_set_mac_address.patch and it can be found in the queue-4.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Tue Aug 8 16:27:29 PDT 2017 From: WANG Cong Date: Thu, 20 Jul 2017 11:27:57 -0700 Subject: rtnetlink: allocate more memory for dev_set_mac_address() From: WANG Cong [ Upstream commit 153711f9421be5dbc973dc57a4109dc9d54c89b1 ] virtnet_set_mac_address() interprets mac address as struct sockaddr, but upper layer only allocates dev->addr_len which is ETH_ALEN + sizeof(sa_family_t) in this case. We lack a unified definition for mac address, so just fix the upper layer, this also allows drivers to interpret it to struct sockaddr freely. Reported-by: David Ahern Signed-off-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/rtnetlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1977,7 +1977,8 @@ static int do_setlink(const struct sk_bu struct sockaddr *sa; int len; - len = sizeof(sa_family_t) + dev->addr_len; + len = sizeof(sa_family_t) + max_t(size_t, dev->addr_len, + sizeof(*sa)); sa = kmalloc(len, GFP_KERNEL); if (!sa) { err = -ENOMEM; Patches currently in stable-queue which might be from xiyou.wangcong@gmail.com are queue-4.12/packet-fix-use-after-free-in-prb_retire_rx_blk_timer_expired.patch queue-4.12/rtnetlink-allocate-more-memory-for-dev_set_mac_address.patch queue-4.12/bonding-commit-link-status-change-after-propose.patch