Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3141812ybc; Thu, 21 Nov 2019 04:03:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyLOUTK0p7I2oiHhs3PgLoi6fzX8EQSJtH2JsnynCS7bdyL8MX3NTbEggyFuTeoP+QnOaCz X-Received: by 2002:a17:906:3418:: with SMTP id c24mr13407335ejb.121.1574337812391; Thu, 21 Nov 2019 04:03:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574337812; cv=none; d=google.com; s=arc-20160816; b=0Of0oCTdjk8YhwXoWLueOEQ2aT7QS1bEhG50+2LjlWhX0KqQm3rNrwLYVRVBzorWMa HMVtcuqYDBWYpGdNDPVnt0wvTetLI2HE38dE0b4JK1p8KSf1WpS9/rO9nN5lHe9toi2g 3iyoHDYNuwJjyGz2ge1EpYIFJ53wTl6Xrjwx9MgOS7TyJ8JI1qR/tJGcaiAyw7CjhCIe QMl5CF7TmDFng1fPIhYWVkDhN4N/pJpUjiOt9PQ6I/BG4MhWu07F94u6IO+UW8ODx0Qy s3A0x3EOAtYg2LS9vppVPbG+Ykk9zBVbh+Hhx9m75M4bLvffmOznd/Yf8qG7Xl3KOoch Fonw== 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 :references:in-reply-to:date:to:from:subject:message-id; bh=yqE5LGekw6KBP0imTIneLUiP52zb+Hm+mdCFjHNmBi0=; b=W8T/1W9BfbYt+8uSsn7mlhy0/KxGiqQ+xkbqFNH45VLlFwM288HiGBzh/AnX9Yxg9U YH1ks3t5NsITZ7+5a2ohjp3YD28Cz/4VNwUw1AtxCwXr9bkOrr0erv/MYqflGqGcRU1c 28CTy9R8CYTB7WUiweSu4DQIZFSnU2APPaNAsisVzNM4k4CQnJ2c7fLGm6N5Gi9ADDs/ q9aHh9hLF0zeo43jXg5hOXVBFi9mEPmxJWqvbm2urIYRE/Tj/xJO5iVUPiNknGW4fTpS 5zujX3Q8p8PC+F/2xAPa3H6MkT5HpdF9hoHBc6gvIkPikxTWYopcFtAbN0nbPFBSlkUX 7GdQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m20si1643576ejx.33.2019.11.21.04.03.06; Thu, 21 Nov 2019 04:03:32 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727212AbfKUMBB (ORCPT + 99 others); Thu, 21 Nov 2019 07:01:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:50912 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726197AbfKUMBB (ORCPT ); Thu, 21 Nov 2019 07:01:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 62611AEE0; Thu, 21 Nov 2019 12:00:59 +0000 (UTC) Message-ID: <1574337654.29504.0.camel@suse.com> Subject: Re: KASAN: use-after-free Read in si470x_int_in_callback (2) From: Oliver Neukum To: syzbot , andreyknvl@google.com, hverkuil@xs4all.nl, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-usb@vger.kernel.org, mchehab@kernel.org, syzkaller-bugs@googlegroups.com Date: Thu, 21 Nov 2019 13:00:54 +0100 In-Reply-To: <000000000000f47f0b0595307ddc@google.com> References: <000000000000f47f0b0595307ddc@google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Freitag, den 18.10.2019, 07:53 -0700 schrieb syzbot: > Hello, > > syzbot found the following crash on: > > HEAD commit: 22be26f7 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=102b65cf600000 > kernel config: https://syzkaller.appspot.com/x/.config?x=387eccb7ac68ec5 > dashboard link: https://syzkaller.appspot.com/bug?extid=9ca7a12fd736d93e0232 > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=143b9060e00000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d3b94b600000 > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+9ca7a12fd736d93e0232@syzkaller.appspotmail.com #syz test: https://github.com/google/kasan.git 22be26f7 From 40218a235aed2aab9fe948c036582905fdbf4e50 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 18 Nov 2019 14:41:51 +0100 Subject: [PATCH] si470x: prevent resubmission Starting IO to a device is not necessarily a NOP in every error case. So we need to terminate all IO in every case of probe failure with absolute certainty. Signed-off-by: Oliver Neukum --- drivers/media/radio/si470x/radio-si470x-usb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index fedff68d8c49..e280b1149fa1 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -542,6 +542,8 @@ static int si470x_start_usb(struct si470x_device *radio) radio->int_in_running = 0; } radio->status_rssi_auto_update = radio->int_in_running; + if (retval < 0) + return retval; /* start radio */ retval = si470x_start(radio); @@ -734,7 +736,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, /* start radio */ retval = si470x_start_usb(radio); if (retval < 0) - goto err_buf; + /* the urb may be running even after an error */ + goto err_all; /* set initial frequency */ si470x_set_freq(radio, 87.5 * FREQ_MUL); /* available in all regions */ @@ -749,7 +752,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, return 0; err_all: - usb_kill_urb(radio->int_in_urb); + usb_poison_urb(radio->int_in_urb); err_buf: kfree(radio->buffer); err_ctrl: -- 2.16.4