Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2986954pxk; Sun, 6 Sep 2020 22:50:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS2VqVmyL7on3AWwYIGn1ImwoE/P6mMolbgeNaDsi69AToWkiqNAgdbbHSQiH5Tym0muXV X-Received: by 2002:a50:ee15:: with SMTP id g21mr20295306eds.47.1599457835535; Sun, 06 Sep 2020 22:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599457835; cv=none; d=google.com; s=arc-20160816; b=wafuTB7NmcaDslg/OaOY8lO91ZB6x5LonOwQWIELEkFUi3C+IAO8PyhtwkLM6JOj30 EewBvTmPnfIrxfHdpRk+VeqLbo1qMN+xQmUXa2ilIL9FBbmaHa4W9AmaUD5GtIoWLi/m rlNFvXty4kbIcO/AiAA/dvBb46JMmpcjQ06e8/IVVrPwYVLshKQGLTXERGjYH3sQKHdA BaRNEtbGrPoBb9MQk+zEjKYhvHhIDtCApgzV9hHj9ef5RNPgRTCN0hGL50hhA2iz9Xdt x4JHEwDZjMiPW2WIJu/FZCny33Vmg7jWz5nZXBrsigmalRwxL6go7aozDwM3mIi26kQj HfHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=a5/cEIfWcSChJxUlNOZzqt8Opy8n1npVY2hwYGW1gGU=; b=Id+5Rw134nF0NX8ZxqQfgkSeEUzfRO52XiR7YLrgKv0Jf4HpUHpzub2MkouOj4CgfF MO58YxsX6SF8iucwwiJG9X1PWBmOWdJzOXo4CFwUcX5JMzIb0ZIVZaRd8M6YBGCupCQ1 EVdxyh0OTnTsH+JljvaQ24CoCa3CkkTRKO+VzjjrNEXlaK26zCinNW2X/5rGC+cEhp0M ff8d+RB3RjvR6QhFY3I9qJSXWUrJxU+z5H1gsGaQp6rnITz2/N02fAncoCNPPmKRigto FQZXmrvmOy0HekltM1aejaZJcWKNz8+sddR8tDglYNmRF22Blo8DVN+EOpg5qai+VxRt jarg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rENsCMts; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la18si9125768ejb.526.2020.09.06.22.50.13; Sun, 06 Sep 2020 22:50:35 -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=rENsCMts; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726992AbgIGFrf (ORCPT + 99 others); Mon, 7 Sep 2020 01:47:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:43598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbgIGFrc (ORCPT ); Mon, 7 Sep 2020 01:47:32 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 03DB820732; Mon, 7 Sep 2020 05:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599457652; bh=a5/cEIfWcSChJxUlNOZzqt8Opy8n1npVY2hwYGW1gGU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rENsCMts3CvNXOxvQBkjMQXGS5wtwS44RE0bhwLam9rSZ+OsWVcRPdF7G58SeUhV0 2ntcJk2vA/cIz9Y/3pBEQuJ9NN8v/Bir93iVS+w24XHg66aLFcm0+LB63plNIdEhtB MEf0R+O/LZnf08NcwP6Im3nD7uQk4E2g5ZC32cJ8= Date: Mon, 7 Sep 2020 07:47:29 +0200 From: Greg Kroah-Hartman To: Anant Thazhemadam Cc: linux-kernel-mentees@lists.linuxfoundation.org, syzbot+b8639c8dcb5ec4483d4f@syzkaller.appspotmail.com, Saravana Kannan , "Rafael J. Wysocki" , Jean-Philippe Brucker , Dan Williams , Joerg Roedel , Bartosz Golaszewski , linux-kernel@vger.kernel.org Subject: Re: [Linux-kernel-mentees] [PATCH] block : Fix use-after-free Read in delete_partition Message-ID: <20200907054729.GA280798@kroah.com> References: <20200906201158.14014-1-anant.thazhemadam@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200906201158.14014-1-anant.thazhemadam@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 07, 2020 at 01:41:56AM +0530, Anant Thazhemadam wrote: > A use-after-free read of the kobject member being casted out to the > device structure containing it seems to be potentially possible > due to unsafe casting using container_of (since an edge case such > as when the ptr being casted might be NULL or problematic is not > accounted for). > Using container_of_safe resolves this issue, with no obvious tradeoffs > and without considerable expense. No, now every caller has to check for NULL, and that would mean that you now need to fix up hundreds of different places in the kernel. Please fix the root cause that would cause NULL to be passed to this call in the block code, don't paper over the issue here. thanks, greg k-h