From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751811AbcDFQNr (ORCPT ); Wed, 6 Apr 2016 12:13:47 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:43558 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbcDFQNq (ORCPT ); Wed, 6 Apr 2016 12:13:46 -0400 Date: Wed, 6 Apr 2016 17:13:38 +0100 From: Al Viro To: Sudip Mukherjee Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] proc: fix dereference of ERR_PTR Message-ID: <20160406161338.GA25498@ZenIV.linux.org.uk> References: <1459937265-4364-1-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1459937265-4364-1-git-send-email-sudipm.mukherjee@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 06, 2016 at 11:07:45AM +0100, Sudip Mukherjee wrote: > On the unlikely event of a bad name, d_hash_and_lookup() can return the > error value in ERR_PTR(). And we were only checking the return value of > d_hash_and_lookup() to be NULL. In case it is not NULL and has some > error then d_inode() will try to dereference it later. s/unlikely/impossible/ - procfs doesn't _have_ ->d_hash. NAK; at most add a /* no ->d_hash() rejects on procfs */ comment as we have next to another call site in procfs.