Showing error 1118

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: net/unix/af_unix.c
Line in file: 1407
Project: Linux Kernel
Project version: 2.6.28
Tools: Clang Static Analyzer (3.0)
Entered: 2012-04-17 12:29:30 UTC


Source:

1377        if (skb==NULL)
1378                goto out;
1379
1380        memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
1381        if (siocb->scm->fp) {
1382                err = unix_attach_fds(siocb->scm, skb);
1383                if (err)
1384                        goto out_free;
1385        }
1386        unix_get_secdata(siocb->scm, skb);
1387
1388        skb_reset_transport_header(skb);
1389        err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
1390        if (err)
1391                goto out_free;
1392
1393        timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
1394
1395restart:
1396        if (!other) {
1397                err = -ECONNRESET;
1398                if (sunaddr == NULL)
1399                        goto out_free;
1400
1401                other = unix_find_other(net, sunaddr, namelen, sk->sk_type,
1402                                        hash, &err);
1403                if (other==NULL)
1404                        goto out_free;
1405        }
1406
1407        unix_state_lock(other);
1408        err = -EPERM;
1409        if (!unix_may_send(sk, other))
1410                goto out_unlock;
1411
1412        if (sock_flag(other, SOCK_DEAD)) {
1413                /*
1414                 *        Check with 1003.1g - what should
1415                 *        datagram error
1416                 */
1417                unix_state_unlock(other);
Show full sources