aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-05 08:59:37 -0400
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-05 08:59:37 -0400
commitbfd4bda097f8758d28e632ff2035e25577f6b060 (patch)
tree022276b3625a432c7132e39776e7e448445087ac /kernel
parent488f2eaca1b0831a5a5e6a66e33bad2cdeff7238 (diff)
parentb2d84f078a8be40f5ae3b4d2ac001e2a7f45fe4f (diff)
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c19
-rw-r--r--kernel/exit.c2
2 files changed, 10 insertions, 11 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 00455a9cf027..9c4f1af0c794 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -430,7 +430,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
430/* Get message from skb (based on rtnetlink_rcv_skb). Each message is 430/* Get message from skb (based on rtnetlink_rcv_skb). Each message is
431 * processed by audit_receive_msg. Malformed skbs with wrong length are 431 * processed by audit_receive_msg. Malformed skbs with wrong length are
432 * discarded silently. */ 432 * discarded silently. */
433static int audit_receive_skb(struct sk_buff *skb) 433static void audit_receive_skb(struct sk_buff *skb)
434{ 434{
435 int err; 435 int err;
436 struct nlmsghdr *nlh; 436 struct nlmsghdr *nlh;
@@ -439,7 +439,7 @@ static int audit_receive_skb(struct sk_buff *skb)
439 while (skb->len >= NLMSG_SPACE(0)) { 439 while (skb->len >= NLMSG_SPACE(0)) {
440 nlh = (struct nlmsghdr *)skb->data; 440 nlh = (struct nlmsghdr *)skb->data;
441 if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) 441 if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len)
442 return 0; 442 return;
443 rlen = NLMSG_ALIGN(nlh->nlmsg_len); 443 rlen = NLMSG_ALIGN(nlh->nlmsg_len);
444 if (rlen > skb->len) 444 if (rlen > skb->len)
445 rlen = skb->len; 445 rlen = skb->len;
@@ -449,23 +449,20 @@ static int audit_receive_skb(struct sk_buff *skb)
449 netlink_ack(skb, nlh, 0); 449 netlink_ack(skb, nlh, 0);
450 skb_pull(skb, rlen); 450 skb_pull(skb, rlen);
451 } 451 }
452 return 0;
453} 452}
454 453
455/* Receive messages from netlink socket. */ 454/* Receive messages from netlink socket. */
456static void audit_receive(struct sock *sk, int length) 455static void audit_receive(struct sock *sk, int length)
457{ 456{
458 struct sk_buff *skb; 457 struct sk_buff *skb;
458 unsigned int qlen;
459 459
460 if (down_trylock(&audit_netlink_sem)) 460 down(&audit_netlink_sem);
461 return;
462 461
463 /* FIXME: this must not cause starvation */ 462 for (qlen = skb_queue_len(&sk->sk_receive_queue); qlen; qlen--) {
464 while ((skb = skb_dequeue(&sk->sk_receive_queue))) { 463 skb = skb_dequeue(&sk->sk_receive_queue);
465 if (audit_receive_skb(skb) && skb->len) 464 audit_receive_skb(skb);
466 skb_queue_head(&sk->sk_receive_queue, skb); 465 kfree_skb(skb);
467 else
468 kfree_skb(skb);
469 } 466 }
470 up(&audit_netlink_sem); 467 up(&audit_netlink_sem);
471} 468}
diff --git a/kernel/exit.c b/kernel/exit.c
index 7be283d98983..edaa50b5bbfa 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -846,6 +846,8 @@ fastcall NORET_TYPE void do_exit(long code)
846 for (;;) ; 846 for (;;) ;
847} 847}
848 848
849EXPORT_SYMBOL_GPL(do_exit);
850
849NORET_TYPE void complete_and_exit(struct completion *comp, long code) 851NORET_TYPE void complete_and_exit(struct completion *comp, long code)
850{ 852{
851 if (comp) 853 if (comp)