Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp953140ybe; Thu, 19 Sep 2019 06:31:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzQuDmNQkxvA0cRMKjAAUnL8gFhpPtbdgpWhyCUkgOwa6YMLmjqhc1o7yG/9x+5w7/tMOG X-Received: by 2002:a17:906:6084:: with SMTP id t4mr13871446ejj.164.1568899899053; Thu, 19 Sep 2019 06:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568899899; cv=none; d=google.com; s=arc-20160816; b=MTRNoRzcpoATgor8d6YYeBE62IldDaxBpbUeBweoH4xeadGz8ummA6QIvz+V0M2SNl /jD5lxAmtKtuGP51rgRcuxr+J14HYjFVNuciA1yUmw0aX9VhOAQrh0olVUnZV6tIqwHv pJB+WDoHqwBAm0/P3MDPvjlkRnzZZcGPNcaM8bXg5XWtZGPiDh1m4SleO6I2/5oE+Mmv 6jteFPxHWm+taEJr+My+PAwaGkUKyxfvT8pSZDnaKfkDQKvb4Nmo0um1cUQqY+rVQ+UE 4a4YisMxkfy0aO933gjNleCLndlhCLS2fDr0yjzDzXP4Jg/kMqcwttajTU83myQ708pL Zo7Q== 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 :message-id:date:subject:cc:to:from; bh=AAGhvqwd75jlWoyN7RtLuLmQlBabVo3K+eJUc/Gzlw8=; b=zuN25b8A4iulvbFkZDCbdROZwq2Q5LR+bvzFLp7cgYucM7Tl/yfY6TgrKyVLK9x7fR 7n2gr2hYO0EzAG+S2bUNOo9RDBuH1gd5o1MkjoKZxOO8pkq5xMdAZstQChi/KuYu7k2w QktIM9SPNOChAuOsdFnCGmfVVAbQg3KfpZPeUHPO1CLa4BuVC9I9IL2zYn4t2ILgB3wo z2yr2B90YOrHnDzZOSQwMysuDZBokQXT+k0QXMLajxQcEZy1tVuJY/tgHFLkM3g06ueG yFSzEVvp8BPPTnmvZgjec63xYVVZUic3+3ZKLB5ReGdmQZWyoAxtlTWnhitlM3I5pE0O UFxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si4389922eja.30.2019.09.19.06.31.15; Thu, 19 Sep 2019 06:31:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390196AbfISMNA (ORCPT + 99 others); Thu, 19 Sep 2019 08:13:00 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:44585 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388792AbfISMNA (ORCPT ); Thu, 19 Sep 2019 08:13:00 -0400 Received: by mail-lf1-f65.google.com with SMTP id q11so2160228lfc.11; Thu, 19 Sep 2019 05:12:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AAGhvqwd75jlWoyN7RtLuLmQlBabVo3K+eJUc/Gzlw8=; b=I+fWSqLXskt+W9JCVUaVDdgxCjnHs9SngDhZ6ddtTpEHqRqALggs0Pzu9DGLeyUmlU s5SntY7fIS15FYNNcS7Bgu8ZuXvdbUE1C0isqFYgjIdHMvI52zPc5si6SWtWbUHvPKI0 b0EXSvCx5+4/5aIMXUlky8wKD8nv3geoGMhf7Rn80LlcWTxVb8k/MBvu4ogIrQmTa1Bu RXvZRgQqaMzIlwFvA+fueRmaT3PU3dgwXup/5ot7kwAgPgVQ4xDRgMJw8sWgHsPrEdkd 80Wbqpnjqske0K4nPjpA1l5wJdekIJV9rSXiSAbbXl6hJjXX+k/ZuhilCnnflRgBv2Tp dhCw== X-Gm-Message-State: APjAAAUmCei2Y1na09s+VmqxpF5e9VLOhhYNyCng+upbeCL3Q/4uaBPK qTO3LCZFmWVgzivdkTgT4Lzgac3/ X-Received: by 2002:a05:6512:251:: with SMTP id b17mr5172700lfo.35.1568895177514; Thu, 19 Sep 2019 05:12:57 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id x76sm1859097ljb.81.2019.09.19.05.12.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Sep 2019 05:12:56 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iAvIu-0007yb-AS; Thu, 19 Sep 2019 14:12:57 +0200 From: Johan Hovold To: Stefan Schmidt Cc: Alexander Aring , "David S. Miller" , linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, andreyknvl@google.com, syzkaller-bugs@googlegroups.com, Johan Hovold , stable , syzbot+f4509a9138a1472e7e80@syzkaller.appspotmail.com Subject: [PATCH] ieee802154: atusb: fix use-after-free at disconnect Date: Thu, 19 Sep 2019 14:12:34 +0200 Message-Id: <20190919121234.30620-1-johan@kernel.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The disconnect callback was accessing the hardware-descriptor private data after having having freed it. Fixes: 7490b008d123 ("ieee802154: add support for atusb transceiver") Cc: stable # 4.2 Cc: Alexander Aring Reported-by: syzbot+f4509a9138a1472e7e80@syzkaller.appspotmail.com Signed-off-by: Johan Hovold --- #syz test: https://github.com/google/kasan.git f0df5c1b drivers/net/ieee802154/atusb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c index ceddb424f887..0dd0ba915ab9 100644 --- a/drivers/net/ieee802154/atusb.c +++ b/drivers/net/ieee802154/atusb.c @@ -1137,10 +1137,11 @@ static void atusb_disconnect(struct usb_interface *interface) ieee802154_unregister_hw(atusb->hw); + usb_put_dev(atusb->usb_dev); + ieee802154_free_hw(atusb->hw); usb_set_intfdata(interface, NULL); - usb_put_dev(atusb->usb_dev); pr_debug("%s done\n", __func__); } -- 2.23.0