Linux NFS development
 help / color / mirror / Atom feed
* re: SUNRPC: Add RPC based upcall mechanism for RPCGSS auth
@ 2013-05-06 15:44 Dan Carpenter
  2013-05-06 15:54 ` Simo Sorce
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2013-05-06 15:44 UTC (permalink / raw)
  To: simo; +Cc: linux-nfs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-08 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-06 15:44 SUNRPC: Add RPC based upcall mechanism for RPCGSS auth Dan Carpenter
2013-05-06 15:54 ` Simo Sorce
2013-05-07 21:49   ` J. Bruce Fields
2013-05-07 21:57     ` Simo Sorce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox