Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1241187imu; Thu, 20 Dec 2018 12:40:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/UhdzCmtlvKBHZqiz+TAQ4rD119leTF2wc4BbjMtBA1zZoHocgQe8r7dCJIQtvl5U2dUlA3 X-Received: by 2002:a17:902:bd92:: with SMTP id q18mr25687810pls.167.1545338413789; Thu, 20 Dec 2018 12:40:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545338413; cv=none; d=google.com; s=arc-20160816; b=moGszLcRq6O06h9Nr+t8SndZCCLgzYfldEO4XMezI/2rC3v2Nu9ud2f+wDtrSSByPm XBe/CQM1J7nXmdL0vJLaAzWs6P5rKEkeZvu8A6jmN5kinC6lwWm67wq88oa0Bs/MYJ63 zSylfRaMqecTF5UckmvnxTPn19bX2XDi2WDvlm+llmQ9tm99wx9Qv0fhhcw0VkTGDkGI RSY5uwxotDnUsfAYcZmRnOU9NH7Bw4Q70mHBEYuenyYxnZiL76TXS5Vsy59pekOzYD+K lODB5y4/dC5WgDnImd16JmlXzeR6QrTwFES2pEvmEi129wqfAdEQKo62x16P/J8eKw6V v8mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fzjEFGg0X42D8Ypua1GYnw5I4LyM9JSBHvzpTSssFqg=; b=z8cnX4RjhTI/MIfPDR/bBrW9BKAfCymzqWLbu3OjWr0fUwewjWuhqWaPYihqMGcfvB JPmcOmpkvN5h73R/8XYsm8L5NWrwD7m904FSlupUsn7GzEQdcPGe3sBLwGgj5ZNi+OJ2 TgdXXfXSaFSgwb93rrZhEYwXCA+wgg55jZ+bz1ioG/Lgisedg6FVZQ8XbnOe2btFgheN TQ4v9GtXrGec3XbiUU3rvDvjSzctP9pjyYo3k9BeaHPQP92JIjiuY46BLMRqfWeS/qCd I0GELfZnlHfFQWAyqlclIKaUAQKXRhVG/juoanvmf5ztn/ldVQs3B57/KeJlMvKN8JMe RODg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AfFt1ydR; 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 f22si19334966pgm.81.2018.12.20.12.39.56; Thu, 20 Dec 2018 12:40:13 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=AfFt1ydR; 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 S1733168AbeLTNqI (ORCPT + 99 others); Thu, 20 Dec 2018 08:46:08 -0500 Received: from mail-lj1-f175.google.com ([209.85.208.175]:37320 "EHLO mail-lj1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731126AbeLTNqI (ORCPT ); Thu, 20 Dec 2018 08:46:08 -0500 Received: by mail-lj1-f175.google.com with SMTP id t18-v6so1620490ljd.4; Thu, 20 Dec 2018 05:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fzjEFGg0X42D8Ypua1GYnw5I4LyM9JSBHvzpTSssFqg=; b=AfFt1ydRgzY3/1aT3fHgz3Q9Qbp2ACXQr4GaYj4T1jBEPhu7JgdhXbMh/dPMNxz8bt 3AkmiCY2vcVWsEcnHq2BcT2b/bFnYRZpdeewLVEKJNMFp8TrWxARUfbxrX4/sQEdwKaG SgtcoZl9AWAjb5xmkOAYAkfBj/Ncn6vh1/ptMpLInVTKYbB+9WCdFcovbnhe18+t12BC +WjZAcRWPybFHW4yc3IwGt061wAgICWPmF26ePWzf0P1xWyJ7eVBdVitEHjsdkIeI2ze CbIgZ6c6NW/a48K0+2JMjqk+4AGI+c69Umgl7FOr5vTGg0FdMFSOdCP30Wdzj0BjKHY/ CHmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=fzjEFGg0X42D8Ypua1GYnw5I4LyM9JSBHvzpTSssFqg=; b=WuoZ/JeUy8aNR8gfD5UeL4czzFHVc8/Db6wdAx3a31/q4kq0SU2icd7Nz0oL32QbPt wyhyXlCpfThfdjKhLolBdWP/FJRurNccEsbSsiqXxyV+2W2RABvNOkw3OzEhjF8xV2Pw EGo3QFhbqAoBfFxag4paaQpAODnTyuoA6rtkA2bAJUBqyw0Ewal4j7uOMc3zljeDh56v v4znplnWazofmR3MisJVwqxRLmq4MLQB+kWkv9/UODo9wlvHckxbKG0UdaHXjyYCITUZ aLVQfQu6LohD3gwuLuyWwRUIDic4GQbv/raeLCTQFeM7wKNbqmei3ci5KbuKQswU0e4Z IzWA== X-Gm-Message-State: AA+aEWafnv7ERNS0NeLCSGWRJXNrVDdVH11e8TXnuFhYBbliuInjZf5X Ihl4tL18kKcQepCtBEhTS+I= X-Received: by 2002:a2e:9bc3:: with SMTP id w3-v6mr14985827ljj.70.1545313565888; Thu, 20 Dec 2018 05:46:05 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id x16sm4213598lff.26.2018.12.20.05.46.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 05:46:05 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gZyeP-0007EU-Kr; Thu, 20 Dec 2018 14:46:09 +0100 Date: Thu, 20 Dec 2018 14:46:09 +0100 From: Johan Hovold To: Jia-Ju Bai Cc: Johan Hovold , Greg KH , linux-usb@vger.kernel.org, Linux Kernel Mailing List Subject: Re: [BUG] usb: serial: garmin_gps: A possible concurrency use-after-free bug Message-ID: <20181220134609.GA27701@localhost> References: <8b24e2fc-df9a-8e06-aa49-a27675fd36e9@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b24e2fc-df9a-8e06-aa49-a27675fd36e9@gmail.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 09:41:16PM +0800, Jia-Ju Bai wrote: > In drivers/usb/serial/garmin_gps.c, > the functions garmin_read_bulk_callback() and garmin_write_bulk_callback() > may be concurrently executed. > > In garmin_write_bulk_callback() on line 969: > kfree(urb->transfer_buffer); > In garmin_read_bulk_callback() on line 1165: > unsigned char *data = urb->transfer_buffer; > Thus, a concurrency use-after-free bug may occur. No, they operate on different struct urb. > This possible bug is found by a static analysis tool written by myself. Seems you need to update your tool. Please also make sure to review its output before reporting anything. Thanks, Johan