From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630AbdF1L0N (ORCPT ); Wed, 28 Jun 2017 07:26:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:45238 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751524AbdF1L0H (ORCPT ); Wed, 28 Jun 2017 07:26:07 -0400 Date: Wed, 28 Jun 2017 13:26:04 +0200 From: Michal Hocko To: Andi Kleen Cc: "Jason A. Donenfeld" , Greg Kroah-Hartman , Kees Cook , Ingo Molnar , Peter Zijlstra , Thomas Hellstrom , Daniel Micay , LKML Subject: Re: [PATCH] kref: Avoid null pointer dereference after WARN Message-ID: <20170628112604.GA5234@dhcp22.suse.cz> References: <20170627035215.GA132342@beast> <20170627070626.GH29909@kroah.com> <20170627110013.GA3026@zx2c4.com> <20170627144918.GG23705@tassilo.jf.intel.com> <20170627192939.GJ23705@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170627192939.GJ23705@tassilo.jf.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 27-06-17 12:29:39, Andi Kleen wrote: > On Tue, Jun 27, 2017 at 09:11:28PM +0200, Jason A. Donenfeld wrote: [...] > > The bigger question, though, is the value of these checks in the first > > place. Has anybody written a coccinelle check to look into this > > statically? Has it historically been a useful thing for driver > > developers to have? Is it good defense in depth or is it overkill? At > > the very least, the original authors of kref thought a WARN_ON was > > warranted, which means probably a BUG_ON is a sensible fix, until > > somebody does the work of investigating these more careful questions. > > Right that's the question that should have been answered before > this patch. > > I don't think it was ever intended to be a defense, just as a hint > for driver developers. > > My suspicion is that they're mostly useless. Completely agreed here! -- Michal Hocko SUSE Labs