Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372643

Re: [PATCH] proc: fix dereference of ERR_PTR

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] proc: fix dereference of ERR_PTR
Date 2016-04-06 18:20 +0200
Message-ID <rkYls-6yQ-29@gated-at.bofh.it> (permalink)
References <rkSzo-2dL-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] proc: fix dereference of ERR_PTR Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-04-06 12:10 +0200
  Re: [PATCH] proc: fix dereference of ERR_PTR Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-06 18:20 +0200

csiph-web