All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "J. Bruce Fields" <bfields@fieldses.org>, linux-nfs@vger.kernel.org
Cc: Anna Schumaker <anna.schumaker@netapp.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Aditya Pakki <pakki001@umn.edu>, Kangjie Lu <kjlu@umn.edu>,
	Navid Emamdoost <emamd001@umn.edu>,
	Stephen McCamant <smccaman@umn.edu>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: SUNRPC: Checking a kmemdup() call in xdr_netobj_dup()
Date: Tue, 15 Oct 2019 07:44:22 +0200	[thread overview]
Message-ID: <68ca7b7c-100c-0fc0-8819-e1fa891d5414@web.de> (raw)
In-Reply-To: <20191014223350.GA19883@fieldses.org>

>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/sunrpc/xdr.h?id=1c0cc5f1ae5ee5a6913704c0d75a6e99604ee30a#n167
>> https://elixir.bootlin.com/linux/v5.4-rc2/source/include/linux/sunrpc/xdr.h#L167
>>
>> How do you think about to improve it?
>
> On a quick check--I see five xdr_netobj_dup callers, and all of them
> check whether dst->data is NULL.

Your information is appropriate.
https://elixir.bootlin.com/linux/v5.4-rc2/ident/xdr_netobj_dup

Such a Linux source code cross reference can point out that the function “xdr_netobj_dup”
is used only within the source file “fs/nfsd/nfs4state.c” so far.


> Sounds like a false positive for your tool?

This depends on the software development view you would prefer here.
The desired null pointer checks are just not performed by the mentioned
(inline) function itself.
I imagine then that a dedicated macro might help to stress software design constraints.

Regards,
Markus

      reply	other threads:[~2019-10-15  5:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12 18:20 SUNRPC: Checking a kmemdup() call in xdr_netobj_dup() Markus Elfring
2019-10-12 18:20 ` Markus Elfring
2019-10-14 22:33 ` J. Bruce Fields
2019-10-14 22:33   ` J. Bruce Fields
2019-10-15  5:44   ` Markus Elfring [this message]

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=68ca7b7c-100c-0fc0-8819-e1fa891d5414@web.de \
    --to=markus.elfring@web.de \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=emamd001@umn.edu \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=smccaman@umn.edu \
    --cc=trond.myklebust@hammerspace.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.