~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/netlink/af_netlink.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1362
1362
 
1363
1363
        NETLINK_CB(skb).pid     = nlk->pid;
1364
1364
        NETLINK_CB(skb).dst_group = dst_group;
1365
 
        NETLINK_CB(skb).loginuid = audit_get_loginuid(current);
1366
 
        NETLINK_CB(skb).sessionid = audit_get_sessionid(current);
1367
 
        security_task_getsecid(current, &(NETLINK_CB(skb).sid));
1368
1365
        memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
1369
1366
 
1370
 
        /* What can I do? Netlink is asynchronous, so that
1371
 
           we will have to save current capabilities to
1372
 
           check them, when this message will be delivered
1373
 
           to corresponding kernel module.   --ANK (980802)
1374
 
         */
1375
 
 
1376
1367
        err = -EFAULT;
1377
1368
        if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
1378
1369
                kfree_skb(skb);
1575
1566
}
1576
1567
EXPORT_SYMBOL(netlink_kernel_release);
1577
1568
 
1578
 
 
1579
 
static void listeners_free_rcu(struct rcu_head *head)
1580
 
{
1581
 
        kfree(container_of(head, struct listeners, rcu));
1582
 
}
1583
 
 
1584
1569
int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
1585
1570
{
1586
1571
        struct listeners *new, *old;
1597
1582
                memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups));
1598
1583
                rcu_assign_pointer(tbl->listeners, new);
1599
1584
 
1600
 
                call_rcu(&old->rcu, listeners_free_rcu);
 
1585
                kfree_rcu(old, rcu);
1601
1586
        }
1602
1587
        tbl->groups = groups;
1603
1588