Linux NFS development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: simo@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: re: SUNRPC: Add RPC based upcall mechanism for RPCGSS auth
Date: Mon, 6 May 2013 18:44:35 +0300	[thread overview]
Message-ID: <20130506154435.GA14732@elgon.mountain> (raw)

Hello Simo Sorce,

The patch 1d658336b05f: "SUNRPC: Add RPC based upcall mechanism for 
RPCGSS auth" from May 25, 2012, leads to the following warning:
"net/sunrpc/auth_gss/gss_rpc_xdr.c:30 gssx_check_pointer()
	 warn: signedness bug returning '(-28)'"

net/sunrpc/auth_gss/gss_rpc_xdr.c
    24  static bool gssx_check_pointer(struct xdr_stream *xdr)
    25  {
    26          __be32 *p;
    27  
    28          p = xdr_reserve_space(xdr, 4);
    29          if (unlikely(p == NULL))
    30                  return -ENOSPC;
                               ^^^^^^^
This is casted implicitly to "true".  Functions named "check" are a bad
idea anyways because it's not clear what the return value will be.  It's
better to use "gssx_pointer_ok()" or "valid" where obviously true means
that the pointer is ok.

    31          return *p?true:false;

We just reserved "*p" so doesn't this point to uninitialized data?  It
points to a __be32.  So we're not really checking a pointer we're
checking that __be32 is non-zero.

    32  }

regards,
dan carpenter


             reply	other threads:[~2013-05-06 15:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 15:44 Dan Carpenter [this message]
2013-05-06 15:54 ` SUNRPC: Add RPC based upcall mechanism for RPCGSS auth Simo Sorce
2013-05-07 21:49   ` J. Bruce Fields
2013-05-07 21:57     ` Simo Sorce

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=20130506154435.GA14732@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=simo@redhat.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