Showing error 1902

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: net/sunrpc/auth_unix.c
Line in file: 130
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

100        unx_free_cred(unx_cred);
101}
102
103static void
104unx_destroy_cred(struct rpc_cred *cred)
105{
106        call_rcu(&cred->cr_rcu, unx_free_cred_callback);
107}
108
109/*
110 * Match credentials against current process creds.
111 * The root_override argument takes care of cases where the caller may
112 * request root creds (e.g. for NFS swapping).
113 */
114static int
115unx_match(struct auth_cred *acred, struct rpc_cred *rcred, int flags)
116{
117        struct unx_cred        *cred = container_of(rcred, struct unx_cred, uc_base);
118        unsigned int groups = 0;
119        unsigned int i;
120
121
122        if (cred->uc_uid != acred->uid || cred->uc_gid != acred->gid)
123                return 0;
124
125        if (acred->group_info != NULL)
126                groups = acred->group_info->ngroups;
127        if (groups > NFS_NGROUPS)
128                groups = NFS_NGROUPS;
129        for (i = 0; i < groups ; i++)
130                if (cred->uc_gids[i] != GROUP_AT(acred->group_info, i))
131                        return 0;
132        return 1;
133}
134
135/*
136 * Marshal credentials.
137 * Maybe we should keep a cached credential for performance reasons.
138 */
139static __be32 *
140unx_marshal(struct rpc_task *task, __be32 *p)
Show full sources