From: Dan Carpenter <dan.carpenter@oracle.com>
To: Nigel Christian <nigel.l.christian@gmail.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm: hugetlb: checking for IS_ERR() instead of NULL
Date: Fri, 4 Jun 2021 16:34:00 +0300 [thread overview]
Message-ID: <20210604133400.GL1955@kadam> (raw)
In-Reply-To: <20210602144752.GC10983@kadam>
On Wed, Jun 02, 2021 at 05:47:52PM +0300, Dan Carpenter wrote:
> On Tue, Jun 01, 2021 at 11:50:06PM +0300, Dan Carpenter wrote:
> > On Tue, Jun 01, 2021 at 10:51:23PM +0300, Dan Carpenter wrote:
> > > The other thing which might be interesting is if you pass a NULL
> > > to IS_ERR() and then dereference the NULL then print a warning about
> > > that. This has a lot of overlaps with some of my existing checks, but
> > > it's still a new idea so it belongs in a separate check. It's fine and
> > > good even if one bug triggers a lot of different warnings. I'll write
> > > that, hang on, brb.
> >
> > 100% untested. :) I'll test it tonight.
> >
>
I also added a check for:
if (is_impossible_path())
return;
to silence some of the false positives. But the results are all still
false positives. They're "high quality" false positives, because often
the code looks buggy. I think that someone went through and fixed all
the real bugs with this.
I reported the snd_media_device_create() bug and sent a fix for the
nfs_init_server() but the rest, I'm just going to leave.
sound/usb/media.c:287 snd_media_device_create() error: potential NULL/IS_ERR bug 'mdev'
mm/mempolicy.c:1293 do_mbind() error: potential NULL/IS_ERR bug 'new'
fs/nfs/client.c:701 nfs_init_server() error: potential NULL/IS_ERR bug 'clp'
fs/afs/server.c:652 afs_update_server_record() error: potential NULL/IS_ERR bug 'alist'
fs/afs/volume.c:322 afs_update_volume_status() error: potential NULL/IS_ERR bug 'vldb'
fs/ubifs/lpt_commit.c:583 next_pnode_to_dirty() error: potential NULL/IS_ERR bug 'nnode'
fs/ubifs/lpt_commit.c:583 next_pnode_to_dirty() error: potential NULL/IS_ERR bug 'nnode'
fs/ntfs/attrib.c:2188 ntfs_attr_extend_allocation() error: potential NULL/IS_ERR bug 'rl'
fs/ext4/namei.c:2375 ext4_add_entry() error: potential NULL/IS_ERR bug 'bh'
drivers/pinctrl/renesas/core.c:1144 sh_pfc_probe() error: potential NULL/IS_ERR bug 'info'
drivers/mfd/ene-kb3930.c:165 kb3930_probe() error: potential NULL/IS_ERR bug 'ddata->off_gpios'
drivers/mtd/ubi/attach.c:409 add_volume() error: potential NULL/IS_ERR bug 'av'
drivers/mtd/ubi/fastmap.c:185 add_vol() error: potential NULL/IS_ERR bug 'av'
drivers/gpu/drm/nouveau/nvkm/engine/nvdec/base.c:57 nvkm_nvdec_new_() error: potential NULL/IS_ERR bug 'fwif'
drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c:104 nvkm_sec2_new_() error: potential NULL/IS_ERR bug 'fwif'
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:2108 gf100_gr_new_() error: potential NULL/IS_ERR bug 'fwif'
drivers/gpu/drm/nouveau/nvkm/engine/nvenc/base.c:59 nvkm_nvenc_new_() error: potential NULL/IS_ERR bug 'fwif'
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c:181 nvkm_pmu_ctor() error: potential NULL/IS_ERR bug 'fwif'
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c:56 nvkm_gsp_new_() error: potential NULL/IS_ERR bug 'fwif'
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c:430 nvkm_acr_new_() error: potential NULL/IS_ERR bug 'fwif'
drivers/clk/clk.c:417 clk_core_get() error: potential NULL/IS_ERR bug 'hw'
drivers/platform/chrome/cros_ec_chardev.c:225 cros_ec_chardev_read() error: potential NULL/IS_ERR bug 'event'
net/xfrm/xfrm_policy.c:2785 xfrm_policy_queue_process() error: potential NULL/IS_ERR bug 'dst'
net/xfrm/xfrm_interface.c:282 xfrmi_xmit2() error: potential NULL/IS_ERR bug 'dst'
net/ipv6/netfilter/nf_reject_ipv6.c:327 nf_send_reset6() error: potential NULL/IS_ERR bug 'dst'
net/ipv6/ip6_tunnel.c:1161 ip6_tnl_xmit() error: potential NULL/IS_ERR bug 'dst'
net/ipv6/ndisc.c:505 ndisc_send_skb() error: potential NULL/IS_ERR bug 'dst'
security/selinux/hooks.c:3157 selinux_inode_follow_link() error: potential NULL/IS_ERR bug 'isec'
security/selinux/hooks.c:3212 selinux_inode_permission() error: potential NULL/IS_ERR bug 'isec'
regards,
dan carpenter
next prev parent reply other threads:[~2021-06-04 13:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 9:25 [PATCH] mm: hugetlb: checking for IS_ERR() instead of NULL Dan Carpenter
2021-06-01 10:52 ` Mina Almasry
2021-06-01 17:54 ` Nigel Christian
2021-06-01 19:00 ` Dan Carpenter
2021-06-01 19:51 ` Dan Carpenter
2021-06-01 20:50 ` Dan Carpenter
2021-06-01 21:23 ` Nigel Christian
2021-06-02 6:11 ` Dan Carpenter
2021-06-02 14:47 ` Dan Carpenter
2021-06-02 16:01 ` Nigel Christian
2021-06-04 13:34 ` Dan Carpenter [this message]
2021-06-04 14:14 ` Nigel Christian
2021-06-04 14:21 ` Dan Carpenter
2021-06-02 14:22 ` Dan Carpenter
2021-06-02 15:57 ` Nigel Christian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210604133400.GL1955@kadam \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=nigel.l.christian@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).