public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 00/32] -stable review
@ 2006-12-08 23:57 Chris Wright
  2006-12-08 23:57 ` [patch 01/32] IPV6 NDISC: Calculate packet length correctly for allocation Chris Wright
                   ` (34 more replies)
  0 siblings, 35 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan

This is the start of the stable review cycle for the 2.6.19.1 release.
There are 32 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let us know.  If anyone is a maintainer of the proper subsystem, and
wants to add a Signed-off-by: line to the patch, please respond with it.

These patches are sent out with a number of different people on the
Cc: line.  If you wish to be a reviewer, please email stable@kernel.org
to add your name to the list.  If you want to be off the reviewer list,
also email us.

Responses should be made by Mon Dec 11 00:00 UTC Anything received after
that time might be too late.

thanks,

the -stable release team
--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 01/32] IPV6 NDISC: Calculate packet length correctly for allocation.
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-08 23:57 ` [patch 02/32] softmac: remove netif_tx_disable when scanning Chris Wright
                   ` (33 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller

[-- Attachment #1: ndisc-calculate-packet-length-correctly-for-allocation.patch --]
[-- Type: text/plain, Size: 2117 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: David Miller <davem@davemloft.net>

MAX_HEADER does not include the ipv6 header length in it,
so we need to add it in explicitly.

With help from YOSHIFUJI Hideaki.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit 6e38433357e2381bb278a418fb7e2fd201475101
Author: David S. Miller <davem@sunset.davemloft.net>
Date:   Sat Dec 2 21:00:06 2006 -0800

 net/ipv6/ndisc.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- linux-2.6.19.orig/net/ipv6/ndisc.c
+++ linux-2.6.19/net/ipv6/ndisc.c
@@ -472,7 +472,9 @@ static void ndisc_send_na(struct net_dev
 			inc_opt = 0;
 	}
 
-	skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
+	skb = sock_alloc_send_skb(sk,
+				  (MAX_HEADER + sizeof(struct ipv6hdr) +
+				   len + LL_RESERVED_SPACE(dev)),
 				  1, &err);
 
 	if (skb == NULL) {
@@ -561,7 +563,9 @@ void ndisc_send_ns(struct net_device *de
 	if (send_llinfo)
 		len += ndisc_opt_addr_space(dev);
 
-	skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
+	skb = sock_alloc_send_skb(sk,
+				  (MAX_HEADER + sizeof(struct ipv6hdr) +
+				   len + LL_RESERVED_SPACE(dev)),
 				  1, &err);
 	if (skb == NULL) {
 		ND_PRINTK0(KERN_ERR
@@ -636,7 +640,9 @@ void ndisc_send_rs(struct net_device *de
 	if (dev->addr_len)
 		len += ndisc_opt_addr_space(dev);
 
-        skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
+        skb = sock_alloc_send_skb(sk,
+				  (MAX_HEADER + sizeof(struct ipv6hdr) +
+				   len + LL_RESERVED_SPACE(dev)),
 				  1, &err);
 	if (skb == NULL) {
 		ND_PRINTK0(KERN_ERR
@@ -1446,7 +1452,9 @@ void ndisc_send_redirect(struct sk_buff 
 	rd_len &= ~0x7;
 	len += rd_len;
 
-	buff = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev),
+	buff = sock_alloc_send_skb(sk,
+				   (MAX_HEADER + sizeof(struct ipv6hdr) +
+				    len + LL_RESERVED_SPACE(dev)),
 				   1, &err);
 	if (buff == NULL) {
 		ND_PRINTK0(KERN_ERR

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 02/32] softmac: remove netif_tx_disable when scanning
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
  2006-12-08 23:57 ` [patch 01/32] IPV6 NDISC: Calculate packet length correctly for allocation Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-08 23:57 ` [patch 03/32] EBTABLES: Fix wraparounds in ebt_entries verification Chris Wright
                   ` (32 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Larry Finger, Michael Buesch

[-- Attachment #1: softmac-remove-netif_tx_disable-when-scanning.patch --]
[-- Type: text/plain, Size: 1410 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Michael Buesch <mb@bu3sch.de>

In the scan section of ieee80211softmac, network transmits are disabled.
When SoftMAC re-enables transmits, it may override the wishes of a driver
that may have very good reasons for disabling transmits. At least one failure
in bcm43xx can be traced to this problem. In addition, several unexplained
problems may arise from the unexpected enabling of transmits.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 net/ieee80211/softmac/ieee80211softmac_scan.c |    2 --
 1 file changed, 2 deletions(-)

--- linux-2.6.19.orig/net/ieee80211/softmac/ieee80211softmac_scan.c
+++ linux-2.6.19/net/ieee80211/softmac/ieee80211softmac_scan.c
@@ -47,7 +47,6 @@ ieee80211softmac_start_scan(struct ieee8
 	sm->scanning = 1;
 	spin_unlock_irqrestore(&sm->lock, flags);
 
-	netif_tx_disable(sm->ieee->dev);
 	ret = sm->start_scan(sm->dev);
 	if (ret) {
 		spin_lock_irqsave(&sm->lock, flags);
@@ -248,7 +247,6 @@ void ieee80211softmac_scan_finished(stru
 		if (net)
 			sm->set_channel(sm->dev, net->channel);
 	}
-	netif_wake_queue(sm->ieee->dev);
 	ieee80211softmac_call_events(sm, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, NULL);
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_scan_finished);

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 03/32] EBTABLES: Fix wraparounds in ebt_entries verification.
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
  2006-12-08 23:57 ` [patch 01/32] IPV6 NDISC: Calculate packet length correctly for allocation Chris Wright
  2006-12-08 23:57 ` [patch 02/32] softmac: remove netif_tx_disable when scanning Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-08 23:57 ` [patch 04/32] EBTABLES: Verify that ebt_entries have zero ->distinguisher Chris Wright
                   ` (31 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk, Al Viro

[-- Attachment #1: ebtables-fix-wraparounds-in-ebt_entries-verification.patch --]
[-- Type: text/plain, Size: 2468 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Al Viro <viro@zeniv.linux.org.uk>

We need to verify that
	a) we are not too close to the end of buffer to dereference
	b) next entry we'll be checking won't be _before_ our

While we are at it, don't subtract unrelated pointers...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 net/bridge/netfilter/ebtables.c |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

--- linux-2.6.19.orig/net/bridge/netfilter/ebtables.c
+++ linux-2.6.19/net/bridge/netfilter/ebtables.c
@@ -401,13 +401,17 @@ ebt_check_entry_size_and_hooks(struct eb
    struct ebt_entries **hook_entries, unsigned int *n, unsigned int *cnt,
    unsigned int *totalcnt, unsigned int *udc_cnt, unsigned int valid_hooks)
 {
+	unsigned int offset = (char *)e - newinfo->entries;
+	size_t left = (limit - base) - offset;
 	int i;
 
+	if (left < sizeof(unsigned int))
+		goto Esmall;
+
 	for (i = 0; i < NF_BR_NUMHOOKS; i++) {
 		if ((valid_hooks & (1 << i)) == 0)
 			continue;
-		if ( (char *)hook_entries[i] - base ==
-		   (char *)e - newinfo->entries)
+		if ((char *)hook_entries[i] == base + offset)
 			break;
 	}
 	/* beginning of a new chain
@@ -428,11 +432,8 @@ ebt_check_entry_size_and_hooks(struct eb
 			return -EINVAL;
 		}
 		/* before we look at the struct, be sure it is not too big */
-		if ((char *)hook_entries[i] + sizeof(struct ebt_entries)
-		   > limit) {
-			BUGPRINT("entries_size too small\n");
-			return -EINVAL;
-		}
+		if (left < sizeof(struct ebt_entries))
+			goto Esmall;
 		if (((struct ebt_entries *)e)->policy != EBT_DROP &&
 		   ((struct ebt_entries *)e)->policy != EBT_ACCEPT) {
 			/* only RETURN from udc */
@@ -455,6 +456,8 @@ ebt_check_entry_size_and_hooks(struct eb
 		return 0;
 	}
 	/* a plain old entry, heh */
+	if (left < sizeof(struct ebt_entry))
+		goto Esmall;
 	if (sizeof(struct ebt_entry) > e->watchers_offset ||
 	   e->watchers_offset > e->target_offset ||
 	   e->target_offset >= e->next_offset) {
@@ -466,10 +469,16 @@ ebt_check_entry_size_and_hooks(struct eb
 		BUGPRINT("target size too small\n");
 		return -EINVAL;
 	}
+	if (left < e->next_offset)
+		goto Esmall;
 
 	(*cnt)++;
 	(*totalcnt)++;
 	return 0;
+
+Esmall:
+	BUGPRINT("entries_size too small\n");
+	return -EINVAL;
 }
 
 struct ebt_cl_stack

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 04/32] EBTABLES: Verify that ebt_entries have zero ->distinguisher.
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (2 preceding siblings ...)
  2006-12-08 23:57 ` [patch 03/32] EBTABLES: Fix wraparounds in ebt_entries verification Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-08 23:57 ` [patch 05/32] EBTABLES: Deal with the worst-case behaviour in loop checks Chris Wright
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk, Al Viro

[-- Attachment #1: ebtables-verify-that-ebt_entries-have-zero-distinguisher.patch --]
[-- Type: text/plain, Size: 1989 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Al Viro <viro@zeniv.linux.org.uk>

We need that for iterator to work; existing check had been too weak.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 net/bridge/netfilter/ebtables.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- linux-2.6.19.orig/net/bridge/netfilter/ebtables.c
+++ linux-2.6.19/net/bridge/netfilter/ebtables.c
@@ -417,7 +417,7 @@ ebt_check_entry_size_and_hooks(struct eb
 	/* beginning of a new chain
 	   if i == NF_BR_NUMHOOKS it must be a user defined chain */
 	if (i != NF_BR_NUMHOOKS || !(e->bitmask & EBT_ENTRY_OR_ENTRIES)) {
-		if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) != 0) {
+		if (e->bitmask != 0) {
 			/* we make userspace set this right,
 			   so there is no misunderstanding */
 			BUGPRINT("EBT_ENTRY_OR_ENTRIES shouldn't be set "
@@ -500,7 +500,7 @@ ebt_get_udc_positions(struct ebt_entry *
 	int i;
 
 	/* we're only interested in chain starts */
-	if (e->bitmask & EBT_ENTRY_OR_ENTRIES)
+	if (e->bitmask)
 		return 0;
 	for (i = 0; i < NF_BR_NUMHOOKS; i++) {
 		if ((valid_hooks & (1 << i)) == 0)
@@ -550,7 +550,7 @@ ebt_cleanup_entry(struct ebt_entry *e, u
 {
 	struct ebt_entry_target *t;
 
-	if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
+	if (e->bitmask == 0)
 		return 0;
 	/* we're done */
 	if (cnt && (*cnt)-- == 0)
@@ -576,7 +576,7 @@ ebt_check_entry(struct ebt_entry *e, str
 	int ret;
 
 	/* don't mess with the struct ebt_entries */
-	if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
+	if (e->bitmask == 0)
 		return 0;
 
 	if (e->bitmask & ~EBT_F_MASK) {
@@ -1309,7 +1309,7 @@ static inline int ebt_make_names(struct 
 	char *hlp;
 	struct ebt_entry_target *t;
 
-	if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
+	if (e->bitmask == 0)
 		return 0;
 
 	hlp = ubase - base + (char *)e + e->target_offset;

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 05/32] EBTABLES: Deal with the worst-case behaviour in loop checks.
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (3 preceding siblings ...)
  2006-12-08 23:57 ` [patch 04/32] EBTABLES: Verify that ebt_entries have zero ->distinguisher Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-08 23:57 ` [patch 06/32] EBTABLES: Prevent wraparounds in checks for entry components sizes Chris Wright
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk, Al Viro

[-- Attachment #1: ebtables-deal-with-the-worst-case-behaviour-in-loop-checks.patch --]
[-- Type: text/plain, Size: 1030 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Al Viro <viro@zeniv.linux.org.uk>

No need to revisit a chain we'd already finished with during
the check for current hook.  It's either instant loop (which
we'd just detected) or a duplicate work.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 net/bridge/netfilter/ebtables.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.19.orig/net/bridge/netfilter/ebtables.c
+++ linux-2.6.19/net/bridge/netfilter/ebtables.c
@@ -717,7 +717,9 @@ static int check_chainloops(struct ebt_e
 				BUGPRINT("loop\n");
 				return -1;
 			}
-			/* this can't be 0, so the above test is correct */
+			if (cl_s[i].hookmask & (1 << hooknr))
+				goto letscontinue;
+			/* this can't be 0, so the loop test is correct */
 			cl_s[i].cs.n = pos + 1;
 			pos = 0;
 			cl_s[i].cs.e = ((void *)e + e->next_offset);

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 06/32] EBTABLES: Prevent wraparounds in checks for entry components sizes.
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (4 preceding siblings ...)
  2006-12-08 23:57 ` [patch 05/32] EBTABLES: Deal with the worst-case behaviour in loop checks Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-08 23:57 ` [patch 07/32] NET_SCHED: policer: restore compatibility with old iproute binaries Chris Wright
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk, Al Viro

[-- Attachment #1: ebtables-prevent-wraparounds-in-checks-for-entry-components-sizes.patch --]
[-- Type: text/plain, Size: 2508 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Al Viro <viro@zeniv.linux.org.uk>

---
 net/bridge/netfilter/ebtables.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

--- linux-2.6.19.orig/net/bridge/netfilter/ebtables.c
+++ linux-2.6.19/net/bridge/netfilter/ebtables.c
@@ -338,10 +338,11 @@ ebt_check_match(struct ebt_entry_match *
    const char *name, unsigned int hookmask, unsigned int *cnt)
 {
 	struct ebt_match *match;
+	size_t left = ((char *)e + e->watchers_offset) - (char *)m;
 	int ret;
 
-	if (((char *)m) + m->match_size + sizeof(struct ebt_entry_match) >
-	   ((char *)e) + e->watchers_offset)
+	if (left < sizeof(struct ebt_entry_match) ||
+	    left - sizeof(struct ebt_entry_match) < m->match_size)
 		return -EINVAL;
 	match = find_match_lock(m->u.name, &ret, &ebt_mutex);
 	if (!match)
@@ -367,10 +368,11 @@ ebt_check_watcher(struct ebt_entry_watch
    const char *name, unsigned int hookmask, unsigned int *cnt)
 {
 	struct ebt_watcher *watcher;
+	size_t left = ((char *)e + e->target_offset) - (char *)w;
 	int ret;
 
-	if (((char *)w) + w->watcher_size + sizeof(struct ebt_entry_watcher) >
-	   ((char *)e) + e->target_offset)
+	if (left < sizeof(struct ebt_entry_watcher) ||
+	   left - sizeof(struct ebt_entry_watcher) < w->watcher_size)
 		return -EINVAL;
 	watcher = find_watcher_lock(w->u.name, &ret, &ebt_mutex);
 	if (!watcher)
@@ -573,6 +575,7 @@ ebt_check_entry(struct ebt_entry *e, str
 	struct ebt_entry_target *t;
 	struct ebt_target *target;
 	unsigned int i, j, hook = 0, hookmask = 0;
+	size_t gap = e->next_offset - e->target_offset;
 	int ret;
 
 	/* don't mess with the struct ebt_entries */
@@ -634,8 +637,7 @@ ebt_check_entry(struct ebt_entry *e, str
 
 	t->u.target = target;
 	if (t->u.target == &ebt_standard_target) {
-		if (e->target_offset + sizeof(struct ebt_standard_target) >
-		   e->next_offset) {
+		if (gap < sizeof(struct ebt_standard_target)) {
 			BUGPRINT("Standard target size too big\n");
 			ret = -EFAULT;
 			goto cleanup_watchers;
@@ -646,8 +648,7 @@ ebt_check_entry(struct ebt_entry *e, str
 			ret = -EFAULT;
 			goto cleanup_watchers;
 		}
-	} else if ((e->target_offset + t->target_size +
-	   sizeof(struct ebt_entry_target) > e->next_offset) ||
+	} else if (t->target_size > gap - sizeof(struct ebt_entry_target) ||
 	   (t->u.target->check &&
 	   t->u.target->check(name, hookmask, e, t->data, t->target_size) != 0)){
 		module_put(t->u.target->me);

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 07/32] NET_SCHED: policer: restore compatibility with old iproute binaries
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (5 preceding siblings ...)
  2006-12-08 23:57 ` [patch 06/32] EBTABLES: Prevent wraparounds in checks for entry components sizes Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-08 23:57 ` [patch 08/32] cryptoloop: Select CRYPTO_CBC Chris Wright
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk, Patrick McHardy,
	Jamal Hadi Salim

[-- Attachment #1: net_sched-policer-restore-compatibility-with-old-iproute-binaries.patch --]
[-- Type: text/plain, Size: 2509 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Patrick McHardy <kaber@trash.net>

The tc actions increased the size of struct tc_police, which broke
compatibility with old iproute binaries since both the act_police
and the old NET_CLS_POLICE code check for an exact size match.

Since the new members are not even used, the simple fix is to also
accept the size of the old structure. Dumping is not affected since
old userspace will receive a bigger structure, which is handled fine.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 net/sched/act_police.c |   26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

--- linux-2.6.19.orig/net/sched/act_police.c
+++ linux-2.6.19/net/sched/act_police.c
@@ -46,6 +46,18 @@ static struct tcf_hashinfo police_hash_i
 	.lock	=	&police_lock,
 };
 
+/* old policer structure from before tc actions */
+struct tc_police_compat
+{
+	u32			index;
+	int			action;
+	u32			limit;
+	u32			burst;
+	u32			mtu;
+	struct tc_ratespec	rate;
+	struct tc_ratespec	peakrate;
+};
+
 /* Each policer is serialized by its individual spinlock */
 
 #ifdef CONFIG_NET_CLS_ACT
@@ -131,12 +143,15 @@ static int tcf_act_police_locate(struct 
 	struct tc_police *parm;
 	struct tcf_police *police;
 	struct qdisc_rate_table *R_tab = NULL, *P_tab = NULL;
+	int size;
 
 	if (rta == NULL || rtattr_parse_nested(tb, TCA_POLICE_MAX, rta) < 0)
 		return -EINVAL;
 
-	if (tb[TCA_POLICE_TBF-1] == NULL ||
-	    RTA_PAYLOAD(tb[TCA_POLICE_TBF-1]) != sizeof(*parm))
+	if (tb[TCA_POLICE_TBF-1] == NULL)
+		return -EINVAL;
+	size = RTA_PAYLOAD(tb[TCA_POLICE_TBF-1]);
+	if (size != sizeof(*parm) && size != sizeof(struct tc_police_compat))
 		return -EINVAL;
 	parm = RTA_DATA(tb[TCA_POLICE_TBF-1]);
 
@@ -415,12 +430,15 @@ struct tcf_police *tcf_police_locate(str
 	struct tcf_police *police;
 	struct rtattr *tb[TCA_POLICE_MAX];
 	struct tc_police *parm;
+	int size;
 
 	if (rtattr_parse_nested(tb, TCA_POLICE_MAX, rta) < 0)
 		return NULL;
 
-	if (tb[TCA_POLICE_TBF-1] == NULL ||
-	    RTA_PAYLOAD(tb[TCA_POLICE_TBF-1]) != sizeof(*parm))
+	if (tb[TCA_POLICE_TBF-1] == NULL)
+		return NULL;
+	size = RTA_PAYLOAD(tb[TCA_POLICE_TBF-1]);
+	if (size != sizeof(*parm) && size != sizeof(struct tc_police_compat))
 		return NULL;
 
 	parm = RTA_DATA(tb[TCA_POLICE_TBF-1]);

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 08/32] cryptoloop: Select CRYPTO_CBC
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (6 preceding siblings ...)
  2006-12-08 23:57 ` [patch 07/32] NET_SCHED: policer: restore compatibility with old iproute binaries Chris Wright
@ 2006-12-08 23:57 ` Chris Wright
  2006-12-09  6:32   ` Rene Herman
  2006-12-08 23:58 ` [patch 09/32] Revert "ACPI: SCI interrupt source override" Chris Wright
                   ` (26 subsequent siblings)
  34 siblings, 1 reply; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:57 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Herbert Xu

[-- Attachment #1: cryptoloop-select-crypto_cbc.patch --]
[-- Type: text/plain, Size: 759 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Herbert Xu <herbert@gondor.apana.org.au>

As CBC is the default chaining method for cryptoloop, we should select
it from cryptoloop to ease the transition.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 drivers/block/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.19.orig/drivers/block/Kconfig
+++ linux-2.6.19/drivers/block/Kconfig
@@ -305,6 +305,7 @@ config BLK_DEV_LOOP
 config BLK_DEV_CRYPTOLOOP
 	tristate "Cryptoloop Support"
 	select CRYPTO
+	select CRYPTO_CBC
 	depends on BLK_DEV_LOOP
 	---help---
 	  Say Y here if you want to be able to use the ciphers that are 

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 09/32] Revert "ACPI: SCI interrupt source override"
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (7 preceding siblings ...)
  2006-12-08 23:57 ` [patch 08/32] cryptoloop: Select CRYPTO_CBC Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 10/32] PKT_SCHED act_gact: division by zero Chris Wright
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, Linus Torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, Len Brown, linux-acpi

[-- Attachment #1: revert-acpi-sci-interrupt-source-override.patch --]
[-- Type: text/plain, Size: 2294 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Len Brown <len.brown@intel.com>

This reverts commit 281ea49b0c294649a6de47a6f8fbe5611137726b,
which broke ACPI Interrupt source overrides that move
the SCI from one IRQ in PIC mode to another in IOAPIC mode.

If the SCI shared an interrupt line with another device,
this would result in a "irq 18: nobody cared" type failure.

http://bugzilla.kernel.org/show_bug.cgi?id=7601

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 arch/i386/kernel/acpi/boot.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- linux-2.6.19.orig/arch/i386/kernel/acpi/boot.c
+++ linux-2.6.19/arch/i386/kernel/acpi/boot.c
@@ -333,7 +333,7 @@ acpi_parse_ioapic(acpi_table_entry_heade
 /*
  * Parse Interrupt Source Override for the ACPI SCI
  */
-static void acpi_sci_ioapic_setup(u32 bus_irq, u32 gsi, u16 polarity, u16 trigger)
+static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 {
 	if (trigger == 0)	/* compatible SCI trigger is level */
 		trigger = 3;
@@ -353,13 +353,13 @@ static void acpi_sci_ioapic_setup(u32 bu
 	 * If GSI is < 16, this will update its flags,
 	 * else it will create a new mp_irqs[] entry.
 	 */
-	mp_override_legacy_irq(bus_irq, polarity, trigger, gsi);
+	mp_override_legacy_irq(gsi, polarity, trigger, gsi);
 
 	/*
 	 * stash over-ride to indicate we've been here
 	 * and for later update of acpi_fadt
 	 */
-	acpi_sci_override_gsi = bus_irq;
+	acpi_sci_override_gsi = gsi;
 	return;
 }
 
@@ -377,7 +377,7 @@ acpi_parse_int_src_ovr(acpi_table_entry_
 	acpi_table_print_madt_entry(header);
 
 	if (intsrc->bus_irq == acpi_fadt.sci_int) {
-		acpi_sci_ioapic_setup(intsrc->bus_irq, intsrc->global_irq,
+		acpi_sci_ioapic_setup(intsrc->global_irq,
 				      intsrc->flags.polarity,
 				      intsrc->flags.trigger);
 		return 0;
@@ -880,7 +880,7 @@ static int __init acpi_parse_madt_ioapic
 	 * pretend we got one so we can set the SCI flags.
 	 */
 	if (!acpi_sci_override_gsi)
-		acpi_sci_ioapic_setup(acpi_fadt.sci_int, acpi_fadt.sci_int, 0, 0);
+		acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0);
 
 	/* Fill in identity legacy mapings where no override */
 	mp_config_acpi_legacy_irqs();

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 10/32] PKT_SCHED act_gact: division by zero
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (8 preceding siblings ...)
  2006-12-08 23:58 ` [patch 09/32] Revert "ACPI: SCI interrupt source override" Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 11/32] SUNHME: Fix for sunhme failures on x86 Chris Wright
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk, Kim Nordlund

[-- Attachment #1: pkt_sched-act_gact-division-by-zero.patch --]
[-- Type: text/plain, Size: 1099 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: David Miller <davem@davemloft.net>

Not returning -EINVAL, because someone might want to use the value
zero in some future gact_prob algorithm?

Signed-off-by: Kim Nordlund <kim.nordlund@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 net/sched/act_gact.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.19.orig/net/sched/act_gact.c
+++ linux-2.6.19/net/sched/act_gact.c
@@ -48,14 +48,14 @@ static struct tcf_hashinfo gact_hash_inf
 #ifdef CONFIG_GACT_PROB
 static int gact_net_rand(struct tcf_gact *gact)
 {
-	if (net_random() % gact->tcfg_pval)
+	if (!gact->tcfg_pval || net_random() % gact->tcfg_pval)
 		return gact->tcf_action;
 	return gact->tcfg_paction;
 }
 
 static int gact_determ(struct tcf_gact *gact)
 {
-	if (gact->tcf_bstats.packets % gact->tcfg_pval)
+	if (!gact->tcfg_pval || gact->tcf_bstats.packets % gact->tcfg_pval)
 		return gact->tcf_action;
 	return gact->tcfg_paction;
 }

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 11/32] SUNHME: Fix for sunhme failures on x86
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (9 preceding siblings ...)
  2006-12-08 23:58 ` [patch 10/32] PKT_SCHED act_gact: division by zero Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 12/32] NETFILTER: Fix {ip, ip6, arp}_tables hook validation Chris Wright
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, Jurij Smakov

[-- Attachment #1: sunhme-fix-for-sunhme-failures-on-x86.patch --]
[-- Type: text/plain, Size: 1047 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Jurij Smakov <jurij@wooyd.org>

The following patch fixes the failure of sunhme drivers on x86 hosts
due to missing pci_enable_device() and pci_set_master() calls, lost
during code refactoring. It has been filed as bugzilla bug #7502 [0]
and Debian bug #397460 [1].

[0] http://bugzilla.kernel.org/show_bug.cgi?id=7502
[1] http://bugs.debian.org/397460

Signed-off-by: Jurij Smakov <jurij@wooyd.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 drivers/net/sunhme.c |    5 +++++
 1 file changed, 5 insertions(+)

--- linux-2.6.19.orig/drivers/net/sunhme.c
+++ linux-2.6.19/drivers/net/sunhme.c
@@ -3012,6 +3012,11 @@ static int __devinit happy_meal_pci_prob
 #endif
 
 	err = -ENODEV;
+
+	if (pci_enable_device(pdev))
+		goto err_out;
+	pci_set_master(pdev);
+
 	if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) {
 		qp = quattro_pci_find(pdev);
 		if (qp == NULL)

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 12/32] NETFILTER: Fix {ip, ip6, arp}_tables hook validation
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (10 preceding siblings ...)
  2006-12-08 23:58 ` [patch 11/32] SUNHME: Fix for sunhme failures on x86 Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 13/32] NETFILTER: Fix iptables compat " Chris Wright
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Patrick McHardy, davem, Dmitry Mishin

[-- Attachment #1: netfilter-fix-ip-ip6-arp-_tables-hook-validation.patch --]
[-- Type: text/plain, Size: 10294 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Dmitry Mishin <dim@openvz.org>

Commit 590bdf7fd2292b47c428111cb1360e312eff207e introduced a regression
in match/target hook validation. mark_source_chains builds a bitmask
for each rule representing the hooks it can be reached from, which is
then used by the matches and targets to make sure they are only called
from valid hooks. The patch moved the match/target specific validation
before the mark_source_chains call, at which point the mask is always zero.

This patch returns back to the old order and moves the standard checks
to mark_source_chains. This allows to get rid of a special case for
standard targets as a nice side-effect.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit 756c508367e95d6f963502e4feecb8c76aeee332
tree 2be0ffb477e890a713eb48f3993a2f425baf5683
parent 0215ffb08ce99e2bb59eca114a99499a4d06e704
author Dmitry Mishin <dim@openvz.org> Mon, 04 Dec 2006 12:19:27 +0100
committer Patrick McHardy <kaber@trash.net> Mon, 04 Dec 2006 12:19:27 +0100

 net/ipv4/netfilter/arp_tables.c |   48 ++++++++++++++--------------
 net/ipv4/netfilter/ip_tables.c  |   68 ++++++++++++++--------------------------
 net/ipv6/netfilter/ip6_tables.c |   59 +++++++++++++---------------------
 3 files changed, 72 insertions(+), 103 deletions(-)

--- linux-2.6.19.orig/net/ipv4/netfilter/arp_tables.c
+++ linux-2.6.19/net/ipv4/netfilter/arp_tables.c
@@ -375,6 +375,13 @@ static int mark_source_chains(struct xt_
 			    && unconditional(&e->arp)) {
 				unsigned int oldpos, size;
 
+				if (t->verdict < -NF_MAX_VERDICT - 1) {
+					duprintf("mark_source_chains: bad "
+						"negative verdict (%i)\n",
+								t->verdict);
+					return 0;
+				}
+
 				/* Return: backtrack through the last
 				 * big jump.
 				 */
@@ -404,6 +411,14 @@ static int mark_source_chains(struct xt_
 				if (strcmp(t->target.u.user.name,
 					   ARPT_STANDARD_TARGET) == 0
 				    && newpos >= 0) {
+					if (newpos > newinfo->size -
+						sizeof(struct arpt_entry)) {
+						duprintf("mark_source_chains: "
+							"bad verdict (%i)\n",
+								newpos);
+						return 0;
+					}
+
 					/* This a jump; chase it. */
 					duprintf("Jump rule %u -> %u\n",
 						 pos, newpos);
@@ -426,8 +441,6 @@ static int mark_source_chains(struct xt_
 static inline int standard_check(const struct arpt_entry_target *t,
 				 unsigned int max_offset)
 {
-	struct arpt_standard_target *targ = (void *)t;
-
 	/* Check standard info. */
 	if (t->u.target_size
 	    != ARPT_ALIGN(sizeof(struct arpt_standard_target))) {
@@ -437,18 +450,6 @@ static inline int standard_check(const s
 		return 0;
 	}
 
-	if (targ->verdict >= 0
-	    && targ->verdict > max_offset - sizeof(struct arpt_entry)) {
-		duprintf("arpt_standard_check: bad verdict (%i)\n",
-			 targ->verdict);
-		return 0;
-	}
-
-	if (targ->verdict < -NF_MAX_VERDICT - 1) {
-		duprintf("arpt_standard_check: bad negative verdict (%i)\n",
-			 targ->verdict);
-		return 0;
-	}
 	return 1;
 }
 
@@ -627,18 +628,20 @@ static int translate_table(const char *n
 		}
 	}
 
+	if (!mark_source_chains(newinfo, valid_hooks, entry0)) {
+		duprintf("Looping hook\n");
+		return -ELOOP;
+	}
+
 	/* Finally, each sanity check must pass */
 	i = 0;
 	ret = ARPT_ENTRY_ITERATE(entry0, newinfo->size,
 				 check_entry, name, size, &i);
 
-	if (ret != 0)
-		goto cleanup;
-
-	ret = -ELOOP;
-	if (!mark_source_chains(newinfo, valid_hooks, entry0)) {
-		duprintf("Looping hook\n");
-		goto cleanup;
+	if (ret != 0) {
+		ARPT_ENTRY_ITERATE(entry0, newinfo->size,
+				cleanup_entry, &i);
+		return ret;
 	}
 
 	/* And one copy for every other CPU */
@@ -647,9 +650,6 @@ static int translate_table(const char *n
 			memcpy(newinfo->entries[i], entry0, newinfo->size);
 	}
 
-	return 0;
-cleanup:
-	ARPT_ENTRY_ITERATE(entry0, newinfo->size, cleanup_entry, &i);
 	return ret;
 }
 
--- linux-2.6.19.orig/net/ipv4/netfilter/ip_tables.c
+++ linux-2.6.19/net/ipv4/netfilter/ip_tables.c
@@ -401,6 +401,13 @@ mark_source_chains(struct xt_table_info 
 			    && unconditional(&e->ip)) {
 				unsigned int oldpos, size;
 
+				if (t->verdict < -NF_MAX_VERDICT - 1) {
+					duprintf("mark_source_chains: bad "
+						"negative verdict (%i)\n",
+								t->verdict);
+					return 0;
+				}
+
 				/* Return: backtrack through the last
 				   big jump. */
 				do {
@@ -438,6 +445,13 @@ mark_source_chains(struct xt_table_info 
 				if (strcmp(t->target.u.user.name,
 					   IPT_STANDARD_TARGET) == 0
 				    && newpos >= 0) {
+					if (newpos > newinfo->size -
+						sizeof(struct ipt_entry)) {
+						duprintf("mark_source_chains: "
+							"bad verdict (%i)\n",
+								newpos);
+						return 0;
+					}
 					/* This a jump; chase it. */
 					duprintf("Jump rule %u -> %u\n",
 						 pos, newpos);
@@ -470,27 +484,6 @@ cleanup_match(struct ipt_entry_match *m,
 }
 
 static inline int
-standard_check(const struct ipt_entry_target *t,
-	       unsigned int max_offset)
-{
-	struct ipt_standard_target *targ = (void *)t;
-
-	/* Check standard info. */
-	if (targ->verdict >= 0
-	    && targ->verdict > max_offset - sizeof(struct ipt_entry)) {
-		duprintf("ipt_standard_check: bad verdict (%i)\n",
-			 targ->verdict);
-		return 0;
-	}
-	if (targ->verdict < -NF_MAX_VERDICT - 1) {
-		duprintf("ipt_standard_check: bad negative verdict (%i)\n",
-			 targ->verdict);
-		return 0;
-	}
-	return 1;
-}
-
-static inline int
 check_match(struct ipt_entry_match *m,
 	    const char *name,
 	    const struct ipt_ip *ip,
@@ -576,12 +569,7 @@ check_entry(struct ipt_entry *e, const c
 	if (ret)
 		goto err;
 
-	if (t->u.kernel.target == &ipt_standard_target) {
-		if (!standard_check(t, size)) {
-			ret = -EINVAL;
-			goto err;
-		}
-	} else if (t->u.kernel.target->checkentry
+	if (t->u.kernel.target->checkentry
 		   && !t->u.kernel.target->checkentry(name, e, target, t->data,
 						      e->comefrom)) {
 		duprintf("ip_tables: check failed for `%s'.\n",
@@ -718,17 +706,19 @@ translate_table(const char *name,
 		}
 	}
 
+	if (!mark_source_chains(newinfo, valid_hooks, entry0))
+		return -ELOOP;
+
 	/* Finally, each sanity check must pass */
 	i = 0;
 	ret = IPT_ENTRY_ITERATE(entry0, newinfo->size,
 				check_entry, name, size, &i);
 
-	if (ret != 0)
-		goto cleanup;
-
-	ret = -ELOOP;
-	if (!mark_source_chains(newinfo, valid_hooks, entry0))
-		goto cleanup;
+	if (ret != 0) {
+		IPT_ENTRY_ITERATE(entry0, newinfo->size,
+				cleanup_entry, &i);
+		return ret;
+	}
 
 	/* And one copy for every other CPU */
 	for_each_possible_cpu(i) {
@@ -736,9 +726,6 @@ translate_table(const char *name,
 			memcpy(newinfo->entries[i], entry0, newinfo->size);
 	}
 
-	return 0;
-cleanup:
-	IPT_ENTRY_ITERATE(entry0, newinfo->size, cleanup_entry, &i);
 	return ret;
 }
 
@@ -1591,18 +1578,13 @@ static int compat_copy_entry_from_user(s
 	if (ret)
 		goto err;
 
-	ret = -EINVAL;
-	if (t->u.kernel.target == &ipt_standard_target) {
-		if (!standard_check(t, *size))
-			goto err;
-	} else if (t->u.kernel.target->checkentry
+	if (t->u.kernel.target->checkentry
 		   && !t->u.kernel.target->checkentry(name, de, target,
 						      t->data, de->comefrom)) {
 		duprintf("ip_tables: compat: check failed for `%s'.\n",
 			 t->u.kernel.target->name);
-		goto err;
+		ret = -EINVAL;
 	}
-	ret = 0;
 err:
 	return ret;
 }
--- linux-2.6.19.orig/net/ipv6/netfilter/ip6_tables.c
+++ linux-2.6.19/net/ipv6/netfilter/ip6_tables.c
@@ -440,6 +440,13 @@ mark_source_chains(struct xt_table_info 
 			    && unconditional(&e->ipv6)) {
 				unsigned int oldpos, size;
 
+				if (t->verdict < -NF_MAX_VERDICT - 1) {
+					duprintf("mark_source_chains: bad "
+						"negative verdict (%i)\n",
+								t->verdict);
+					return 0;
+				}
+
 				/* Return: backtrack through the last
 				   big jump. */
 				do {
@@ -477,6 +484,13 @@ mark_source_chains(struct xt_table_info 
 				if (strcmp(t->target.u.user.name,
 					   IP6T_STANDARD_TARGET) == 0
 				    && newpos >= 0) {
+					if (newpos > newinfo->size -
+						sizeof(struct ip6t_entry)) {
+						duprintf("mark_source_chains: "
+							"bad verdict (%i)\n",
+								newpos);
+						return 0;
+					}
 					/* This a jump; chase it. */
 					duprintf("Jump rule %u -> %u\n",
 						 pos, newpos);
@@ -509,27 +523,6 @@ cleanup_match(struct ip6t_entry_match *m
 }
 
 static inline int
-standard_check(const struct ip6t_entry_target *t,
-	       unsigned int max_offset)
-{
-	struct ip6t_standard_target *targ = (void *)t;
-
-	/* Check standard info. */
-	if (targ->verdict >= 0
-	    && targ->verdict > max_offset - sizeof(struct ip6t_entry)) {
-		duprintf("ip6t_standard_check: bad verdict (%i)\n",
-			 targ->verdict);
-		return 0;
-	}
-	if (targ->verdict < -NF_MAX_VERDICT - 1) {
-		duprintf("ip6t_standard_check: bad negative verdict (%i)\n",
-			 targ->verdict);
-		return 0;
-	}
-	return 1;
-}
-
-static inline int
 check_match(struct ip6t_entry_match *m,
 	    const char *name,
 	    const struct ip6t_ip6 *ipv6,
@@ -616,12 +609,7 @@ check_entry(struct ip6t_entry *e, const 
 	if (ret)
 		goto err;
 
-	if (t->u.kernel.target == &ip6t_standard_target) {
-		if (!standard_check(t, size)) {
-			ret = -EINVAL;
-			goto err;
-		}
-	} else if (t->u.kernel.target->checkentry
+	if (t->u.kernel.target->checkentry
 		   && !t->u.kernel.target->checkentry(name, e, target, t->data,
 						      e->comefrom)) {
 		duprintf("ip_tables: check failed for `%s'.\n",
@@ -758,17 +746,19 @@ translate_table(const char *name,
 		}
 	}
 
+	if (!mark_source_chains(newinfo, valid_hooks, entry0))
+		return -ELOOP;
+
 	/* Finally, each sanity check must pass */
 	i = 0;
 	ret = IP6T_ENTRY_ITERATE(entry0, newinfo->size,
 				check_entry, name, size, &i);
 
-	if (ret != 0)
-		goto cleanup;
-
-	ret = -ELOOP;
-	if (!mark_source_chains(newinfo, valid_hooks, entry0))
-		goto cleanup;
+	if (ret != 0) {
+		IP6T_ENTRY_ITERATE(entry0, newinfo->size,
+				   cleanup_entry, &i);
+		return ret;
+	}
 
 	/* And one copy for every other CPU */
 	for_each_possible_cpu(i) {
@@ -777,9 +767,6 @@ translate_table(const char *name,
 	}
 
 	return 0;
-cleanup:
-	IP6T_ENTRY_ITERATE(entry0, newinfo->size, cleanup_entry, &i);
-	return ret;
 }
 
 /* Gets counters. */

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 13/32] NETFILTER: Fix iptables compat hook validation
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (11 preceding siblings ...)
  2006-12-08 23:58 ` [patch 12/32] NETFILTER: Fix {ip, ip6, arp}_tables hook validation Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 14/32] NETFILTER: bridge netfilter: deal with martians correctly Chris Wright
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Patrick McHardy, davem, Dmitry Mishin

[-- Attachment #1: netfilter-fix-iptables-compat-hook-validation.patch --]
[-- Type: text/plain, Size: 4623 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Dmitry Mishin <dim@openvz.org>

In compat mode, matches and targets valid hooks checks always successful due
to not initialized e->comefrom field yet. This patch separates this checks from
translation code and moves them after mark_source_chains() call, where these
marks are initialized.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Signed-off-by; Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit 14f5487cb9bd34cd59360d2cac7dccac9b27e8ce
tree fab7cabcdb7fe450ff47bf42918f845ff3da1b86
parent 756c508367e95d6f963502e4feecb8c76aeee332
author Dmitry Mishin <dim@openvz.org> Mon, 04 Dec 2006 12:19:35 +0100
committer Patrick McHardy <kaber@trash.net> Mon, 04 Dec 2006 12:19:35 +0100

 net/ipv4/netfilter/ip_tables.c |   78 ++++++++++++++++++++++++++---------------
 1 file changed, 51 insertions(+), 27 deletions(-)

--- linux-2.6.19.orig/net/ipv4/netfilter/ip_tables.c
+++ linux-2.6.19/net/ipv4/netfilter/ip_tables.c
@@ -1516,25 +1516,8 @@ static inline int compat_copy_match_from
 	void **dstptr, compat_uint_t *size, const char *name,
 	const struct ipt_ip *ip, unsigned int hookmask)
 {
-	struct ipt_entry_match *dm;
-	struct ipt_match *match;
-	int ret;
-
-	dm = (struct ipt_entry_match *)*dstptr;
-	match = m->u.kernel.match;
 	xt_compat_match_from_user(m, dstptr, size);
-
-	ret = xt_check_match(match, AF_INET, dm->u.match_size - sizeof(*dm),
-			     name, hookmask, ip->proto,
-			     ip->invflags & IPT_INV_PROTO);
-	if (!ret && m->u.kernel.match->checkentry
-	    && !m->u.kernel.match->checkentry(name, ip, match, dm->data,
-					      hookmask)) {
-		duprintf("ip_tables: check failed for `%s'.\n",
-			 m->u.kernel.match->name);
-		ret = -EINVAL;
-	}
-	return ret;
+	return 0;
 }
 
 static int compat_copy_entry_from_user(struct ipt_entry *e, void **dstptr,
@@ -1556,7 +1539,7 @@ static int compat_copy_entry_from_user(s
 	ret = IPT_MATCH_ITERATE(e, compat_copy_match_from_user, dstptr, size,
 			name, &de->ip, de->comefrom);
 	if (ret)
-		goto err;
+		return ret;
 	de->target_offset = e->target_offset - (origsize - *size);
 	t = ipt_get_target(e);
 	target = t->u.kernel.target;
@@ -1569,26 +1552,62 @@ static int compat_copy_entry_from_user(s
 		if ((unsigned char *)de - base < newinfo->underflow[h])
 			newinfo->underflow[h] -= origsize - *size;
 	}
+	return ret;
+}
+
+static inline int compat_check_match(struct ipt_entry_match *m, const char *name,
+				const struct ipt_ip *ip, unsigned int hookmask)
+{
+	struct ipt_match *match;
+	int ret;
 
-	t = ipt_get_target(de);
+	match = m->u.kernel.match;
+	ret = xt_check_match(match, AF_INET, m->u.match_size - sizeof(*m),
+			     name, hookmask, ip->proto,
+			     ip->invflags & IPT_INV_PROTO);
+	if (!ret && m->u.kernel.match->checkentry
+	    && !m->u.kernel.match->checkentry(name, ip, match, m->data,
+					      hookmask)) {
+		duprintf("ip_tables: compat: check failed for `%s'.\n",
+			 m->u.kernel.match->name);
+		ret = -EINVAL;
+	}
+	return ret;
+}
+
+static inline int compat_check_target(struct ipt_entry *e, const char *name)
+{
+ 	struct ipt_entry_target *t;
+ 	struct ipt_target *target;
+ 	int ret;
+
+	t = ipt_get_target(e);
 	target = t->u.kernel.target;
 	ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t),
 			      name, e->comefrom, e->ip.proto,
 			      e->ip.invflags & IPT_INV_PROTO);
-	if (ret)
-		goto err;
-
-	if (t->u.kernel.target->checkentry
-		   && !t->u.kernel.target->checkentry(name, de, target,
-						      t->data, de->comefrom)) {
+	if (!ret && t->u.kernel.target->checkentry
+		   && !t->u.kernel.target->checkentry(name, e, target,
+						      t->data, e->comefrom)) {
 		duprintf("ip_tables: compat: check failed for `%s'.\n",
 			 t->u.kernel.target->name);
 		ret = -EINVAL;
 	}
-err:
 	return ret;
 }
 
+static inline int compat_check_entry(struct ipt_entry *e, const char *name)
+{
+	int ret;
+
+	ret = IPT_MATCH_ITERATE(e, compat_check_match, name, &e->ip,
+								e->comefrom);
+	if (ret)
+		return ret;
+
+	return compat_check_target(e, name);
+}
+
 static int
 translate_compat_table(const char *name,
 		unsigned int valid_hooks,
@@ -1677,6 +1696,11 @@ translate_compat_table(const char *name,
 	if (!mark_source_chains(newinfo, valid_hooks, entry1))
 		goto free_newinfo;
 
+	ret = IPT_ENTRY_ITERATE(entry1, newinfo->size, compat_check_entry,
+									name);
+	if (ret)
+		goto free_newinfo;
+
 	/* And one copy for every other CPU */
 	for_each_possible_cpu(i)
 		if (newinfo->entries[i] && newinfo->entries[i] != entry1)

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 14/32] NETFILTER: bridge netfilter: deal with martians correctly
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (12 preceding siblings ...)
  2006-12-08 23:58 ` [patch 13/32] NETFILTER: Fix iptables compat " Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 15/32] softmac: fix unbalanced mutex_lock/unlock in ieee80211softmac_wx_set_mlme Chris Wright
                   ` (20 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Patrick McHardy, davem, Bart De Schuymer

[-- Attachment #1: netfilter-bridge-netfilter-deal-with-martians-correctly.patch --]
[-- Type: text/plain, Size: 4594 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Bart De Schuymer <bdschuym@pandora.be>

The attached patch resolves an issue where a IP DNATed packet with a
martian source is forwarded while it's better to drop it. It also
resolves messages complaining about ip forwarding being disabled while
it's actually enabled. Thanks to lepton <ytht.net@gmail.com> for
reporting this problem.

This is probably a candidate for the -stable release.

Signed-off-by: Bart De Schuymer <bdschuym@pandora.be>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit bb01f827bae980efdecc33fbcdc1b90f1c355b3e
tree 432a8f2843b47ccac094efea35da6f19731ed834
parent 14f5487cb9bd34cd59360d2cac7dccac9b27e8ce
author Bart De Schuymer <bdschuym@pandora.be> Mon, 04 Dec 2006 12:19:46 +0100
committer Patrick McHardy <kaber@trash.net> Mon, 04 Dec 2006 12:19:46 +0100

 net/bridge/br_netfilter.c |   36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

--- linux-2.6.19.orig/net/bridge/br_netfilter.c
+++ linux-2.6.19/net/bridge/br_netfilter.c
@@ -34,6 +34,7 @@
 #include <linux/netfilter_ipv6.h>
 #include <linux/netfilter_arp.h>
 #include <linux/in_route.h>
+#include <linux/inetdevice.h>
 
 #include <net/ip.h>
 #include <net/ipv6.h>
@@ -222,10 +223,14 @@ static void __br_dnat_complain(void)
  *
  * Otherwise, the packet is considered to be routed and we just
  * change the destination MAC address so that the packet will
- * later be passed up to the IP stack to be routed.
+ * later be passed up to the IP stack to be routed. For a redirected
+ * packet, ip_route_input() will give back the localhost as output device,
+ * which differs from the bridge device.
  *
  * Let us now consider the case that ip_route_input() fails:
  *
+ * This can be because the destination address is martian, in which case
+ * the packet will be dropped.
  * After a "echo '0' > /proc/sys/net/ipv4/ip_forward" ip_route_input()
  * will fail, while __ip_route_output_key() will return success. The source
  * address for __ip_route_output_key() is set to zero, so __ip_route_output_key
@@ -238,7 +243,8 @@ static void __br_dnat_complain(void)
  *
  * --Lennert, 20020411
  * --Bart, 20020416 (updated)
- * --Bart, 20021007 (updated) */
+ * --Bart, 20021007 (updated)
+ * --Bart, 20062711 (updated) */
 static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
 {
 	if (skb->pkt_type == PACKET_OTHERHOST) {
@@ -265,15 +271,15 @@ static int br_nf_pre_routing_finish(stru
 	struct net_device *dev = skb->dev;
 	struct iphdr *iph = skb->nh.iph;
 	struct nf_bridge_info *nf_bridge = skb->nf_bridge;
+	int err;
 
 	if (nf_bridge->mask & BRNF_PKT_TYPE) {
 		skb->pkt_type = PACKET_OTHERHOST;
 		nf_bridge->mask ^= BRNF_PKT_TYPE;
 	}
 	nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
-
 	if (dnat_took_place(skb)) {
-		if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev)) {
+		if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
 			struct rtable *rt;
 			struct flowi fl = {
 				.nl_u = {
@@ -284,19 +290,33 @@ static int br_nf_pre_routing_finish(stru
 				},
 				.proto = 0,
 			};
+			struct in_device *in_dev = in_dev_get(dev);
+
+			/* If err equals -EHOSTUNREACH the error is due to a
+			 * martian destination or due to the fact that
+			 * forwarding is disabled. For most martian packets,
+			 * ip_route_output_key() will fail. It won't fail for 2 types of
+			 * martian destinations: loopback destinations and destination
+			 * 0.0.0.0. In both cases the packet will be dropped because the
+			 * destination is the loopback device and not the bridge. */
+			if (err != -EHOSTUNREACH || !in_dev || IN_DEV_FORWARD(in_dev))
+				goto free_skb;
 
 			if (!ip_route_output_key(&rt, &fl)) {
 				/* - Bridged-and-DNAT'ed traffic doesn't
-				 *   require ip_forwarding.
-				 * - Deal with redirected traffic. */
-				if (((struct dst_entry *)rt)->dev == dev ||
-				    rt->rt_type == RTN_LOCAL) {
+				 *   require ip_forwarding. */
+				if (((struct dst_entry *)rt)->dev == dev) {
 					skb->dst = (struct dst_entry *)rt;
 					goto bridged_dnat;
 				}
+				/* we are sure that forwarding is disabled, so printing
+				 * this message is no problem. Note that the packet could
+				 * still have a martian destination address, in which case
+				 * the packet could be dropped even if forwarding were enabled */
 				__br_dnat_complain();
 				dst_release((struct dst_entry *)rt);
 			}
+free_skb:
 			kfree_skb(skb);
 			return 0;
 		} else {

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 15/32] softmac: fix unbalanced mutex_lock/unlock in ieee80211softmac_wx_set_mlme
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (13 preceding siblings ...)
  2006-12-08 23:58 ` [patch 14/32] NETFILTER: bridge netfilter: deal with martians correctly Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 16/32] IB/ucm: Fix deadlock in cleanup Chris Wright
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Larry Finger, maxime, Michael Buesch,
	Stefano Brivio

[-- Attachment #1: softmac-fix-unbalanced-mutex_lock-unlock-in-ieee80211softmac_wx_set_mlme.patch --]
[-- Type: text/plain, Size: 1165 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Maxime Austruy <maxime@tralhalla.org>

Routine ieee80211softmac_wx_set_mlme has one return that fails
to release a mutex acquired at entry.

Signed-off-by: Maxime Austruy <maxime@tralhalla.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

John and Chris,

This error was introduced in the 2.6.19-rxX series and must be applied
to 2.6.19-stable and wireless-2.6.

Larry

 net/ieee80211/softmac/ieee80211softmac_wx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.19.orig/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ linux-2.6.19/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -495,7 +495,8 @@ ieee80211softmac_wx_set_mlme(struct net_
 			printk(KERN_DEBUG PFX "wx_set_mlme: we should know the net here...\n");
 			goto out;
 		}
-		return ieee80211softmac_deauth_req(mac, net, reason);
+		err =  ieee80211softmac_deauth_req(mac, net, reason);
+		goto out;
 	case IW_MLME_DISASSOC:
 		ieee80211softmac_send_disassoc_req(mac, reason);
 		mac->associnfo.associated = 0;

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 16/32] IB/ucm: Fix deadlock in cleanup
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (14 preceding siblings ...)
  2006-12-08 23:58 ` [patch 15/32] softmac: fix unbalanced mutex_lock/unlock in ieee80211softmac_wx_set_mlme Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 17/32] do_coredump() and not stopping rewrite attacks? (CVE-2006-6304) Chris Wright
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, Roland Dreier, Sean Hefty
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Michael S Tsirkin

[-- Attachment #1: ib-ucm-fix-deadlock-in-cleanup.patch --]
[-- Type: text/plain, Size: 1408 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Michael S Tsirkin <mst@mellanox.co.il>

ib_ucm_cleanup_events() holds file_mutex while calling ib_destroy_cm_id().
This can deadlock since ib_destroy_cm_id() flushes event handlers, and
ib_ucm_event_handler() needs file_mutex, too.  Therefore, drop the
file_mutex during the call to ib_destroy_cm_id().

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

Hello, -stable team!
This patch backports commit f469b2626f48829c06e40ac799c1edf62b12048e to 2.6.19.
Please consider it for 2.6.19.y - this fixes a deadlock reproduced here at Mellanox.

 drivers/infiniband/core/ucm.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.19.orig/drivers/infiniband/core/ucm.c
+++ linux-2.6.19/drivers/infiniband/core/ucm.c
@@ -161,12 +161,14 @@ static void ib_ucm_cleanup_events(struct
 				    struct ib_ucm_event, ctx_list);
 		list_del(&uevent->file_list);
 		list_del(&uevent->ctx_list);
+		mutex_unlock(&ctx->file->file_mutex);
 
 		/* clear incoming connections. */
 		if (ib_ucm_new_cm_id(uevent->resp.event))
 			ib_destroy_cm_id(uevent->cm_id);
 
 		kfree(uevent);
+		mutex_lock(&ctx->file->file_mutex);
 	}
 	mutex_unlock(&ctx->file->file_mutex);
 }

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 17/32] do_coredump() and not stopping rewrite attacks? (CVE-2006-6304)
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (15 preceding siblings ...)
  2006-12-08 23:58 ` [patch 16/32] IB/ucm: Fix deadlock in cleanup Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 18/32] TOKENRING: Remote memory corruptor in ibmtr.c Chris Wright
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Alexey Dobriyan

[-- Attachment #1: do_coredump-and-not-stopping-rewrite-attacks.patch --]
[-- Type: text/plain, Size: 1411 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Alexey Dobriyan <adobriyan@gmail.com>

On Sat, Dec 02, 2006 at 11:47:44PM +0300, Alexey Dobriyan wrote:
> David Binderman compiled 2.6.19 with icc and grepped for "was set but never
> used". Many warnings are on
> 	http://coderock.org/kj/unused-2.6.19-fs

Heh, the very first line:
fs/exec.c(1465): remark #593: variable "flag" was set but never used

fs/exec.c:
  1477		/*
  1478		 *	We cannot trust fsuid as being the "true" uid of the
  1479		 *	process nor do we know its entire history. We only know it
  1480		 *	was tainted so we dump it as root in mode 2.
  1481		 */
  1482		if (mm->dumpable == 2) {	/* Setuid core dump mode */
  1483			flag = O_EXCL;		/* Stop rewrite attacks */
  1484			current->fsuid = 0;	/* Dump root private */
  1485		}

And then filp_open follows with "flag" totally ignored.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 fs/exec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.19.orig/fs/exec.c
+++ linux-2.6.19/fs/exec.c
@@ -1515,7 +1515,8 @@ int do_coredump(long signr, int exit_cod
 		ispipe = 1;
  	} else
  		file = filp_open(corename,
-				 O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE, 0600);
+				 O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE | flag,
+				 0600);
 	if (IS_ERR(file))
 		goto fail_unlock;
 	inode = file->f_dentry->d_inode;

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 18/32] TOKENRING: Remote memory corruptor in ibmtr.c
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (16 preceding siblings ...)
  2006-12-08 23:58 ` [patch 17/32] do_coredump() and not stopping rewrite attacks? (CVE-2006-6304) Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 19/32] XFRM: Use output device disable_xfrm for forwarded packets Chris Wright
                   ` (16 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, Al Viro

[-- Attachment #1: tokenring-remote-memory-corruptor-in-ibmtr.c.patch --]
[-- Type: text/plain, Size: 1191 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: David Miller <davem@davemloft.net>

ip_summed changes last summer had missed that one.  As the result,
we have ip_summed interpreted as CHECKSUM_PARTIAL now.  IOW,
->csum is interpreted as offset of checksum in the packet.  net/core/*
will both read and modify the value as that offset, with obvious
reasons.  At the very least it's a remote memory corruptor.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit b1875feda8c1735915e12d953acba85d96129f6a
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Mon Dec 4 19:37:42 2006 -0800

 drivers/net/tokenring/ibmtr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.orig/drivers/net/tokenring/ibmtr.c
+++ linux-2.6.19/drivers/net/tokenring/ibmtr.c
@@ -1826,7 +1826,7 @@ static void tr_rx(struct net_device *dev
 	skb->protocol = tr_type_trans(skb, dev);
 	if (IPv4_p) {
 		skb->csum = chksum;
-		skb->ip_summed = 1;
+		skb->ip_summed = CHECKSUM_COMPLETE;
 	}
 	netif_rx(skb);
 	dev->last_rx = jiffies;

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 19/32] XFRM: Use output device disable_xfrm for forwarded packets
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (17 preceding siblings ...)
  2006-12-08 23:58 ` [patch 18/32] TOKENRING: Remote memory corruptor in ibmtr.c Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 20/32] USB: Fix oops in PhidgetServo Chris Wright
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk, Patrick McHardy

[-- Attachment #1: xfrm-use-output-device-disable_xfrm-for-forwarded-packets.patch --]
[-- Type: text/plain, Size: 1310 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Patrick McHardy <kaber@trash.net>

Currently the behaviour of disable_xfrm is inconsistent between
locally generated and forwarded packets. For locally generated
packets disable_xfrm disables the policy lookup if it is set on
the output device, for forwarded traffic however it looks at the
input device. This makes it impossible to disable xfrm on all
devices but a dummy device and use normal routing to direct
traffic to that device.

Always use the output device when checking disable_xfrm.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit 9be2b4e36fb04bbc968693ef95a75acc17cf2931
Author: Patrick McHardy <kaber@trash.net>
Date:   Mon Dec 4 19:59:00 2006 -0800

 net/ipv4/route.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.orig/net/ipv4/route.c
+++ linux-2.6.19/net/ipv4/route.c
@@ -1784,7 +1784,7 @@ static inline int __mkroute_input(struct
 #endif
 	if (in_dev->cnf.no_policy)
 		rth->u.dst.flags |= DST_NOPOLICY;
-	if (in_dev->cnf.no_xfrm)
+	if (out_dev->cnf.no_xfrm)
 		rth->u.dst.flags |= DST_NOXFRM;
 	rth->fl.fl4_dst	= daddr;
 	rth->rt_dst	= daddr;

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 20/32] USB: Fix oops in PhidgetServo
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (18 preceding siblings ...)
  2006-12-08 23:58 ` [patch 19/32] XFRM: Use output device disable_xfrm for forwarded packets Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 21/32] IPSEC: Fix inetpeer leak in ipv4 xfrm dst entries Chris Wright
                   ` (14 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Sean Young, linux-usb-devel,
	Greg Kroah-Hartman

[-- Attachment #1: usb-fix-oops-in-phidgetservo.patch --]
[-- Type: text/plain, Size: 765 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Sean Young <sean@mess.org>

The PhidgetServo causes an Oops when any of its sysfs attributes are read
or written too, making the driver useless.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>

---
 drivers/usb/misc/phidgetservo.c |    1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.19.orig/drivers/usb/misc/phidgetservo.c
+++ linux-2.6.19/drivers/usb/misc/phidgetservo.c
@@ -282,6 +282,7 @@ servo_probe(struct usb_interface *interf
 		dev->dev = NULL;
 		goto out;
 	}
+	dev_set_drvdata(dev->dev, dev);
 
 	servo_count = dev->type & SERVO_COUNT_QUAD ? 4 : 1;
 

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 21/32] IPSEC: Fix inetpeer leak in ipv4 xfrm dst entries.
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (19 preceding siblings ...)
  2006-12-08 23:58 ` [patch 20/32] USB: Fix oops in PhidgetServo Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 22/32] IrDA: Incorrect TTP header reservation Chris Wright
                   ` (13 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, David Miller, bunk

[-- Attachment #1: ipsec-fix-inetpeer-leak-in-ipv4-xfrm-dst-entries.patch --]
[-- Type: text/plain, Size: 925 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: David Miller <davem@davemloft.net>

We grab a reference to the route's inetpeer entry but
forget to release it in xfrm4_dst_destroy().

Bug discovered by Kazunori MIYAZAWA <kazunori@miyazawa.org>

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit 26db167702756d0022f8ea5f1f30cad3018cfe31
Author: David S. Miller <davem@sunset.davemloft.net>
Date:   Wed Dec 6 23:45:15 2006 -0800

 net/ipv4/xfrm4_policy.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.19.orig/net/ipv4/xfrm4_policy.c
+++ linux-2.6.19/net/ipv4/xfrm4_policy.c
@@ -273,6 +273,8 @@ static void xfrm4_dst_destroy(struct dst
 
 	if (likely(xdst->u.rt.idev))
 		in_dev_put(xdst->u.rt.idev);
+	if (likely(xdst->u.rt.peer))
+		inet_putpeer(xdst->u.rt.peer);
 	xfrm_dst_destroy(xdst);
 }
 

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 22/32] IrDA: Incorrect TTP header reservation
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (20 preceding siblings ...)
  2006-12-08 23:58 ` [patch 21/32] IPSEC: Fix inetpeer leak in ipv4 xfrm dst entries Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 23/32] NETLINK: Restore API compatibility of address and neighbour bits Chris Wright
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Samuel Ortiz, David S. Miller,
	Jeet Chaudhuri

[-- Attachment #1: irda-incorrect-ttp-header-reservation.patch --]
[-- Type: text/plain, Size: 1159 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Jeet Chaudhuri <jeetlinux@yahoo.co.in>

We must reserve SAR + MAX_HEADER bytes for IrLMP to fit in.
This fixes an oops reported (and fixed) by Jeet Chaudhuri, when max_sdu_size
is greater than 0.

Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>

---
 net/irda/irttp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.19.orig/net/irda/irttp.c
+++ linux-2.6.19/net/irda/irttp.c
@@ -1099,7 +1099,7 @@ int irttp_connect_request(struct tsap_cb
 			return -ENOMEM;
 
 		/* Reserve space for MUX_CONTROL and LAP header */
-		skb_reserve(tx_skb, TTP_MAX_HEADER);
+		skb_reserve(tx_skb, TTP_MAX_HEADER + TTP_SAR_HEADER);
 	} else {
 		tx_skb = userdata;
 		/*
@@ -1348,7 +1348,7 @@ int irttp_connect_response(struct tsap_c
 			return -ENOMEM;
 
 		/* Reserve space for MUX_CONTROL and LAP header */
-		skb_reserve(tx_skb, TTP_MAX_HEADER);
+		skb_reserve(tx_skb, TTP_MAX_HEADER + TTP_SAR_HEADER);
 	} else {
 		tx_skb = userdata;
 		/*

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 23/32] NETLINK: Restore API compatibility of address and neighbour bits
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (21 preceding siblings ...)
  2006-12-08 23:58 ` [patch 22/32] IrDA: Incorrect TTP header reservation Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 24/32] add bottom_half.h Chris Wright
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Thomas Graf, David S Miller

[-- Attachment #1: restore-api-compatibility-of-address-and-neighbour-bits.patch --]
[-- Type: text/plain, Size: 711 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Thomas Graf <tgraf@suug.ch>

Restore API compatibility due to bits moved from rtnetlink.h to
separate headers.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 include/linux/rtnetlink.h |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.19.orig/include/linux/rtnetlink.h
+++ linux-2.6.19/include/linux/rtnetlink.h
@@ -3,6 +3,8 @@
 
 #include <linux/netlink.h>
 #include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
 
 /****
  *		Routing/neighbour discovery messages.

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 24/32] add bottom_half.h
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (22 preceding siblings ...)
  2006-12-08 23:58 ` [patch 23/32] NETLINK: Restore API compatibility of address and neighbour bits Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-09 13:50   ` Thomas Backlund
  2006-12-08 23:58 ` [patch 25/32] drm-sis linkage fix Chris Wright
                   ` (10 subsequent siblings)
  34 siblings, 1 reply; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, mingo, ak

[-- Attachment #1: add-bottom_half.h.patch --]
[-- Type: text/plain, Size: 2352 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Andrew Morton <akpm@osdl.org>

With CONFIG_SMP=n:

drivers/input/ff-memless.c:384: warning: implicit declaration of function 'local_bh_disable'
drivers/input/ff-memless.c:393: warning: implicit declaration of function 'local_bh_enable'

Really linux/spinlock.h should include linux/interrupt.h.  But interrupt.h
includes sched.h which will need spinlock.h.

So the patch breaks the _bh declarations out into a separate header and
includes it in bothj interrupt.h and spinlock.h.

Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: Andi Kleen <ak@suse.de>
Cc: <stable@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 include/linux/bottom_half.h |    5 +++++
 include/linux/interrupt.h   |    7 +------
 include/linux/spinlock.h    |    1 +
 3 files changed, 7 insertions(+), 6 deletions(-)

--- /dev/null
+++ linux-2.6.19/include/linux/bottom_half.h
@@ -0,0 +1,5 @@
+extern void local_bh_disable(void);
+extern void __local_bh_enable(void);
+extern void _local_bh_enable(void);
+extern void local_bh_enable(void);
+extern void local_bh_enable_ip(unsigned long ip);
--- linux-2.6.19.orig/include/linux/interrupt.h
+++ linux-2.6.19/include/linux/interrupt.h
@@ -11,6 +11,7 @@
 #include <linux/hardirq.h>
 #include <linux/sched.h>
 #include <linux/irqflags.h>
+#include <linux/bottom_half.h>
 #include <asm/atomic.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
@@ -217,12 +218,6 @@ static inline void __deprecated save_and
 #define save_and_cli(x)	save_and_cli(&x)
 #endif /* CONFIG_SMP */
 
-extern void local_bh_disable(void);
-extern void __local_bh_enable(void);
-extern void _local_bh_enable(void);
-extern void local_bh_enable(void);
-extern void local_bh_enable_ip(unsigned long ip);
-
 /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
    frequency threaded job scheduling. For almost all the purposes
    tasklets are more than enough. F.e. all serial device BHs et
--- linux-2.6.19.orig/include/linux/spinlock.h
+++ linux-2.6.19/include/linux/spinlock.h
@@ -52,6 +52,7 @@
 #include <linux/thread_info.h>
 #include <linux/kernel.h>
 #include <linux/stringify.h>
+#include <linux/bottom_half.h>
 
 #include <asm/system.h>
 

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 25/32] drm-sis linkage fix
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (23 preceding siblings ...)
  2006-12-08 23:58 ` [patch 24/32] add bottom_half.h Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 26/32] compat: skip data conversion in compat_sys_mount when data_page is NULL Chris Wright
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, airlied, daniel-silveira

[-- Attachment #1: drm-sis-linkage-fix.patch --]
[-- Type: text/plain, Size: 834 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Andrew Morton <akpm@osdl.org>

Fix http://bugzilla.kernel.org/show_bug.cgi?id=7606

WARNING: "drm_sman_set_manager" [drivers/char/drm/sis.ko] undefined!

Cc: <daniel-silveira@gee.inatel.br>
Cc: Dave Airlie <airlied@linux.ie>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 drivers/char/drm/drm_sman.c |    1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.19.orig/drivers/char/drm/drm_sman.c
+++ linux-2.6.19/drivers/char/drm/drm_sman.c
@@ -162,6 +162,7 @@ drm_sman_set_manager(drm_sman_t * sman, 
 
 	return 0;
 }
+EXPORT_SYMBOL(drm_sman_set_manager);
 
 static drm_owner_item_t *drm_sman_get_owner_item(drm_sman_t * sman,
 						 unsigned long owner)

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 26/32] compat: skip data conversion in compat_sys_mount when data_page is NULL
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (24 preceding siblings ...)
  2006-12-08 23:58 ` [patch 25/32] drm-sis linkage fix Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 27/32] PM: Fix swsusp debug mode testproc Chris Wright
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, amirkin

[-- Attachment #1: compat-skip-data-conversion-in-compat_sys_mount-when-data_page-is-null.patch --]
[-- Type: text/plain, Size: 2779 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Andrey Mirkin <amirkin@openvz.org>

OpenVZ Linux kernel team has found a problem with mounting in compat mode.

Simple command "mount -t smbfs ..." on Fedora Core 5 distro in 32-bit mode
leads to oops:

Unable to handle kernel NULL pointer dereference at 0000000000000000 RIP:
[<ffffffff802bc7c6>] compat_sys_mount+0xd6/0x290
PGD 34d48067 PUD 34d03067 PMD 0
Oops: 0000 [1] SMP
CPU: 0
Modules linked in: iptable_nat simfs smbfs ip_nat ip_conntrack vzdquota
parport_pc lp parport 8021q bridge llc vznetdev vzmon nfs lockd sunrpc vzdev
iptable_filter af_packet xt_length ipt_ttl xt_tcpmss ipt_TCPMSS
iptable_mangle xt_limit ipt_tos ipt_REJECT ip_tables x_tables thermal
processor fan button battery asus_acpi ac uhci_hcd ehci_hcd usbcore i2c_i801
i2c_core e100 mii floppy ide_cd cdrom
Pid: 14656, comm: mount
RIP: 0060:[<ffffffff802bc7c6>]  [<ffffffff802bc7c6>]
compat_sys_mount+0xd6/0x290
RSP: 0000:ffff810034d31f38  EFLAGS: 00010292
RAX: 000000000000002c RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff810034c86bc0 RSI: 0000000000000096 RDI: ffffffff8061fc90
RBP: ffff810034d31f78 R08: 0000000000000000 R09: 000000000000000d
R10: ffff810034d31e58 R11: 0000000000000001 R12: ffff810039dc3000
R13: 000000000805ea48 R14: 0000000000000000 R15: 00000000c0ed0000
FS:  0000000000000000(0000) GS:ffffffff80749000(0033) knlGS:00000000b7d556b0
CS:  0060 DS: 007b ES: 007b CR0: 000000008005003b
CR2: 0000000000000000 CR3: 0000000034d43000 CR4: 00000000000006e0
Process mount (pid: 14656, veid=300, threadinfo ffff810034d30000, task
ffff810034c86bc0)
Stack:  0000000000000000 ffff810034dd0000 ffff810034e4a000 000000000805ea48
 0000000000000000 0000000000000000 0000000000000000 0000000000000000
 000000000805ea48 ffffffff8021e64e 0000000000000000 0000000000000000
Call Trace:
 [<ffffffff8021e64e>] ia32_sysret+0x0/0xa

Code: 83 3b 06 0f 85 41 01 00 00 0f b7 43 0c 89 43 14 0f b7 43 0a
RIP  [<ffffffff802bc7c6>] compat_sys_mount+0xd6/0x290
 RSP <ffff810034d31f38>
CR2: 0000000000000000

The problem is that data_page pointer can be NULL, so we should skip data
conversion in this case.

Signed-off-by: Andrey Mirkin <amirkin@openvz.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 fs/compat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.orig/fs/compat.c
+++ linux-2.6.19/fs/compat.c
@@ -869,7 +869,7 @@ asmlinkage long compat_sys_mount(char __
 
 	retval = -EINVAL;
 
-	if (type_page) {
+	if (type_page && data_page) {
 		if (!strcmp((char *)type_page, SMBFS_NAME)) {
 			do_smb_super_data_conv((void *)data_page);
 		} else if (!strcmp((char *)type_page, NCPFS_NAME)) {

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 27/32] PM: Fix swsusp debug mode testproc
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (25 preceding siblings ...)
  2006-12-08 23:58 ` [patch 26/32] compat: skip data conversion in compat_sys_mount when data_page is NULL Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 28/32] autofs: fix error code path in autofs_fill_sb() Chris Wright
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, rjw, pavel

[-- Attachment #1: pm-fix-swsusp-debug-mode-testproc.patch --]
[-- Type: text/plain, Size: 796 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Rafael J Wysocki <rjw@sisk.pl>

The 'testproc' swsusp debug mode thaws tasks twice in a row, which is _very_
confusing.  Fix that.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 kernel/power/disk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.orig/kernel/power/disk.c
+++ linux-2.6.19/kernel/power/disk.c
@@ -127,7 +127,7 @@ int pm_suspend_disk(void)
 		return error;
 
 	if (pm_disk_mode == PM_DISK_TESTPROC)
-		goto Thaw;
+		return 0;
 
 	suspend_console();
 	error = device_suspend(PMSG_FREEZE);

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 28/32] autofs: fix error code path in autofs_fill_sb()
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (26 preceding siblings ...)
  2006-12-08 23:58 ` [patch 27/32] PM: Fix swsusp debug mode testproc Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-09  3:48   ` Ian Kent
  2006-12-08 23:58 ` [patch 29/32] softirq: remove BUG_ONs which can incorrectly trigger Chris Wright
                   ` (6 subsequent siblings)
  34 siblings, 1 reply; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, jkosina, raven

[-- Attachment #1: autofs-fix-error-code-path-in-autofs_fill_sb.patch --]
[-- Type: text/plain, Size: 4225 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Jiri Kosina <jkosina@suse.cz>

When kernel is compiled with old version of autofs (CONFIG_AUTOFS_FS), and
new (observed at least with 5.x.x) automount deamon is started, kernel
correctly reports incompatible version of kernel and userland daemon, but
then screws things up instead of correct handling of the error:

 autofs: kernel does not match daemon version
 =====================================
 [ BUG: bad unlock balance detected! ]
 -------------------------------------
 automount/4199 is trying to release lock (&type->s_umount_key) at:
 [<c0163b9e>] get_sb_nodev+0x76/0xa4
 but there are no more locks to release!

 other info that might help us debug this:
 no locks held by automount/4199.

 stack backtrace:
  [<c0103b15>] dump_trace+0x68/0x1b2
  [<c0103c77>] show_trace_log_lvl+0x18/0x2c
  [<c01041db>] show_trace+0xf/0x11
  [<c010424d>] dump_stack+0x12/0x14
  [<c012e02c>] print_unlock_inbalance_bug+0xe7/0xf3
  [<c012fd4f>] lock_release+0x8d/0x164
  [<c012b452>] up_write+0x14/0x27
  [<c0163b9e>] get_sb_nodev+0x76/0xa4
  [<c0163689>] vfs_kern_mount+0x83/0xf6
  [<c016373e>] do_kern_mount+0x2d/0x3e
  [<c017513f>] do_mount+0x607/0x67a
  [<c0175224>] sys_mount+0x72/0xa4
  [<c0102b96>] sysenter_past_esp+0x5f/0x99
 DWARF2 unwinder stuck at sysenter_past_esp+0x5f/0x99
 Leftover inexact backtrace:
  =======================

and then deadlock comes.

The problem: autofs_fill_super() returns EINVAL to get_sb_nodev(), but
before that, it calls kill_anon_super() to destroy the superblock which
won't be needed.  This is however way too soon to call kill_anon_super(),
because get_sb_nodev() has to perform its own cleanup of the superblock
first (deactivate_super(), etc.).  The correct time to call
kill_anon_super() is in the autofs_kill_sb() callback, which is called by
deactivate_super() at proper time, when the superblock is ready to be
killed.

I can see the same faulty codepath also in autofs4.  This patch solves
issues in both filesystems in a same way - it postpones the
kill_anon_super() until the proper time is signalized by deactivate_super()
calling the kill_sb() callback.

[raven@themaw.net: update comment]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Ian Kent <raven@themaw.net>
Cc: <stable@kernel.org>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 fs/autofs/inode.c  |    7 ++++---
 fs/autofs4/inode.c |    7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

--- linux-2.6.19.orig/fs/autofs/inode.c
+++ linux-2.6.19/fs/autofs/inode.c
@@ -28,10 +28,11 @@ void autofs_kill_sb(struct super_block *
 	/*
 	 * In the event of a failure in get_sb_nodev the superblock
 	 * info is not present so nothing else has been setup, so
-	 * just exit when we are called from deactivate_super.
+	 * just call kill_anon_super when we are called from
+	 * deactivate_super.
 	 */
 	if (!sbi)
-		return;
+		goto out_kill_sb;
 
 	if ( !sbi->catatonic )
 		autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */
@@ -44,6 +45,7 @@ void autofs_kill_sb(struct super_block *
 
 	kfree(sb->s_fs_info);
 
+out_kill_sb:
 	DPRINTK(("autofs: shutting down\n"));
 	kill_anon_super(sb);
 }
@@ -209,7 +211,6 @@ fail_iput:
 fail_free:
 	kfree(sbi);
 	s->s_fs_info = NULL;
-	kill_anon_super(s);
 fail_unlock:
 	return -EINVAL;
 }
--- linux-2.6.19.orig/fs/autofs4/inode.c
+++ linux-2.6.19/fs/autofs4/inode.c
@@ -152,10 +152,11 @@ void autofs4_kill_sb(struct super_block 
 	/*
 	 * In the event of a failure in get_sb_nodev the superblock
 	 * info is not present so nothing else has been setup, so
-	 * just exit when we are called from deactivate_super.
+	 * just call kill_anon_super when we are called from
+	 * deactivate_super.
 	 */
 	if (!sbi)
-		return;
+		goto out_kill_sb;
 
 	sb->s_fs_info = NULL;
 
@@ -167,6 +168,7 @@ void autofs4_kill_sb(struct super_block 
 
 	kfree(sbi);
 
+out_kill_sb:
 	DPRINTK("shutting down");
 	kill_anon_super(sb);
 }
@@ -426,7 +428,6 @@ fail_ino:
 fail_free:
 	kfree(sbi);
 	s->s_fs_info = NULL;
-	kill_anon_super(s);
 fail_unlock:
 	return -EINVAL;
 }

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 29/32] softirq: remove BUG_ONs which can incorrectly trigger
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (27 preceding siblings ...)
  2006-12-08 23:58 ` [patch 28/32] autofs: fix error code path in autofs_fill_sb() Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 30/32] m32r: make userspace headers platform-independent Chris Wright
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, zach, mingo, caglar

[-- Attachment #1: softirq-remove-bug_ons-which-can-incorrectly-trigger.patch --]
[-- Type: text/plain, Size: 1823 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Zachary Amsden <zach@vmware.com>

It is possible to have tasklets get scheduled before softirqd has had a chance
to spawn on all CPUs.  This is totally harmless; after success during action
CPU_UP_PREPARE, action CPU_ONLINE will be called, which immediately wakes
softirqd on the appropriate CPU to process the already pending tasklets.  So
there is no danger of having a missed wakeup for any tasklets that were
already pending.

In particular, i386 is affected by this during startup, and is visible when
using a very large initrd; during the time it takes for the initrd to be
decompressed, a timer IRQ can come in and schedule RCU callbacks.  It is also
possible that resending of a hardware IRQ via a softirq triggers the same bug.

Because of different timing conditions, this shows up in all emulators and
virtual machines tested, including Xen, VMware, Virtual PC, and Qemu.  It is
also possible to trigger on native hardware with a large enough initrd,
although I don't have a reliable case demonstrating that.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Cc: <caglar@pardus.org.tr>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 kernel/softirq.c |    2 --
 1 file changed, 2 deletions(-)

--- linux-2.6.19.orig/kernel/softirq.c
+++ linux-2.6.19/kernel/softirq.c
@@ -574,8 +574,6 @@ static int __cpuinit cpu_callback(struct
 
 	switch (action) {
 	case CPU_UP_PREPARE:
-		BUG_ON(per_cpu(tasklet_vec, hotcpu).list);
-		BUG_ON(per_cpu(tasklet_hi_vec, hotcpu).list);
 		p = kthread_create(ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu);
 		if (IS_ERR(p)) {
 			printk("ksoftirqd for %i failed\n", hotcpu);

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 30/32] m32r: make userspace headers platform-independent
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (28 preceding siblings ...)
  2006-12-08 23:58 ` [patch 29/32] softirq: remove BUG_ONs which can incorrectly trigger Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-08 23:58 ` [patch 31/32] x86_64: fix boot hang due to nmi watchdog init code Chris Wright
                   ` (4 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, takata

[-- Attachment #1: m32r-make-userspace-headers-platform-independent.patch --]
[-- Type: text/plain, Size: 6010 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Hirokazu Takata <takata@linux-m32r.org>

The m32r kernel 2.6.18-rc1 or after cause build errors of "unknown isa
configuration" for userspace application programs, such as glibc, gdb, etc.

This is because the recent kernel do not include linux/config.h not to expose
kernel headers for userspace.

To fix the above compile errors, this patch fixes two headers ptrace.h and
sigcontext.h for m32r and makes them platform-independent.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 arch/m32r/kernel/entry.S      |   65 ++++++++++++++++++------------------------
 include/asm-m32r/ptrace.h     |   28 ++----------------
 include/asm-m32r/sigcontext.h |   13 +-------
 3 files changed, 35 insertions(+), 71 deletions(-)

--- linux-2.6.19.orig/arch/m32r/kernel/entry.S
+++ linux-2.6.19/arch/m32r/kernel/entry.S
@@ -23,35 +23,35 @@
  *	updated in fork.c:copy_thread, signal.c:do_signal,
  *	ptrace.c and ptrace.h
  *
- * M32Rx/M32R2				M32R
- *       @(sp)      - r4		ditto
- *       @(0x04,sp) - r5		ditto
- *       @(0x08,sp) - r6		ditto
- *       @(0x0c,sp) - *pt_regs		ditto
- *       @(0x10,sp) - r0		ditto
- *       @(0x14,sp) - r1		ditto
- *       @(0x18,sp) - r2		ditto
- *       @(0x1c,sp) - r3		ditto
- *       @(0x20,sp) - r7		ditto
- *       @(0x24,sp) - r8		ditto
- *       @(0x28,sp) - r9		ditto
- *       @(0x2c,sp) - r10		ditto
- *       @(0x30,sp) - r11		ditto
- *       @(0x34,sp) - r12		ditto
- *       @(0x38,sp) - syscall_nr	ditto
- *       @(0x3c,sp) - acc0h		@(0x3c,sp) - acch
- *       @(0x40,sp) - acc0l		@(0x40,sp) - accl
- *       @(0x44,sp) - acc1h		@(0x44,sp) - dummy_acc1h
- *       @(0x48,sp) - acc1l		@(0x48,sp) - dummy_acc1l
- *       @(0x4c,sp) - psw		ditto
- *       @(0x50,sp) - bpc		ditto
- *       @(0x54,sp) - bbpsw		ditto
- *       @(0x58,sp) - bbpc		ditto
- *       @(0x5c,sp) - spu (cr3)		ditto
- *       @(0x60,sp) - fp (r13)		ditto
- *       @(0x64,sp) - lr (r14)		ditto
- *       @(0x68,sp) - spi (cr2)		ditto
- *       @(0x6c,sp) - orig_r0		ditto
+ * M32R/M32Rx/M32R2
+ *       @(sp)      - r4
+ *       @(0x04,sp) - r5
+ *       @(0x08,sp) - r6
+ *       @(0x0c,sp) - *pt_regs
+ *       @(0x10,sp) - r0
+ *       @(0x14,sp) - r1
+ *       @(0x18,sp) - r2
+ *       @(0x1c,sp) - r3
+ *       @(0x20,sp) - r7
+ *       @(0x24,sp) - r8
+ *       @(0x28,sp) - r9
+ *       @(0x2c,sp) - r10
+ *       @(0x30,sp) - r11
+ *       @(0x34,sp) - r12
+ *       @(0x38,sp) - syscall_nr
+ *       @(0x3c,sp) - acc0h
+ *       @(0x40,sp) - acc0l
+ *       @(0x44,sp) - acc1h		; ISA_DSP_LEVEL2 only
+ *       @(0x48,sp) - acc1l		; ISA_DSP_LEVEL2 only
+ *       @(0x4c,sp) - psw
+ *       @(0x50,sp) - bpc
+ *       @(0x54,sp) - bbpsw
+ *       @(0x58,sp) - bbpc
+ *       @(0x5c,sp) - spu (cr3)
+ *       @(0x60,sp) - fp (r13)
+ *       @(0x64,sp) - lr (r14)
+ *       @(0x68,sp) - spi (cr2)
+ *       @(0x6c,sp) - orig_r0
  */
 
 #include <linux/linkage.h>
@@ -95,17 +95,10 @@
 #define R11(reg)		@(0x30,reg)
 #define R12(reg)		@(0x34,reg)
 #define SYSCALL_NR(reg)		@(0x38,reg)
-#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
 #define ACC0H(reg)		@(0x3C,reg)
 #define ACC0L(reg)		@(0x40,reg)
 #define ACC1H(reg)		@(0x44,reg)
 #define ACC1L(reg)		@(0x48,reg)
-#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
-#define ACCH(reg)		@(0x3C,reg)
-#define ACCL(reg)		@(0x40,reg)
-#else
-#error unknown isa configuration
-#endif
 #define PSW(reg)		@(0x4C,reg)
 #define BPC(reg)		@(0x50,reg)
 #define BBPSW(reg)		@(0x54,reg)
--- linux-2.6.19.orig/include/asm-m32r/ptrace.h
+++ linux-2.6.19/include/asm-m32r/ptrace.h
@@ -33,21 +33,10 @@
 #define PT_R15		PT_SP
 
 /* processor status and miscellaneous context registers.  */
-#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
 #define PT_ACC0H	15
 #define PT_ACC0L	16
-#define PT_ACC1H	17
-#define PT_ACC1L	18
-#define PT_ACCH		PT_ACC0H
-#define PT_ACCL		PT_ACC0L
-#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
-#define PT_ACCH		15
-#define PT_ACCL		16
-#define PT_DUMMY_ACC1H	17
-#define PT_DUMMY_ACC1L	18
-#else
-#error unknown isa conifiguration
-#endif
+#define PT_ACC1H	17	/* ISA_DSP_LEVEL2 only */
+#define PT_ACC1L	18	/* ISA_DSP_LEVEL2 only */
 #define PT_PSW		19
 #define PT_BPC		20
 #define PT_BBPSW	21
@@ -103,19 +92,10 @@ struct pt_regs {
 	long syscall_nr;
 
 	/* Saved main processor status and miscellaneous context registers. */
-#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
 	unsigned long acc0h;
 	unsigned long acc0l;
-	unsigned long acc1h;
-	unsigned long acc1l;
-#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
-	unsigned long acch;
-	unsigned long accl;
-	unsigned long dummy_acc1h;
-	unsigned long dummy_acc1l;
-#else
-#error unknown isa configuration
-#endif
+	unsigned long acc1h;	/* ISA_DSP_LEVEL2 only */
+	unsigned long acc1l;	/* ISA_DSP_LEVEL2 only */
 	unsigned long psw;
 	unsigned long bpc;		/* saved PC for TRAP syscalls */
 	unsigned long bbpsw;
--- linux-2.6.19.orig/include/asm-m32r/sigcontext.h
+++ linux-2.6.19/include/asm-m32r/sigcontext.h
@@ -23,19 +23,10 @@ struct sigcontext {
 	unsigned long sc_r12;
 
 	/* Saved main processor status and miscellaneous context registers. */
-#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
 	unsigned long sc_acc0h;
 	unsigned long sc_acc0l;
-	unsigned long sc_acc1h;
-	unsigned long sc_acc1l;
-#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
-	unsigned long sc_acch;
-	unsigned long sc_accl;
-	unsigned long sc_dummy_acc1h;
-	unsigned long sc_dummy_acc1l;
-#else
-#error unknown isa configuration
-#endif
+	unsigned long sc_acc1h;	/* ISA_DSP_LEVEL2 only */
+	unsigned long sc_acc1l;	/* ISA_DSP_LEVEL2 only */
 	unsigned long sc_psw;
 	unsigned long sc_bpc;		/* saved PC for TRAP syscalls */
 	unsigned long sc_bbpsw;

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 31/32] x86_64: fix boot hang due to nmi watchdog init code
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (29 preceding siblings ...)
  2006-12-08 23:58 ` [patch 30/32] m32r: make userspace headers platform-independent Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-11 18:33   ` [stable] " Chris Wright
  2006-12-08 23:58 ` [patch 32/32] forcedeth: Disable INTx when enabling MSI in forcedeth Chris Wright
                   ` (3 subsequent siblings)
  34 siblings, 1 reply; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable, ak
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, shai, kiran

[-- Attachment #1: x86_64-fix-boot-hang-due-to-nmi-watchdog-init-code.patch --]
[-- Type: text/plain, Size: 1794 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Ravikiran G Thirumalai <kiran@scalex86.org>

2.6.19 stopped booting (or booted based on build/config) on our x86_64
systems due to a bug introduced in 2.6.19.  check_nmi_watchdog schedules an
IPI on all cpus to busy wait on a flag, but fails to set the busywait flag
if NMI functionality is disabled.

This causes the secondary cpus to spin in an endless loop, causing the
kernel bootup to hang.

Depending upon the build, the busywait flag got overwritten (stack
variable) and caused the kernel to bootup on certain builds.  Following
patch fixes the bug by setting the busywait flag before returning from
check_nmi_watchdog.

I guess using a stack variable is not good here as the calling function
could potentially return while the busy wait loop is still spinning on the
flag.  I would think this is a good candidate for 2.6.19 stable as well.

[akpm@osdl.org: cleanups]
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Cc: Andi Kleen <ak@muc.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

 arch/x86_64/kernel/nmi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.19.orig/arch/x86_64/kernel/nmi.c
+++ linux-2.6.19/arch/x86_64/kernel/nmi.c
@@ -212,7 +212,7 @@ static __init void nmi_cpu_busy(void *da
 
 int __init check_nmi_watchdog (void)
 {
-	volatile int endflag = 0;
+	static int __initdata endflag;
 	int *counts;
 	int cpu;
 
@@ -253,6 +253,7 @@ int __init check_nmi_watchdog (void)
 	if (!atomic_read(&nmi_active)) {
 		kfree(counts);
 		atomic_set(&nmi_active, -1);
+		endflag = 1;
 		return -1;
 	}
 	endflag = 1;

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 32/32] forcedeth: Disable INTx when enabling MSI in forcedeth
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (30 preceding siblings ...)
  2006-12-08 23:58 ` [patch 31/32] x86_64: fix boot hang due to nmi watchdog init code Chris Wright
@ 2006-12-08 23:58 ` Chris Wright
  2006-12-09  0:38 ` [stable] [patch 00/32] -stable review Chris Wright
                   ` (2 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-08 23:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky,
	torvalds, akpm, alan, Daniel Barkalow, Greg KH, Jeff Garzik

[-- Attachment #1: forcedeth-disable-intx-when-enabling-msi-in-forcedeth.patch --]
[-- Type: text/plain, Size: 2286 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Daniel Barkalow <barkalow@iabervon.org>

At least some nforce cards continue to send legacy interrupts when MSI
is enabled, and these interrupts are treated as unhandled by the
kernel. This patch disables legacy interrupts explicitly when enabling
MSI mode.

The correct fix is to change the MSI infrastructure to disable legacy
interrupts when enabling MSI, but this is potentially risky if the
device isn't PCI-2.3 or is quirky, so the correct fix is going into
mainline, while patches like this one go into -stable.

Legend has it that it is most correct to disable legacy interrupts
before enabling MSI, but the mainline patch does it in the other
order, and this patch is "obviously" the same as mainline.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Greg KH <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---

The general patch got into mainline last night, and this patch is clearly 
the same as that one, limited to the case of forcedeth (the pci_intx() 
calls are lifted from {enable,disable}_msi_mode to all of the indirect 
callers in forcedeth).

 drivers/net/forcedeth.c |    3 +++
 1 file changed, 3 insertions(+)

--- linux-2.6.19.orig/drivers/net/forcedeth.c
+++ linux-2.6.19/drivers/net/forcedeth.c
@@ -2815,11 +2815,13 @@ static int nv_request_irq(struct net_dev
 	}
 	if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
 		if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
+			pci_intx(np->pci_dev, 0);
 			np->msi_flags |= NV_MSI_ENABLED;
 			if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) ||
 			    (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0)) {
 				printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
 				pci_disable_msi(np->pci_dev);
+				pci_intx(np->pci_dev, 1);
 				np->msi_flags &= ~NV_MSI_ENABLED;
 				goto out_err;
 			}
@@ -2862,6 +2864,7 @@ static void nv_free_irq(struct net_devic
 		free_irq(np->pci_dev->irq, dev);
 		if (np->msi_flags & NV_MSI_ENABLED) {
 			pci_disable_msi(np->pci_dev);
+			pci_intx(np->pci_dev, 1);
 			np->msi_flags &= ~NV_MSI_ENABLED;
 		}
 	}

--

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [stable] [patch 00/32] -stable review
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (31 preceding siblings ...)
  2006-12-08 23:58 ` [patch 32/32] forcedeth: Disable INTx when enabling MSI in forcedeth Chris Wright
@ 2006-12-09  0:38 ` Chris Wright
  2006-12-09  1:36 ` [patch 33/32] NETLINK: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace Chris Wright
  2006-12-09 11:26 ` [patch 00/32] -stable review Stefan Lippers-Hollmann
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-09  0:38 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: akpm, Theodore Ts'o, Zwane Mwaikambo, Justin Forbes, torvalds,
	Chris Wedgwood, Randy Dunlap, Michael Krufky, Dave Jones,
	Chuck Wolber, alan

And a roll-up is available at:

	http://www.kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc1.{gz,bz2}

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [patch 33/32] NETLINK: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace.
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (32 preceding siblings ...)
  2006-12-09  0:38 ` [stable] [patch 00/32] -stable review Chris Wright
@ 2006-12-09  1:36 ` Chris Wright
  2006-12-09 11:26 ` [patch 00/32] -stable review Stefan Lippers-Hollmann
  34 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-09  1:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: akpm, Theodore Ts'o, Zwane Mwaikambo, Justin Forbes, torvalds,
	Chris Wedgwood, Randy Dunlap, Michael Krufky, Dave Jones,
	Chuck Wolber, alan, davem

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: David Miller <davem@davemloft.net>

NETLINK: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace.

GLIBC uses them etc.

They are guarded by ifndef __KERNEL__ so nobody will start
accidently using them in the kernel again, it's just for
userspace.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit c0279128f20aa3580b0b43aaa49f351f6bad5f30
Author: David S. Miller <davem@sunset.davemloft.net>
Date:   Fri Dec 8 17:05:13 2006 -0800

 include/linux/if_addr.h |    6 ++++++
 include/linux/if_link.h |    6 ++++++
 2 files changed, 12 insertions(+)

--- linux-2.6.19.orig/include/linux/if_addr.h
+++ linux-2.6.19/include/linux/if_addr.h
@@ -52,4 +52,10 @@ struct ifa_cacheinfo
 	__u32	tstamp; /* updated timestamp, hundredths of seconds */
 };
 
+/* backwards compatibility for userspace */
+#ifndef __KERNEL__
+#define IFA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+#endif
+
 #endif
--- linux-2.6.19.orig/include/linux/if_link.h
+++ linux-2.6.19/include/linux/if_link.h
@@ -82,6 +82,12 @@ enum
 
 #define IFLA_MAX (__IFLA_MAX - 1)
 
+/* backwards compatibility for userspace */
+#ifndef __KERNEL__
+#define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+#endif
+
 /* ifi_flags.
 
    IFF_* flags.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [patch 28/32] autofs: fix error code path in autofs_fill_sb()
  2006-12-08 23:58 ` [patch 28/32] autofs: fix error code path in autofs_fill_sb() Chris Wright
@ 2006-12-09  3:48   ` Ian Kent
  2006-12-09 18:58     ` Chris Wright
  0 siblings, 1 reply; 43+ messages in thread
From: Ian Kent @ 2006-12-09  3:48 UTC (permalink / raw)
  To: Chris Wright
  Cc: linux-kernel, stable, torvalds, Justin Forbes, Zwane Mwaikambo,
	Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
	Chris Wedgwood, Michael Krufky, akpm, alan, jkosina

On Fri, 2006-12-08 at 15:58 -0800, Chris Wright wrote:
> plain text document attachment
> (autofs-fix-error-code-path-in-autofs_fill_sb.patch)
> -stable review patch.  If anyone has any objections, please let us know.
> ------------------

Stable review of what (version)?

> 
> From: Jiri Kosina <jkosina@suse.cz>
> 
> When kernel is compiled with old version of autofs (CONFIG_AUTOFS_FS), and
> new (observed at least with 5.x.x) automount deamon is started, kernel
> correctly reports incompatible version of kernel and userland daemon, but
> then screws things up instead of correct handling of the error:

No objections.
I'm sure I tested this case when I did the original patch that has the
error which this patch fixes.

The bug is clearly present and needs fixing.

> 
>  autofs: kernel does not match daemon version
>  =====================================
>  [ BUG: bad unlock balance detected! ]
>  -------------------------------------
>  automount/4199 is trying to release lock (&type->s_umount_key) at:
>  [<c0163b9e>] get_sb_nodev+0x76/0xa4
>  but there are no more locks to release!
> 
>  other info that might help us debug this:
>  no locks held by automount/4199.
> 
>  stack backtrace:
>   [<c0103b15>] dump_trace+0x68/0x1b2
>   [<c0103c77>] show_trace_log_lvl+0x18/0x2c
>   [<c01041db>] show_trace+0xf/0x11
>   [<c010424d>] dump_stack+0x12/0x14
>   [<c012e02c>] print_unlock_inbalance_bug+0xe7/0xf3
>   [<c012fd4f>] lock_release+0x8d/0x164
>   [<c012b452>] up_write+0x14/0x27
>   [<c0163b9e>] get_sb_nodev+0x76/0xa4
>   [<c0163689>] vfs_kern_mount+0x83/0xf6
>   [<c016373e>] do_kern_mount+0x2d/0x3e
>   [<c017513f>] do_mount+0x607/0x67a
>   [<c0175224>] sys_mount+0x72/0xa4
>   [<c0102b96>] sysenter_past_esp+0x5f/0x99
>  DWARF2 unwinder stuck at sysenter_past_esp+0x5f/0x99
>  Leftover inexact backtrace:
>   =======================
> 
> and then deadlock comes.
> 
> The problem: autofs_fill_super() returns EINVAL to get_sb_nodev(), but
> before that, it calls kill_anon_super() to destroy the superblock which
> won't be needed.  This is however way too soon to call kill_anon_super(),
> because get_sb_nodev() has to perform its own cleanup of the superblock
> first (deactivate_super(), etc.).  The correct time to call
> kill_anon_super() is in the autofs_kill_sb() callback, which is called by
> deactivate_super() at proper time, when the superblock is ready to be
> killed.
> 
> I can see the same faulty codepath also in autofs4.  This patch solves
> issues in both filesystems in a same way - it postpones the
> kill_anon_super() until the proper time is signalized by deactivate_super()
> calling the kill_sb() callback.
> 
> [raven@themaw.net: update comment]
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> Acked-by: Ian Kent <raven@themaw.net>
> Cc: <stable@kernel.org>
> Signed-off-by: Ian Kent <raven@themaw.net>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
> 
>  fs/autofs/inode.c  |    7 ++++---
>  fs/autofs4/inode.c |    7 ++++---
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> --- linux-2.6.19.orig/fs/autofs/inode.c
> +++ linux-2.6.19/fs/autofs/inode.c
> @@ -28,10 +28,11 @@ void autofs_kill_sb(struct super_block *
>  	/*
>  	 * In the event of a failure in get_sb_nodev the superblock
>  	 * info is not present so nothing else has been setup, so
> -	 * just exit when we are called from deactivate_super.
> +	 * just call kill_anon_super when we are called from
> +	 * deactivate_super.
>  	 */
>  	if (!sbi)
> -		return;
> +		goto out_kill_sb;
>  
>  	if ( !sbi->catatonic )
>  		autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */
> @@ -44,6 +45,7 @@ void autofs_kill_sb(struct super_block *
>  
>  	kfree(sb->s_fs_info);
>  
> +out_kill_sb:
>  	DPRINTK(("autofs: shutting down\n"));
>  	kill_anon_super(sb);
>  }
> @@ -209,7 +211,6 @@ fail_iput:
>  fail_free:
>  	kfree(sbi);
>  	s->s_fs_info = NULL;
> -	kill_anon_super(s);
>  fail_unlock:
>  	return -EINVAL;
>  }
> --- linux-2.6.19.orig/fs/autofs4/inode.c
> +++ linux-2.6.19/fs/autofs4/inode.c
> @@ -152,10 +152,11 @@ void autofs4_kill_sb(struct super_block 
>  	/*
>  	 * In the event of a failure in get_sb_nodev the superblock
>  	 * info is not present so nothing else has been setup, so
> -	 * just exit when we are called from deactivate_super.
> +	 * just call kill_anon_super when we are called from
> +	 * deactivate_super.
>  	 */
>  	if (!sbi)
> -		return;
> +		goto out_kill_sb;
>  
>  	sb->s_fs_info = NULL;
>  
> @@ -167,6 +168,7 @@ void autofs4_kill_sb(struct super_block 
>  
>  	kfree(sbi);
>  
> +out_kill_sb:
>  	DPRINTK("shutting down");
>  	kill_anon_super(sb);
>  }
> @@ -426,7 +428,6 @@ fail_ino:
>  fail_free:
>  	kfree(sbi);
>  	s->s_fs_info = NULL;
> -	kill_anon_super(s);
>  fail_unlock:
>  	return -EINVAL;
>  }
> 
> --
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [patch 08/32] cryptoloop: Select CRYPTO_CBC
  2006-12-08 23:57 ` [patch 08/32] cryptoloop: Select CRYPTO_CBC Chris Wright
@ 2006-12-09  6:32   ` Rene Herman
  2006-12-09 22:50     ` Herbert Xu
  0 siblings, 1 reply; 43+ messages in thread
From: Rene Herman @ 2006-12-09  6:32 UTC (permalink / raw)
  To: Chris Wright
  Cc: linux-kernel, stable, Justin Forbes, Zwane Mwaikambo,
	Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber,
	Chris Wedgwood, Michael Krufky, torvalds, akpm, alan, Herbert Xu

Chris Wright wrote:

> -stable review patch.  If anyone has any objections, please let us know.
> ------------------
> 
> From: Herbert Xu <herbert@gondor.apana.org.au>
> 
> As CBC is the default chaining method for cryptoloop, we should select
> it from cryptoloop to ease the transition.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
>  drivers/block/Kconfig |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- linux-2.6.19.orig/drivers/block/Kconfig
> +++ linux-2.6.19/drivers/block/Kconfig
> @@ -305,6 +305,7 @@ config BLK_DEV_LOOP
>  config BLK_DEV_CRYPTOLOOP
>  	tristate "Cryptoloop Support"
>  	select CRYPTO
> +	select CRYPTO_CBC
>  	depends on BLK_DEV_LOOP
>  	---help---
>  	  Say Y here if you want to be able to use the ciphers that are 
> 

dm-crypt needs CBC in the same manner -- normal (via howto) use of 
cryptsetup doesn't work otherwise, same as with cryptoloop.

Rene.


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [patch 00/32] -stable review
  2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
                   ` (33 preceding siblings ...)
  2006-12-09  1:36 ` [patch 33/32] NETLINK: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace Chris Wright
@ 2006-12-09 11:26 ` Stefan Lippers-Hollmann
  2006-12-09 21:42   ` Chris Wright
  34 siblings, 1 reply; 43+ messages in thread
From: Stefan Lippers-Hollmann @ 2006-12-09 11:26 UTC (permalink / raw)
  To: stable; +Cc: Chris Wright, linux-kernel

Hi

On Saturday 09 December 2006 00:57, you wrote:
> This is the start of the stable review cycle for the 2.6.19.1 release.
> There are 32 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let us know.  If anyone is a maintainer of the proper subsystem, and
> wants to add a Signed-off-by: line to the patch, please respond with it.

At least
http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc1.gz
and
http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc2.gz
seem to contain an incompletely applied "[patch 24/32] add bottom_half.h",
bottom_half.h itself is missing, while interrupt.h and spinlock.h are changed 
to use the missing file:

$ wget -qO- http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc2.gz | gzip -dc | grep bottom_half
+#include <linux/bottom_half.h>
+#include <linux/bottom_half.h>
$ wget -qO- http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc1.gz | gzip -dc | grep bottom_half
+#include <linux/bottom_half.h>
+#include <linux/bottom_half.h>

> These patches are sent out with a number of different people on the
> Cc: line.  If you wish to be a reviewer, please email stable@kernel.org
> to add your name to the list.  If you want to be off the reviewer list,
> also email us.
>
> Responses should be made by Mon Dec 11 00:00 UTC Anything received after
> that time might be too late.
>
> thanks,
>
> the -stable release team

Thanks a lot for the -stable rc patches
	Stefan Lippers-Hollmann

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [patch 24/32] add bottom_half.h
  2006-12-08 23:58 ` [patch 24/32] add bottom_half.h Chris Wright
@ 2006-12-09 13:50   ` Thomas Backlund
  0 siblings, 0 replies; 43+ messages in thread
From: Thomas Backlund @ 2006-12-09 13:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm,
	alan, mingo, ak

Chris Wright wrote:
> -stable review patch.  If anyone has any objections, please let us know.
> ------------------
> 
> From: Andrew Morton <akpm@osdl.org>
> 
> With CONFIG_SMP=n:
> 
> drivers/input/ff-memless.c:384: warning: implicit declaration of function 'local_bh_disable'
> drivers/input/ff-memless.c:393: warning: implicit declaration of function 'local_bh_enable'
> 
> Really linux/spinlock.h should include linux/interrupt.h.  But interrupt.h
> includes sched.h which will need spinlock.h.
> 
> So the patch breaks the _bh declarations out into a separate header and
> includes it in bothj interrupt.h and spinlock.h.
> 
> Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
> Cc: Andi Kleen <ak@suse.de>
> Cc: <stable@kernel.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
> 
>  include/linux/bottom_half.h |    5 +++++

This file is missing in patch-2.6.19.1-rc[1,2].bz2

--
Thomas


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [patch 28/32] autofs: fix error code path in autofs_fill_sb()
  2006-12-09  3:48   ` Ian Kent
@ 2006-12-09 18:58     ` Chris Wright
  0 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-09 18:58 UTC (permalink / raw)
  To: Ian Kent
  Cc: Chris Wright, linux-kernel, stable, torvalds, Justin Forbes,
	Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones,
	Chuck Wolber, Chris Wedgwood, Michael Krufky, akpm, alan, jkosina

* Ian Kent (raven@themaw.net) wrote:
> On Fri, 2006-12-08 at 15:58 -0800, Chris Wright wrote:
> > plain text document attachment
> > (autofs-fix-error-code-path-in-autofs_fill_sb.patch)
> > -stable review patch.  If anyone has any objections, please let us know.
> > ------------------
> 
> Stable review of what (version)?

This is for 2.6.19

thanks,
-chris

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [patch 00/32] -stable review
  2006-12-09 11:26 ` [patch 00/32] -stable review Stefan Lippers-Hollmann
@ 2006-12-09 21:42   ` Chris Wright
  0 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-09 21:42 UTC (permalink / raw)
  To: Stefan Lippers-Hollmann
  Cc: stable, Chris Wright, Thomas Backlund, linux-kernel

* Stefan Lippers-Hollmann (s.L-H@gmx.de) wrote:
> At least
> http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc1.gz
> and
> http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc2.gz
> seem to contain an incompletely applied "[patch 24/32] add bottom_half.h",
> bottom_half.h itself is missing, while interrupt.h and spinlock.h are changed 
> to use the missing file:
> 
> $ wget -qO- http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc2.gz | gzip -dc | grep bottom_half
> +#include <linux/bottom_half.h>
> +#include <linux/bottom_half.h>
> $ wget -qO- http://kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.1-rc1.gz | gzip -dc | grep bottom_half
> +#include <linux/bottom_half.h>
> +#include <linux/bottom_half.h>

Sorry about that, I regenerated and made sure I picked up new files.
I've pushed up an rc3 (mirroring is a bit slow).

thanks,
-chris

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [patch 08/32] cryptoloop: Select CRYPTO_CBC
  2006-12-09  6:32   ` Rene Herman
@ 2006-12-09 22:50     ` Herbert Xu
  0 siblings, 0 replies; 43+ messages in thread
From: Herbert Xu @ 2006-12-09 22:50 UTC (permalink / raw)
  To: Rene Herman; +Cc: linux-kernel, stable, torvalds, David S. Miller

On Sat, Dec 09, 2006 at 07:32:02AM +0100, Rene Herman wrote:
> 
> dm-crypt needs CBC in the same manner -- normal (via howto) use of 
> cryptsetup doesn't work otherwise, same as with cryptoloop.

Good point.  Here's the patch for 2.6.19 and 2.6.20.

[CRYPTO] dm-crypt: Select CRYPTO_CBC

As CBC is the default chaining method for cryptoloop, we should select
it from cryptoloop to ease the transition.  Spotted by Rene Herman.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
7cd650c7e042e3c201fb3c401780c909d44b0e5d
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
index c92c152..4540ade 100644
--- a/drivers/md/Kconfig
+++ b/drivers/md/Kconfig
@@ -215,6 +215,7 @@ config DM_CRYPT
 	tristate "Crypt target support"
 	depends on BLK_DEV_DM && EXPERIMENTAL
 	select CRYPTO
+	select CRYPTO_CBC
 	---help---
 	  This device-mapper target allows you to create a device that
 	  transparently encrypts the data on it. You'll need to activate

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* Re: [stable] [patch 31/32] x86_64: fix boot hang due to nmi watchdog init code
  2006-12-08 23:58 ` [patch 31/32] x86_64: fix boot hang due to nmi watchdog init code Chris Wright
@ 2006-12-11 18:33   ` Chris Wright
  0 siblings, 0 replies; 43+ messages in thread
From: Chris Wright @ 2006-12-11 18:33 UTC (permalink / raw)
  To: linux-kernel, stable, ak
  Cc: akpm, Theodore Ts'o, Zwane Mwaikambo, Justin Forbes, torvalds,
	Chris Wedgwood, shai, Randy Dunlap, Michael Krufky, Dave Jones,
	Chuck Wolber, alan, kiran

* Chris Wright (chrisw@sous-sol.org) wrote:
> -stable review patch.  If anyone has any objections, please let us know.
> ------------------

replaced with upstream version, which is slightly changed by Andi.
--

From: Ravikiran G Thirumalai <kiran@scalex86.org>

2.6.19  stopped booting (or booted based on build/config) on our x86_64
systems due to a bug introduced in 2.6.19.  check_nmi_watchdog schedules an
IPI on all cpus to  busy wait on a flag, but fails to set the busywait
flag if NMI functionality is disabled.  This causes the secondary cpus
to spin in an endless loop, causing the kernel bootup to hang.
Depending upon the build, the  busywait flag got overwritten (stack variable)
and caused  the kernel to bootup on certain builds.  Following patch fixes
the bug by setting the busywait flag before returning from check_nmi_watchdog.
I guess using a stack variable is not good here as the calling function could
potentially return while the busy wait loop is still spinning on the flag.

AK: I redid the patch significantly to be cleaner

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 arch/i386/kernel/nmi.c   |    8 ++++----
 arch/x86_64/kernel/nmi.c |    9 +++++----
 2 files changed, 9 insertions(+), 8 deletions(-)

--- linux-2.6.19.orig/arch/i386/kernel/nmi.c
+++ linux-2.6.19/arch/i386/kernel/nmi.c
@@ -192,6 +192,8 @@ static __cpuinit inline int nmi_known_cp
 	return 0;
 }
 
+static int endflag __initdata = 0;
+
 #ifdef CONFIG_SMP
 /* The performance counters used by NMI_LOCAL_APIC don't trigger when
  * the CPU is idle. To make sure the NMI watchdog really ticks on all
@@ -199,7 +201,6 @@ static __cpuinit inline int nmi_known_cp
  */
 static __init void nmi_cpu_busy(void *data)
 {
-	volatile int *endflag = data;
 	local_irq_enable_in_hardirq();
 	/* Intentionally don't use cpu_relax here. This is
 	   to make sure that the performance counter really ticks,
@@ -207,14 +208,13 @@ static __init void nmi_cpu_busy(void *da
 	   pause instruction. On a real HT machine this is fine because
 	   all other CPUs are busy with "useless" delay loops and don't
 	   care if they get somewhat less cycles. */
-	while (*endflag == 0)
-		barrier();
+	while (endflag == 0)
+		mb();
 }
 #endif
 
 static int __init check_nmi_watchdog(void)
 {
-	volatile int endflag = 0;
 	unsigned int *prev_nmi_count;
 	int cpu;
 
--- linux-2.6.19.orig/arch/x86_64/kernel/nmi.c
+++ linux-2.6.19/arch/x86_64/kernel/nmi.c
@@ -190,6 +190,8 @@ void nmi_watchdog_default(void)
 		nmi_watchdog = NMI_IO_APIC;
 }
 
+static int endflag __initdata = 0;
+
 #ifdef CONFIG_SMP
 /* The performance counters used by NMI_LOCAL_APIC don't trigger when
  * the CPU is idle. To make sure the NMI watchdog really ticks on all
@@ -197,7 +199,6 @@ void nmi_watchdog_default(void)
  */
 static __init void nmi_cpu_busy(void *data)
 {
-	volatile int *endflag = data;
 	local_irq_enable_in_hardirq();
 	/* Intentionally don't use cpu_relax here. This is
 	   to make sure that the performance counter really ticks,
@@ -205,14 +206,13 @@ static __init void nmi_cpu_busy(void *da
 	   pause instruction. On a real HT machine this is fine because
 	   all other CPUs are busy with "useless" delay loops and don't
 	   care if they get somewhat less cycles. */
-	while (*endflag == 0)
-		barrier();
+	while (endflag == 0)
+		mb();
 }
 #endif
 
 int __init check_nmi_watchdog (void)
 {
-	volatile int endflag = 0;
 	int *counts;
 	int cpu;
 
@@ -253,6 +253,7 @@ int __init check_nmi_watchdog (void)
 	if (!atomic_read(&nmi_active)) {
 		kfree(counts);
 		atomic_set(&nmi_active, -1);
+		endflag = 1;
 		return -1;
 	}
 	endflag = 1;

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2006-12-11 18:33 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-08 23:57 [patch 00/32] -stable review Chris Wright
2006-12-08 23:57 ` [patch 01/32] IPV6 NDISC: Calculate packet length correctly for allocation Chris Wright
2006-12-08 23:57 ` [patch 02/32] softmac: remove netif_tx_disable when scanning Chris Wright
2006-12-08 23:57 ` [patch 03/32] EBTABLES: Fix wraparounds in ebt_entries verification Chris Wright
2006-12-08 23:57 ` [patch 04/32] EBTABLES: Verify that ebt_entries have zero ->distinguisher Chris Wright
2006-12-08 23:57 ` [patch 05/32] EBTABLES: Deal with the worst-case behaviour in loop checks Chris Wright
2006-12-08 23:57 ` [patch 06/32] EBTABLES: Prevent wraparounds in checks for entry components sizes Chris Wright
2006-12-08 23:57 ` [patch 07/32] NET_SCHED: policer: restore compatibility with old iproute binaries Chris Wright
2006-12-08 23:57 ` [patch 08/32] cryptoloop: Select CRYPTO_CBC Chris Wright
2006-12-09  6:32   ` Rene Herman
2006-12-09 22:50     ` Herbert Xu
2006-12-08 23:58 ` [patch 09/32] Revert "ACPI: SCI interrupt source override" Chris Wright
2006-12-08 23:58 ` [patch 10/32] PKT_SCHED act_gact: division by zero Chris Wright
2006-12-08 23:58 ` [patch 11/32] SUNHME: Fix for sunhme failures on x86 Chris Wright
2006-12-08 23:58 ` [patch 12/32] NETFILTER: Fix {ip, ip6, arp}_tables hook validation Chris Wright
2006-12-08 23:58 ` [patch 13/32] NETFILTER: Fix iptables compat " Chris Wright
2006-12-08 23:58 ` [patch 14/32] NETFILTER: bridge netfilter: deal with martians correctly Chris Wright
2006-12-08 23:58 ` [patch 15/32] softmac: fix unbalanced mutex_lock/unlock in ieee80211softmac_wx_set_mlme Chris Wright
2006-12-08 23:58 ` [patch 16/32] IB/ucm: Fix deadlock in cleanup Chris Wright
2006-12-08 23:58 ` [patch 17/32] do_coredump() and not stopping rewrite attacks? (CVE-2006-6304) Chris Wright
2006-12-08 23:58 ` [patch 18/32] TOKENRING: Remote memory corruptor in ibmtr.c Chris Wright
2006-12-08 23:58 ` [patch 19/32] XFRM: Use output device disable_xfrm for forwarded packets Chris Wright
2006-12-08 23:58 ` [patch 20/32] USB: Fix oops in PhidgetServo Chris Wright
2006-12-08 23:58 ` [patch 21/32] IPSEC: Fix inetpeer leak in ipv4 xfrm dst entries Chris Wright
2006-12-08 23:58 ` [patch 22/32] IrDA: Incorrect TTP header reservation Chris Wright
2006-12-08 23:58 ` [patch 23/32] NETLINK: Restore API compatibility of address and neighbour bits Chris Wright
2006-12-08 23:58 ` [patch 24/32] add bottom_half.h Chris Wright
2006-12-09 13:50   ` Thomas Backlund
2006-12-08 23:58 ` [patch 25/32] drm-sis linkage fix Chris Wright
2006-12-08 23:58 ` [patch 26/32] compat: skip data conversion in compat_sys_mount when data_page is NULL Chris Wright
2006-12-08 23:58 ` [patch 27/32] PM: Fix swsusp debug mode testproc Chris Wright
2006-12-08 23:58 ` [patch 28/32] autofs: fix error code path in autofs_fill_sb() Chris Wright
2006-12-09  3:48   ` Ian Kent
2006-12-09 18:58     ` Chris Wright
2006-12-08 23:58 ` [patch 29/32] softirq: remove BUG_ONs which can incorrectly trigger Chris Wright
2006-12-08 23:58 ` [patch 30/32] m32r: make userspace headers platform-independent Chris Wright
2006-12-08 23:58 ` [patch 31/32] x86_64: fix boot hang due to nmi watchdog init code Chris Wright
2006-12-11 18:33   ` [stable] " Chris Wright
2006-12-08 23:58 ` [patch 32/32] forcedeth: Disable INTx when enabling MSI in forcedeth Chris Wright
2006-12-09  0:38 ` [stable] [patch 00/32] -stable review Chris Wright
2006-12-09  1:36 ` [patch 33/32] NETLINK: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace Chris Wright
2006-12-09 11:26 ` [patch 00/32] -stable review Stefan Lippers-Hollmann
2006-12-09 21:42   ` Chris Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox