Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4876785pjb; Mon, 27 Jul 2020 07:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgzkaLDvedjv9J4oXNVp8GvX4rl0ILu+fI/CqrKO8ubpY/W11up1BVU4DU5Cp5BwwDUlm+ X-Received: by 2002:a17:906:f752:: with SMTP id jp18mr20879393ejb.538.1595859829270; Mon, 27 Jul 2020 07:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859829; cv=none; d=google.com; s=arc-20160816; b=XTVtUVb8cJRMQ3wat4/A9PnDrp8xmgEpEpvLswcbhuhQ4U1izyp4yZLgAylLwnhNV4 6goBTbS7c2DvWbKRU6JtxFDYKJz4fTgFEk3x48TcgxdW3rgZrpU/3FbDgOxsnWTT7mh5 F64G4EfAldvzgPcgmbwH9+dNkZcDs7Jq9lUNvYfk8AE7ZC02iZLAc9T74QQpsU/BV+Zb pZJhS3KCtMl+xzVTQW2s7hXwChZeKGVvB59F211JheghhgGpNzbMzmHQ4weGtt6Mhf6x c5SharHUBlu5XtKaC5eoa2cnBz3YpWbIY6LRYe3PzCDuVuCNs6nRjMzp5fvGzCzfI+8l I/xg== 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=YK+1ocxT1vGMIBhgmpNcswWcQUGL22Ctr2fVZh/bYts=; b=aYXa3P4ulfxGHDO71mJ2ImosD/ugQ14LdQcQRYllaeiDbKLSwSbWOsu6EJR2dE8wge XhT7lfqNdzTEq0xHUTZO7z4q4g0vXOmn40od170F7Nq86OOX1YpjUHwLKDxkCQjGC7YO fx6w2wvUrKtFQ0ZW0oD87OblwtagimZIT1diJNWpSnSd1tgWwOAqsJL2FuuqiPwcVeQA 1w8OxuMAmBbKIdSurE9du8YwIXHyHCmo3/uoIi6Cw7+0jmqim6Me12WvVy22qIPcHeNO e6hylhnVqCHk1Tiz3HTLJN/fXKGbk1wBQjTQPzxUtRn5UfnAhBbtmmCvKq7NYrgbuoP2 FxSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Toa3N6hg; 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 f13si5929104edy.576.2020.07.27.07.23.26; Mon, 27 Jul 2020 07:23:49 -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=Toa3N6hg; 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 S1731282AbgG0OWE (ORCPT + 99 others); Mon, 27 Jul 2020 10:22:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:50842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731825AbgG0OWC (ORCPT ); Mon, 27 Jul 2020 10:22: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 82D1F2070B; Mon, 27 Jul 2020 14:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859722; bh=mosuk51w2WKwugCfuBZtqjV/aSmnJy/uMF70i0hQ1Y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Toa3N6hgyARDwKiOvTe49dzkbuW+n7koDcC0gmlZSYabJ/+FvX4ANnALQ3lLyyjzn Y4jicqToG8GyO7eXJaelsrXymy+ccPZOmpS6y/ABcnAYpLicC27In+82tNxWBpZ85J 6AmpxZPUdJXaN+pP2KeCz1QB491S/Zjo+eV964y0= 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 5.7 052/179] ax88172a: fix ax88172a_unbind() failures Date: Mon, 27 Jul 2020 16:03:47 +0200 Message-Id: <20200727134935.202883308@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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 4e514f5d7c6c7..fd3a04d98dc14 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c @@ -187,6 +187,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