Skip to contentSkip to conversation

SUNRPC: Convert auth_gss pipe detection to work in namespaces

DISCUSSION Dan Carpenter 2 participants 2 messages May 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Trond Myklebust,

The patch 11575f2498f5: "SUNRPC: Convert auth_gss pipe detection to work in namespaces" from May 15, 2013, leads to the following Smatch warnings:

net/sunrpc/auth_gss/auth_gss.c:275 get_pipe_version() warn: always true condition '(sn->pipe_version >= 0) => (0-u32max >= 0)'" net/sunrpc/auth_gss/auth_gss.c:732 gss_pipe_open() warn: unsigned 'sn->pipe_version' is never less than zero. net/sunrpc/auth_gss/auth_gss.c:590 gss_create_upcall() warn: unsigned 'sn->pipe_version' is never less than zero.

net/sunrpc/auth_gss/auth_gss.c
274 spin_lock(&pipe_version_lock);

Quoted 1 line

275 if (sn->pipe_version >= 0) {

276 atomic_inc(&sn->pipe_users);
277 ret = sn->pipe_version;
278 } else
279 ret = -EAGAIN;

[snip]

Quoted 1 line

590 if (sn->pipe_version < 0) {

591 if (err == 0)
592 sn->gssd_running = 0;
593 warn_gssd();
594 err = -EACCES;
595 }
596 if (err < 0)
597 goto out;

[snip]

731 spin_lock(&pipe_version_lock);

Quoted 1 line

732 if (sn->pipe_version < 0) {

   733                  /* First open of any gss pipe determines the version: */
   734                  sn->pipe_version = new_version;
   735                  rpc_wake_up(&pipe_version_rpc_waitqueue);
   736                  wake_up(&pipe_version_waitqueue);
   737          } else if (sn->pipe_version != new_version) {
   738                  /* Trying to open a pipe of a different version */
   739                  ret = -EBUSY;
   740                  goto out;

741 }

regards,
dan carpenter

#1 lore raw
Quoted 9 lines · Dan Carpenter

Hello Trond Myklebust,

The patch 11575f2498f5: "SUNRPC: Convert auth_gss pipe detection to work in namespaces" from May 15, 2013, leads to the following Smatch warnings:

net/sunrpc/auth_gss/auth_gss.c:275 get_pipe_version() warn: always true condition '(sn->pipe_version >= 0) => (0-u32max >= 0)'" net/sunrpc/auth_gss/auth_gss.c:732 gss_pipe_open() warn: unsigned 'sn->pipe_version' is never less than zero. net/sunrpc/auth_gss/auth_gss.c:590 gss_create_upcall() warn: unsigned 'sn->pipe_version' is never less than zero.

Thanks Dan! It's fixed now...

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com