Showing error 1774

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: net/sunrpc/auth_gss/auth_gss.c
Line in file: 362
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 20:24:52 UTC


Source:

 332        if (gss_msg != NULL) {
 333                INIT_LIST_HEAD(&gss_msg->list);
 334                rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq");
 335                init_waitqueue_head(&gss_msg->waitqueue);
 336                atomic_set(&gss_msg->count, 1);
 337                gss_msg->msg.data = &gss_msg->uid;
 338                gss_msg->msg.len = sizeof(gss_msg->uid);
 339                gss_msg->uid = uid;
 340                gss_msg->auth = gss_auth;
 341        }
 342        return gss_msg;
 343}
 344
 345static struct gss_upcall_msg *
 346gss_setup_upcall(struct rpc_clnt *clnt, struct gss_auth *gss_auth, struct rpc_cred *cred)
 347{
 348        struct gss_cred *gss_cred = container_of(cred,
 349                        struct gss_cred, gc_base);
 350        struct gss_upcall_msg *gss_new, *gss_msg;
 351        uid_t uid = cred->cr_uid;
 352
 353        /* Special case: rpc.gssd assumes that uid == 0 implies machine creds */
 354        if (gss_cred->gc_machine_cred != 0)
 355                uid = 0;
 356
 357        gss_new = gss_alloc_msg(gss_auth, uid);
 358        if (gss_new == NULL)
 359                return ERR_PTR(-ENOMEM);
 360        gss_msg = gss_add_msg(gss_auth, gss_new);
 361        if (gss_msg == gss_new) {
 362                int res = rpc_queue_upcall(gss_auth->dentry->d_inode, &gss_new->msg);
 363                if (res) {
 364                        gss_unhash_msg(gss_new);
 365                        gss_msg = ERR_PTR(res);
 366                }
 367        } else
 368                gss_release_msg(gss_new);
 369        return gss_msg;
 370}
 371
 372static inline int
Show full sources