Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3507844ybb; Mon, 23 Mar 2020 02:22:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs9qlUZL3kMFF8Gs62O1Y40AmOvJmtcHj7GVLiqpQrfbtbK5Y+sxPewCCfQJRsPUcoQu9IS X-Received: by 2002:a05:6808:8db:: with SMTP id k27mr4905228oij.175.1584955366439; Mon, 23 Mar 2020 02:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584955366; cv=none; d=google.com; s=arc-20160816; b=WlIZaJoi5g8tWyacWvw97G2g0Dfb+3werlx4TSvL5WaqmPAUA6ETTTQ6qdCWLfwggY B47XNfK7Mn6g0EvaF1uOw8kNluxLOJHjivqka3vJFKzdQYUTzt/gzWvNiYGxJBSE+Ix0 6FIyq+Oc1Y1OM9HT89DPHaYZK0UD/mCDVNtvVfWPiznFbxuxgEl6vnanB/4tMhISGp3W JrC/geK6JN/g4WKlUZfHLNVFQCAmtRfUL+7W8OMBwa8pT58uIMA6yRYdyIOmzQmSaSdN yU6o+s+64SPj1nHojPR5mWTdbPhu5YP+6v1pnP7UlggQSnEJcZoSdIJZFzt4oKrVe4cb TvCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Xc6piCrCbQ+Reo5zJCS3mwuuN7322cUi7GKeYV1tsng=; b=Jb5LflsUK8i1zE9ol47icZCfRGeKzecgmB66+4HN3XHDybL0zYFpuB0AiyP46OsxTj lFPGHzSJ4twpj8QL8bkjuB8IEu7ZdbgFQswmzttvMvvEWBDs8nVGDG+UjkWvnOO5/D0U AjEXAOljppLSBAepLLRKrs9EfnvyLZCsI5gtGUTZ1b02sqBR2hB9EOaEESd6FVOb7vA0 QjKIBjpc3jwDYBqowiX+in7wNGwam54BfMTdOGxxkSgNNE2UfQKpu38ZekKHqlEnMOAj yuqZ0EPfMb315avil//36EypzVh7DgLvGXSmsqCgp7SGc3li0WvCWC+tQebzu+Lm0KGA VwUQ== 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 l17si7728840otn.221.2020.03.23.02.22.33; Mon, 23 Mar 2020 02:22:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727725AbgCWJUr (ORCPT + 99 others); Mon, 23 Mar 2020 05:20:47 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:35163 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727704AbgCWJUr (ORCPT ); Mon, 23 Mar 2020 05:20:47 -0400 Received: from mail-lf1-f47.google.com ([209.85.167.47]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MKsax-1ixnpw25sr-00LEkK for ; Mon, 23 Mar 2020 10:20:45 +0100 Received: by mail-lf1-f47.google.com with SMTP id j15so9609984lfk.6 for ; Mon, 23 Mar 2020 02:20:45 -0700 (PDT) X-Gm-Message-State: ANhLgQ0GpTDuBRNUkabkFbCbr+SjEjrn1KfpVUB+A9nbpR+bj7PO9ZeD Zn/HE9gzd7qx0pUkZtO3Bk4gAy5ibjqRM0ril2s= X-Received: by 2002:ac2:57c5:: with SMTP id k5mr12166961lfo.207.1584955244957; Mon, 23 Mar 2020 02:20:44 -0700 (PDT) MIME-Version: 1.0 References: <1584426607-89366-1-git-send-email-xiyuyang19@fudan.edu.cn> <20200318110204.GB2305113@kroah.com> <20200323045302.GA117440@sherlly> <20200323065506.GA131098@kroah.com> In-Reply-To: <20200323065506.GA131098@kroah.com> From: Arnd Bergmann Date: Mon, 23 Mar 2020 10:20:28 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Re: [PATCH] VMCI: Fix NULL pointer dereference on context ptr To: Greg Kroah-Hartman Cc: Xiyu Yang , Xin Tan , Alexios Zavras , Vishnu DASA , Thomas Gleixner , Allison Randal , Ira Weiny , Mike Marshall , "linux-kernel@vger.kernel.org" , yuanxzhang@fudan.edu.cn, kjlu@umn.edu Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:MAORhoA9uP5z6XPyNpl06IJ/5GMz+T36o3IV2Q4MOXn8uinSYKe C9diJ6ylridRej1w1L3zymbRSXYHJTXqqIuKDWpi6Jcy2MOQQCYyC0MUn0BYSaE6lmqH7Rb Mz/3d6g7ocGVmgZd5QZr0a2urso8J3QDe+5Y1Vm4cNrJIJbKgaZHfVOPJbZYCSKOjqO97l2 QVpveyJyfrCW/3wjtDEVA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:JdF/Fd2FbLs=:nDU4lZS3E0qxBjXjoSUP58 8XxjEprwW4F1KBqN+VhwVixHsNXk+RxieywCpmwEN33Ex77nSWl0QXVVQ1kyPE2dhYvLJOuHB Q23zaWPb7lwIpz9SmeALdxl3x2x48qUSe5x6M72TyHrFlJKNfk30qwpx1IGfu2OxmNguOmD67 Kn+lIyYLiGez91rFJ9Ql+6/xFQ1SvUQjUmPLiHMlckxzrb2k3eFISMosD0yD4TkEiU3kIQhMu v8llHRe81aBXL2SlM2hf9DTCy+JQJ5znaAhu8igF0KkncsnXBfJ2YGkfGMV9BKx6J0vW+/sKc TKBidrZo9FXMT7fAfNQWK6ohlQqRAP+lbIcWca38N0dXJBMIa0Q/MBkql9x2g5ZdcATKmHs29 n7ZjuWSKGwU6iVD3JjQMQ3SAOC0kj5GkChRcTuf4KWS9ohAGxIoIVhv9n7uoA4RpImyNcpnZp 9rd19bOy/oIF4O30+7LvEOk+zbR2apW1a5UPODXH9ucbdIc/njFVLaTGVmmtD2LJg2rkbrFnC OU8+JRSzvU0uF69DJizN04s7QGmOUZDQAQ82tza4pvzIcnWQuRkWmY9iwtNOq9kRZ++imkhGw OsmYLLg0xLj/ecIv82K0M68lkfrV+QdJ7kdsVB/Qic8R5LqSzsj1+sSCXokfLZXt99fFo4nWQ 9WhZtQVFrvc8SG1C3FOaH1JzbVpwlFCs/K0gAmqPGN70KHHKRhlKod0N958eAHDm22owmj3jT /JKruNMQnl7uNvlLttFQWzc2QSSb9JhOjPZ5/I/eh9wyllATCcuFxv2KA1dNH6OX80y2zdECb nQg9u/Zwf14e+ny57Z8+840MuBw3p5P8dI22c8CCePepZeBQVI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 23, 2020 at 7:55 AM Greg Kroah-Hartman wrote: > On Mon, Mar 23, 2020 at 12:53:02PM +0800, Xiyu Yang wrote: > > On Wed, Mar 18, 2020 at 12:02:04PM +0100, Greg Kroah-Hartman wrote: > > > On Tue, Mar 17, 2020 at 02:29:57PM +0800, Xiyu Yang wrote: > > > > > > Same comment as on your other patch. > > > > > > And is this a v2? > > > > Thanks! Yes, this is a v2. > > > > According to our observation, vmci_ctx_rcv_notifications_release() > > currently is only called by vmci_host_do_recv_notifications() which > > guarantees a valid context object can be acquired with this context_id. > > > > However, we argue that a NULL-check here is still necessary because > > this function may be called by other functions in the future who may > > fail/forget to provide such guarantee. > > No, that's not how we write code in the kernel, if it does not need to > be checked for because this can not happen, then do not check for it. > > Don't try to plan for random users of your code in the future when you > control those users directly :) Just saw this reply after replying to the other mail. I guess I picked a bad example ;-) If there was in fact a report about a NULL pointer at put() time somewhere, that would be the first thing to fix, and it may still make sense to review the other code paths to see if there are additional cases that can go wrong. Arnd