Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2051362pxu; Tue, 24 Nov 2020 15:56:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJz772WPnG6N+0yTu0wfxqYJLg9GWwArfNuMD0XhhRJM/uD3bC/zw6QZIWR4L1Ujb632LndE X-Received: by 2002:a17:906:d8ab:: with SMTP id qc11mr828335ejb.64.1606262198805; Tue, 24 Nov 2020 15:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606262198; cv=none; d=google.com; s=arc-20160816; b=ccrOWDk5WPEE/lfl2GX6XaVU/xHYMXIHS+vzNMEqIL3In9RipkOGPa+Lvb0y0BxKE5 Am165hFefirpSvTAqfh2nzwl7bsFY+X9pkn6rpnH0fAyzTvvn1ltQ9oQSEtAaygxTDpe GFGrZPtJyYq9OlttVCk52r8+Pk78uZOfTtKy/jn6mLexuxLTSEaPTuzTwh2GWpOK9lq1 ELX0m2B3s8I7oUvORoklNcUG6tb5DC31HZcQF1sxe7pgULQGvN0YWRrwXR3dBM70H0/6 N0pspLYqkhEcmMCEkNZ+Ofn6ihLaCBkjz+XAMRdbIdTNW9yrE2MBfzbiL/UEdDsVQsTZ QrZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YUqJtEzZnkyjVYlbVQeD/8IDUWyftG823MVWyY04nkY=; b=qe4WdNzdSl3XHc1ciV7Pg1KJ9riwoymAmPCRY1AGKmUvz/7bwHiH2KarOYO6Knx5ib CurYfDasxCvW43+nuf7f3XQ//K/I1MTgH07z9D5JahpEbfHgw9+ZJSPx1SbYc5pcbEXr wh0fyU3JFBTJ/SnffaKt5U97IjGU1T4kWJ/O5vYBPK66ugY8HUTize9guEY5lFLD800x 0d3nfHThgvNBYsYxa0AvAgdzJOQ7cDMnwYfKXZsVIkhIHTW5KeJUXKNxf0/3YtlMPn9a F4DZeaYXZd8gl+laE95QR8KTq9b0oXCoqwobbMO91zofht3m6dH6kT1YZSShBEITW6F3 xF4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="exJ9xfL/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si187748edv.216.2020.11.24.15.56.16; Tue, 24 Nov 2020 15:56:38 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="exJ9xfL/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728947AbgKXTyT (ORCPT + 99 others); Tue, 24 Nov 2020 14:54:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbgKXTyR (ORCPT ); Tue, 24 Nov 2020 14:54:17 -0500 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6736DC0613D6; Tue, 24 Nov 2020 11:54:17 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id d18so61395edt.7; Tue, 24 Nov 2020 11:54:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YUqJtEzZnkyjVYlbVQeD/8IDUWyftG823MVWyY04nkY=; b=exJ9xfL/8TdXx4LAThv/BeOWEoUifAPCb2zqd1Lg+hQT+KFBHoTZJIhl5Mp+ZI8sby Ddqn63Xh1m2UkHVQVqSQqpSORGnq2dkVa1BGIWwUG2etfo01hcgwzifO/pu49y/mTDFk R8+nlOFqU/3J/waf4M4VtFg/lw9w7RSTyxBpyaAkErF4u9OrpVfgeSMiGdHtcJcGzaa8 y9ZO+lgRR2GVDzjQeah61y5QHqZUKbxU61F0+qCsWQkO9AYqPmRbd2PZ/O8jQ/4fsjX0 +etkumg3aiuXZZvsKgU9+E1bH+mIDBx4CD2zZUfNyrxO36IUWYgqcUtd6FUZe0BRfcYn 6Ihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YUqJtEzZnkyjVYlbVQeD/8IDUWyftG823MVWyY04nkY=; b=gvuS7rQPk8UO7aOJcgclqRnr3hMGp7Ly29owNwrzKkd11qtJVmxqjBqoxtfpZZVtj+ hw/7vNJ2J2gjhUjNPHiLIUY+6n2G2jibtYsyorgTWszXqQwOZZSpt8Lt1MRuu0IiUNYs hA9AqKxXjYTYkbbtVTiGWo0k5c5mpCaNNFfxrDII6Dg/EyUsmOuLCxHU072nZhUv3rNx AAXNnScpL0/IfweBDn78lKmux5h13Fkxvf4sWlPrmbSONdEOsVuXQYyF5yLf2UHIN9DQ yWyG7h23yzVoAPai03F8sIfmdWNWVCqne9D1Of0Pw1W2yTe+xbFBAm84dGHjLk6s/UM/ GUAQ== X-Gm-Message-State: AOAM531rdR464yudZ5i17hEuUI/Hx6dmf94VnAtQvCOC4KvAFVgzpK9/ 4tSdFrVC8BQynPq8oy5eD5E= X-Received: by 2002:a05:6402:cbb:: with SMTP id cn27mr93733edb.275.1606247655959; Tue, 24 Nov 2020 11:54:15 -0800 (PST) Received: from andrea (host-82-51-6-75.retail.telecomitalia.it. [82.51.6.75]) by smtp.gmail.com with ESMTPSA id f19sm7527614edm.70.2020.11.24.11.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 11:54:13 -0800 (PST) Date: Tue, 24 Nov 2020 20:54:07 +0100 From: Andrea Parri To: Wei Liu Cc: linux-kernel@vger.kernel.org, "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , linux-hyperv@vger.kernel.org, Michael Kelley , Juan Vazquez , Saruhan Karademir Subject: Re: [PATCH 4/6] Drivers: hv: vmbus: Avoid use-after-free in vmbus_onoffer_rescind() Message-ID: <20201124195407.GA16042@andrea> References: <20201118143649.108465-1-parri.andrea@gmail.com> <20201118143649.108465-5-parri.andrea@gmail.com> <20201124162633.n7zlpte6f7zfhn6z@liuwe-devbox-debian-v2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201124162633.n7zlpte6f7zfhn6z@liuwe-devbox-debian-v2> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 04:26:33PM +0000, Wei Liu wrote: > On Wed, Nov 18, 2020 at 03:36:47PM +0100, Andrea Parri (Microsoft) wrote: > > When channel->device_obj is non-NULL, vmbus_onoffer_rescind() could > > invoke put_device(), that will eventually release the device and free > > the channel object (cf. vmbus_device_release()). However, a pointer > > to the object is dereferenced again later to load the primary_channel. > > The use-after-free can be avoided by noticing that this load/check is > > redundant if device_obk is non-NULL: primary_channel must be NULL if > > device_obk -> device_obj Fixed. > > > device_obj is non-NULL, cf. vmbus_add_channel_work(). > > > > Missing a Fixes tag? Yes, I've added the tag. Thanks, Andrea