Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4889248pjb; Mon, 27 Jul 2020 07:40:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9k36Y8+9hdo98m74sspeQcYc2fwhNKIBx6tTUsyncRy2B1TZq323iilJipso60rMs2qYb X-Received: by 2002:a50:e046:: with SMTP id g6mr7161730edl.210.1595860838255; Mon, 27 Jul 2020 07:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860838; cv=none; d=google.com; s=arc-20160816; b=M4VnJZtX3d/NXAp1QfNJsq5obQ08NUN2kMyeVOUfGMPswQoRoX1RK+K51S9Nn7n3JY pUxaAGFYjAqAZ+DTb9sELL3C8C3z38EK/mUL/aD4hXv4zT+kNj+C2fh7XP4NnvBWiwMV FFc50HKzqkNd+MPMgZIDDwQPC3ZD/TDZ9uKrHiqq8mI9s9tX70YL8+I0QuFJVKBkzFWN k2kzC6yU5yFEBqEW10p+qcueceAklVE34+QjSLSt7qzeW5w7RREQ3TQEZYV14FXI/P+E 1uLr6NBIlKE9lTJaXpuCm0RpFzpk4soyaIUy9HxxvUv4pClX6Kgz8faWyl5N2zEs7rvo MSbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TlVrkjWdJR5wq5u+UW/DQLl6zz65FQ4xfkniwkm3wAA=; b=rl5nImMdIu1FxjnjJdRK6hpQ7wXM+UF5hCqxMu0J5QGbp5kM5VsZrf4kdqK8vE6zS4 8UqiMjTBfZ5+PYHLZdD2dHLpZiX1CsXsP7HAOXyjduGL7DNY/rWZrg9Z6v/2NgqBxy8h h9sAk6jmMf2/uL8h3NKaPChppD7NYDh1o/0QOkSKMApcVYJEAiP5adY3gNR99ZdlSJrH wmEAIEqnj0FVoFtdQQxQJNJC5II+du7rjo1G1T7+7aA8RcwrnoclSni7eGrCmL33XaBr TQxF1Rj8777IDl6prc3FtKx4fuHkzfIlv4NOiKNmU1tMYTFAq5ILjVtiZlfOLL6OmVo4 V5DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GElU7A8j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si5423977ejd.356.2020.07.27.07.40.16; Mon, 27 Jul 2020 07:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GElU7A8j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729215AbgG0OKE (ORCPT + 99 others); Mon, 27 Jul 2020 10:10:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:60766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729743AbgG0OKC (ORCPT ); Mon, 27 Jul 2020 10:10:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1D1B208E4; Mon, 27 Jul 2020 14:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859002; bh=ZlkBZRpRZouPucAK8to0nNZMYP7bbrHIinNn677J9D8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GElU7A8jvnaSkrLhQNpH1Rx82P7b4P/QXMJjtW0iifg5oVhRg5+R4MqK9TPWnpsFD 2ie4IUyi2Pq9H3dxHCQOGzFNhRYOpS1g7QNhb3mTMnLbANIG+7XgaItmtK+WekoF3g +w779XaquDcuUIusw7d+TWWs22Ym7LsoBD0opYsU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, George Kennedy , syzbot+4cd84f527bf4a10fc9c1@syzkaller.appspotmail.com, Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 28/86] ax88172a: fix ax88172a_unbind() failures Date: Mon, 27 Jul 2020 16:04:02 +0200 Message-Id: <20200727134915.862491789@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134914.312934924@linuxfoundation.org> References: <20200727134914.312934924@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: George Kennedy [ Upstream commit c28d9a285668c799eeae2f7f93e929a6028a4d6d ] If ax88172a_unbind() fails, make sure that the return code is less than zero so that cleanup is done properly and avoid UAF. Fixes: a9a51bd727d1 ("ax88172a: fix information leak on short answers") Signed-off-by: George Kennedy Reported-by: syzbot+4cd84f527bf4a10fc9c1@syzkaller.appspotmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/usb/ax88172a.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c index 914cac55a7ae7..909755ef71ac3 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c @@ -210,6 +210,7 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0); if (ret < ETH_ALEN) { netdev_err(dev->net, "Failed to read MAC address: %d\n", ret); + ret = -EIO; goto free; } memcpy(dev->net->dev_addr, buf, ETH_ALEN); -- 2.25.1