2.6.27.36-stable review
Subsystems (11)
PATCH 8/9 netfilter: bridge: refcount fix
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Patrick McHardy <[email protected]>
netfilter: bridge: refcount fix
Upstream commit f3abc9b9:
commit f216f082b2b37c4943f1e7c393e2786648d48f6f ([NETFILTER]: bridge netfilter: deal with martians correctly) added a refcount leak on in_dev.
Instead of using in_dev_get(), we can use __in_dev_get_rcu(), as netfilter hooks are running under rcu_read_lock(), as pointed by Patrick.
--- net/bridge/br_netfilter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_netfilter.c +1 -1
@@ -358,7 +358,7 @@ static int br_nf_pre_routing_finish(stru }, .proto = 0, }; -struct in_device *in_dev =in_dev_get (dev); +struct in_device *in_dev =__in_dev_get_rcu (dev);/* If err equals -EHOSTUNREACH the error is due to a * martian destination or due to the fact that
cover 2.6.27.36-stable review
This is the start of the stable review cycle for the 2.6.27.36 release. There are 9 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 [email protected] to add your name to the list. If you want to be off the reviewer list, also email us.
Responses should be made by Saturday, October 3, 2009 23:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.27.36-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
--------------
Makefile | 2 +- drivers/isdn/gigaset/bas-gigaset.c | 16 +++++++++------- drivers/net/enc28j60.c | 4 +++- drivers/net/pcmcia/pcnet_cs.c | 2 +- drivers/net/wireless/p54/p54usb.c | 1 + fs/inode.c | 14 ++++++++------ mm/hugetlb.c | 2 +- net/ax25/af_ax25.c | 2 +- net/bridge/br_netfilter.c | 2 +- net/packet/af_packet.c | 4 ++-- 10 files changed, 28 insertions(+), 21 deletions(-)
PATCH 2/9 p54usb: add Zcomax XG-705A usbid
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <[email protected]>
commit f7f71173ea69d4dabf166533beffa9294090b7ef upstream.
This patch adds a new usbid for Zcomax XG-705A to the device table.
--- drivers/net/wireless/p54/p54usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/p54/p54usb.c +1 -0
@@ -63,6 +63,7 @@ static struct usb_device_id p54u_table[] {USB_DEVICE(0x0bf8, 0x1009)}, /* FUJITSU E-5400 USB D1700*/ {USB_DEVICE(0x0cde, 0x0006)}, /* Medion MD40900 */ {USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */ + {USB_DEVICE(0x0cde, 0x0015)}, /* Zcomax XG-705A */ {USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */ {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ {USB_DEVICE(0x124a, 0x4025)}, /* IOGear GWU513 (GW3887IK chip) */
PATCH 4/9 pcnet_cs: Fix misuse of the equality operator.
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Cord Walter <[email protected]>
commit a9d3a146923d374b945aa388dc884df69564a818 upstream.
--- drivers/net/pcmcia/pcnet_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/pcmcia/pcnet_cs.c +1 -1
@@ -591,7 +591,7 @@ static int pcnet_config(struct pcmcia_de }if ((link->conf.ConfigBase ==0x03c0 ) - && (link->manf_id ==0x149 ) && (link->card_id =0xc1ab )) { + && (link->manf_id ==0x149 ) && (link->card_id ==0xc1ab )) {printk (KERN_INFO "pcnet_cs: this is an AX88190 card!\n" );printk (KERN_INFO "pcnet_cs: use axnet_cs instead.\n" ); goto failed;
PATCH 7/9 net: Make the copy length in af_packet sockopt handler unsigned
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Arjan van de Ven <[email protected]>
fixed upstream in commit b7058842c940ad2c08dd829b21e5c92ebe3b8758 in a different way
The length of the to-copy data structure is currently stored in a signed integer. However many comparisons are done with sizeof(..) which is unsigned. It's more suitable for this variable to be unsigned to make these comparisons more naturally right.
--- net/packet/af_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/packet/af_packet.c +2 -2
@@ -1500,7 +1500,7 @@ packet_setsockopt(struct socket *sock, istatic int packet_getsockopt (struct socket *sock,int level,int optname,char __user *optval,int __user *optlen) { -int len; +unsigned int len;int val;struct sock *sk = sock->sk;struct packet_sock *po =pkt_sk (sk);
@@ -1513,7 +1513,7 @@ static int packet_getsockopt(struct sockif (get_user (len, optlen))return -EFAULT ; -if (len <0 ) +if ((int )len <0 )return -EINVAL ;switch (optname) {
PATCH 9/9 hugetlb: restore interleaving of bootmem huge pages (2.6.31)
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lee Schermerhorn <[email protected]>
Not upstream as it is fixed differently in .32
I noticed that alloc_bootmem_huge_page() will only advance to the next node on failure to allocate a huge page. I asked about this on linux-mm and linux-numa, cc'ing the usual huge page suspects. Mel Gorman responded:
I strongly suspect that the same node being used until allocation failure instead of round-robin is an oversight and not deliberate at all. It appears to be a side-effect of a fix made way back in commit 63b4613c3f0d4b724ba259dc6c201bb68b884e1a ["hugetlb: fix hugepage allocation with memoryless nodes"]. Prior to that patch it looked like allocations would always round-robin even when allocation was successful.
Andy Whitcroft countered that the existing behavior looked like Andi Kleen's original implementation and suggested that we ask him. We did and Andy replied that his intention was to interleave the allocations. So,
...
This patch moves the advance of the hstate next node from which to allocate up before the test for success of the attempted allocation. This will unconditionally advance the next node from which to alloc, interleaving successful allocations over the nodes with sufficient contiguous memory, and skipping over nodes that fail the huge page allocation attempt.
Note that alloc_bootmem_huge_page() will only be called for huge pages of order > MAX_ORDER.
--- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb.c +1 -1
@@ -983,6 +983,7 @@ __attribute__((weak)) int alloc_bootmem_NODE_DATA (h->hugetlb_next_nid), huge_page_size(h), huge_page_size(h), 0); +hstate_next_node (h);if (addr) {/* * Use the beginning of the huge page to store the
@@ -993,7 +994,6 @@ __attribute__((weak)) int alloc_bootmem_if (m) goto found; } -hstate_next_node (h); nr_nodes--; }return 0 ;
cover 2.6.27.36-stable review
In reply to Greg KHThis is the start of the stable review cycle for the 2.6.27.36 release. There are 9 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 [email protected] to add your name to the list. If you want to be off the reviewer list, also email us.
Responses should be made by Saturday, October 3, 2009 23:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.27.36-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
--------------
Makefile | 2 +- drivers/isdn/gigaset/bas-gigaset.c | 16 +++++++++------- drivers/net/enc28j60.c | 4 +++- drivers/net/pcmcia/pcnet_cs.c | 2 +- drivers/net/wireless/p54/p54usb.c | 1 + fs/inode.c | 14 ++++++++------ mm/hugetlb.c | 2 +- net/ax25/af_ax25.c | 2 +- net/bridge/br_netfilter.c | 2 +- net/packet/af_packet.c | 4 ++-- 10 files changed, 28 insertions(+), 21 deletions(-)
PATCH 3/9 enc28j60: fix RX buffer overflow
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Baruch Siach <[email protected]>
commit 22692018b93f0782cda5a843cecfffda1854eb8d upstream.
The enc28j60 driver doesn't check whether the length of the packet as reported by the hardware fits into the preallocated buffer. When stressed, the hardware may report insanely large packets even tough the "Receive OK" bit is set. Fix this.
--- drivers/net/enc28j60.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/enc28j60.c +3 -1
@@ -919,7 +919,7 @@ static void enc28j60_hw_rx(struct net_deif (netif_msg_rx_status (priv))enc28j60_dump_rsv (priv, __FUNCTION__, next_packet, len, rxstat); -if (!RSV_GETBIT (rxstat,RSV_RXOK )) { +if (!RSV_GETBIT (rxstat,RSV_RXOK ) || len >MAX_FRAMELEN ) {if (netif_msg_rx_err (priv))dev_err (&ndev->dev,"Rx Error (%04x)\n" , rxstat); ndev->stats.rx_errors++;
@@ -927,6 +927,8 @@ static void enc28j60_hw_rx(struct net_de ndev->stats.rx_crc_errors++;if (RSV_GETBIT (rxstat,RSV_LENCHECKERR )) ndev->stats.rx_frame_errors++; +if (len >MAX_FRAMELEN ) + ndev->stats.rx_over_errors++; }else { skb =dev_alloc_skb (len +NET_IP_ALIGN );if (!skb) {
PATCH 5/9 Fix incorrect stable backport to bas_gigaset
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tilman Schmidt <[email protected]>
bas_gigaset: correctly allocate USB interrupt transfer buffer
[ Upstream commit 170ebf85160dd128e1c4206cc197cce7d1424705 ]
This incorrect backport to 2.6.28.10 placed some code into the probe function which used a pointer before it was initialized. Moving this to the correct place (as it is in upstream).
--- drivers/isdn/gigaset/bas-gigaset.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/isdn/gigaset/bas-gigaset.c +9 -7
@@ -2140,8 +2140,16 @@ static int gigaset_initcshw(struct cardsstruct bas_cardstate *ucs; cs->hw.bas = ucs =kmalloc (sizeof *ucs,GFP_KERNEL ); -if (!ucs) +if (!ucs) { +pr_err ("out of memory\n" ); +return 0 ; + } + ucs->int_in_buf =kmalloc (IP_MSGSIZE ,GFP_KERNEL ); +if (!ucs->int_in_buf) { +kfree (ucs); +pr_err ("out of memory\n" );return 0 ; + } ucs->urb_cmd_in =NULL ; ucs->urb_cmd_out =NULL ;
@@ -2236,12 +2244,6 @@ static int gigaset_probe(struct usb_inte } hostif = interface->cur_altsetting; } - ucs->int_in_buf =kmalloc (IP_MSGSIZE ,GFP_KERNEL ); -if (!ucs->int_in_buf) { -kfree (ucs); -pr_err ("out of memory\n" ); -return 0 ; - }/* Reject application specific interfaces */
PATCH 6/9 net ax25: Fix signed comparison in the sockopt handler
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Arjan van de Ven <[email protected]>
fixed upstream in commit b7058842c940ad2c08dd829b21e5c92ebe3b8758 in a different way
The ax25 code tried to use
if (optlen < sizeof(int))
return -EINVAL;
as a security check against optlen being negative (or zero) in the set socket option.
Unfortunately, "sizeof(int)" is an unsigned property, with the result that the whole comparison is done in unsigned, letting negative values slip through.
This patch changes this to
if (optlen < (int)sizeof(int))
return -EINVAL;
so that the comparison is done as signed, and negative values get properly caught.
--- net/ax25/af_ax25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ax25/af_ax25.c +1 -1
@@ -539,7 +539,7 @@ static int ax25_setsockopt(struct socketif (level !=SOL_AX25 )return -ENOPROTOOPT ; -if (optlen <sizeof (int )) +if (optlen < (int )sizeof (int ))return -EINVAL ;if (get_user (opt, (int __user *)optval))
PATCH 1/9 fs: make sure data stored into inode is properly seen before unlocking new inode
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Kara <[email protected]>
commit 580be0837a7a59b207c3d5c661d044d8dd0a6a30 upstream.
In theory it could happen that on one CPU we initialize a new inode but clearing of I_NEW | I_LOCK gets reordered before some of the initialization. Thus on another CPU we return not fully uptodate inode from iget_locked().
This seems to fix a corruption issue on ext3 mounted over NFS.
--- fs/inode.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
fs/inode.c +8 -6
@@ -590,13 +590,15 @@ void unlock_new_inode(struct inode *inod }#endif /* -* This is special! We do not need the spinlock -* when clearing I_LOCK, because we're guaranteed -* that nobody else tries to do anything about the -* state of the inode when it is locked, as we -* just created it (so there can be no old holders -* that haven't tested I_LOCK). +* This is special! We do not need the spinlock when clearing I_LOCK, +* because we're guaranteed that nobody else tries to do anything about +* the state of the inode when it is locked, as we just created it (so +* there can be no old holders that haven't tested I_LOCK). +* However we must emit the memory barrier so that other CPUs reliably +* see the clearing of I_LOCK after the other inode initialisation has +* completed. */ +smp_mb ();WARN_ON ((inode->i_state & (I_LOCK |I_NEW )) != (I_LOCK |I_NEW )); inode->i_state &= ~(I_LOCK |I_NEW );wake_up_inode (inode);
[patch 10/09] mm: fix anonymous dirtying
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hugh Dickins <[email protected]>
commit 1ac0cb5d0e22d5e483f56b2bc12172dec1cf7536 upstream.
do_anonymous_page() has been wrong to dirty the pte regardless. If it's not going to mark the pte writable, then it won't help to mark it dirty here, and clogs up memory with pages which will need swap instead of being thrown away. Especially wrong if no overcommit is chosen, and this vma is not yet VM_ACCOUNTed - we could exceed the limit and OOM despite no overcommit.
--- mm/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/memory.c +2 -1
@@ -2422,7 +2422,8 @@ static int do_anonymous_page(struct mm_s goto oom_free_page; entry =mk_pte (page, vma->vm_page_prot); - entry =maybe_mkwrite (pte_mkdirty (entry), vma); +if (vma->vm_flags &VM_WRITE ) + entry =pte_mkwrite (pte_mkdirty (entry)); page_table =pte_offset_map_lock (mm, pmd, address, &ptl);if (!pte_none (*page_table))
[patch 11/09] mmap: avoid unnecessary anon_vma lock acquisition in vma_adjust()
In reply to Greg KH2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lee Schermerhorn <[email protected]>
commit 252c5f94d944487e9f50ece7942b0fbf659c5c31 upstream.
We noticed very erratic behavior [throughput] with the AIM7 shared workload running on recent distro [SLES11] and mainline kernels on an 8-socket, 32-core, 256GB x86_64 platform. On the SLES11 kernel [2.6.27.19+] with Barcelona processors, as we increased the load [10s of thousands of tasks], the throughput would vary between two "plateaus"--one at ~65K jobs per minute and one at ~130K jpm. The simple patch below causes the results to smooth out at the ~130k plateau.
But wait, there's more:
We do not see this behavior on smaller platforms--e.g., 4 socket/8 core. This could be the result of the larger number of cpus on the larger platform--a scalability issue--or it could be the result of the larger number of interconnect "hops" between some nodes in this platform and how the tasks for a given load end up distributed over the nodes' cpus and memories--a stochastic NUMA effect.
The variability in the results are less pronounced [on the same platform] with Shanghai processors and with mainline kernels. With 31-rc6 on Shanghai processors and 288 file systems on 288 fibre attached storage volumes, the curves [jpm vs load] are both quite flat with the patched kernel consistently producing ~3.9% better throughput [~80K jpm vs ~77K jpm] than the unpatched kernel.
Profiling indicated that the "slow" runs were incurring high[er] contention on an anon_vma lock in vma_adjust(), apparently called from the sbrk() system call.
The patch:
A comment in mm/mmap.c:vma_adjust() suggests that we don't really need the anon_vma lock when we're only adjusting the end of a vma, as is the case for brk(). The comment questions whether it's worth while to optimize for this case. Apparently, on the newer, larger x86_64 platforms, with interesting NUMA topologies, it is worth while--especially considering that the patch [if correct!] is quite simple.
We can detect this condition--no overlap with next vma--by noting a NULL "importer". The anon_vma pointer will also be NULL in this case, so simply avoid loading vma->anon_vma to avoid the lock.
However, we DO need to take the anon_vma lock when we're inserting a vma ['insert' non-NULL] even when we have no overlap [NULL "importer"], so we need to check for 'insert', as well. And Hugh points out that we should also take it when adjusting vm_start (so that rmap.c can rely upon vma_address() while it holds the anon_vma lock).
akpm: Zhang Yanmin reprts a 150% throughput improvement with aim7, so it might be -stable material even though thiss isn't a regression: "this issue is not clear on dual socket Nehalem machine (2*4*2 cpu), but is severe on large machine (4*8*2 cpu)"
--- mm/mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/mmap.c +2 -2
@@ -575,9 +575,9 @@ again: remove_next = 1 + (end > next->/* * When changing only vma->vm_end, we don't really need -* anon_vma lock: but is that case worth optimizing out? +* anon_vma lock. */ -if (vma->anon_vma) +if (vma->anon_vma && (insert || importer || start != vma->vm_start)) anon_vma = vma->anon_vma;if (anon_vma) {spin_lock (&anon_vma->lock);
Quoted 3 lines · Greg KH
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.27.36-rc1.gzand the diffstat can be found below.
With the 2 new mm patches, I've now released 2.6.27.36-rc2. It can be found at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.27.36-rc2.gz
thanks,
greg k-h