Commit da528cb6 authored by William Pitcock's avatar William Pitcock

Revert "Revert "main/linux-grsec: upgrade to 2.6.37""

This reverts commit 70958f80.
parent 0c5ec393
From 6ee51b8d69833b3cd00901999c36c59fbfde24aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 10 Dec 2010 16:23:26 +0200
Subject: [PATCH] Staging: hv: fix sleeping while atomic issue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
osd_schedule_callback() is called from VmbusOnMsgDPC() which runs
in a tasklet. Avoid possible sleeping by using GFP_ATOMIC for the
memory allocation.
Seems to fix #16701.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16701
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
drivers/staging/hv/osd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c
index 8c3eb27..eb9b20d 100644
--- a/drivers/staging/hv/osd.c
+++ b/drivers/staging/hv/osd.c
@@ -214,7 +214,7 @@ int osd_schedule_callback(struct workqueue_struct *wq,
{
struct osd_callback_struct *cb;
- cb = kmalloc(sizeof(*cb), GFP_KERNEL);
+ cb = kmalloc(sizeof(*cb), GFP_ATOMIC);
if (!cb) {
printk(KERN_ERR "unable to allocate memory in osd_schedule_callback\n");
return -1;
--
1.7.1
From e4e3789c1d6d9cd30267c4395763577ceedd7015 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Thu, 18 Nov 2010 11:42:16 +0200
Subject: [PATCH] xfrm: use gre key as flow upper protocol info
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The GRE Key field is intended to be used for identifying an individual
traffic flow within a tunnel. It is useful to be able to have XFRM
policy selector matches to have different policies for different
GRE tunnels.
Backported to linux-2.6.35 from the original version at:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;
a=commitdiff_plain;h=cc9ff19da9bf76a2f70bcb80225a1c587c162e52
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
include/net/flow.h | 2 ++
include/net/xfrm.h | 6 ++++++
net/ipv4/ip_gre.c | 9 ++++++---
net/ipv4/xfrm4_policy.c | 15 +++++++++++++++
4 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/include/net/flow.h b/include/net/flow.h
index bb08692..240b7f3 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -66,6 +66,7 @@ struct flowi {
} dnports;
__be32 spi;
+ __be32 gre_key;
struct {
__u8 type;
@@ -77,6 +78,7 @@ struct flowi {
#define fl_icmp_code uli_u.icmpt.code
#define fl_ipsec_spi uli_u.spi
#define fl_mh_type uli_u.mht.type
+#define fl_gre_key uli_u.gre_key
__u32 secid; /* used by xfrm; see secid.txt */
} __attribute__((__aligned__(BITS_PER_LONG/8)));
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index fc8f36d..1a57ff9 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -805,6 +805,9 @@ __be16 xfrm_flowi_sport(struct flowi *fl)
case IPPROTO_MH:
port = htons(fl->fl_mh_type);
break;
+ case IPPROTO_GRE:
+ port = htonl(fl->fl_gre_key) >> 16;
+ break;
default:
port = 0; /*XXX*/
}
@@ -826,6 +829,9 @@ __be16 xfrm_flowi_dport(struct flowi *fl)
case IPPROTO_ICMPV6:
port = htons(fl->fl_icmp_code);
break;
+ case IPPROTO_GRE:
+ port = htonl(fl->fl_gre_key) & 0xffff;
+ break;
default:
port = 0; /*XXX*/
}
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 32618e1..d490d67 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -739,7 +739,8 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
{ .daddr = dst,
.saddr = tiph->saddr,
.tos = RT_TOS(tos) } },
- .proto = IPPROTO_GRE };
+ .proto = IPPROTO_GRE,
+ .fl_gre_key = tunnel->parms.o_key };
if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
stats->tx_carrier_errors++;
goto tx_error;
@@ -912,7 +913,8 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev)
{ .daddr = iph->daddr,
.saddr = iph->saddr,
.tos = RT_TOS(iph->tos) } },
- .proto = IPPROTO_GRE };
+ .proto = IPPROTO_GRE,
+ .fl_gre_key = tunnel->parms.o_key };
struct rtable *rt;
if (!ip_route_output_key(dev_net(dev), &rt, &fl)) {
tdev = rt->u.dst.dev;
@@ -1170,7 +1172,8 @@ static int ipgre_open(struct net_device *dev)
{ .daddr = t->parms.iph.daddr,
.saddr = t->parms.iph.saddr,
.tos = RT_TOS(t->parms.iph.tos) } },
- .proto = IPPROTO_GRE };
+ .proto = IPPROTO_GRE,
+ .fl_gre_key = t->parms.o_key };
struct rtable *rt;
if (ip_route_output_key(dev_net(dev), &rt, &fl))
return -EADDRNOTAVAIL;
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 23883a4..ef36364 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -11,6 +11,7 @@
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/inetdevice.h>
+#include <linux/if_tunnel.h>
#include <net/dst.h>
#include <net/xfrm.h>
#include <net/ip.h>
@@ -158,6 +159,20 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
}
break;
+
+ case IPPROTO_GRE:
+ if (pskb_may_pull(skb, xprth + 12 - skb->data)) {
+ __be16 *greflags = (__be16 *)xprth;
+ __be32 *gre_hdr = (__be32 *)xprth;
+
+ if (greflags[0] & GRE_KEY) {
+ if (greflags[0] & GRE_CSUM)
+ gre_hdr++;
+ fl->fl_gre_key = gre_hdr[1];
+ }
+ }
+ break;
+
default:
fl->fl_ipsec_spi = 0;
break;
--
1.7.1
From 8a0e3ea4924059a7268446177d6869e3399adbb2 Mon Sep 17 00:00:00 2001
From: Timo Teras <timo.teras@iki.fi>
Date: Mon, 12 Apr 2010 13:46:45 +0000
Subject: [PATCH 04/18] arp: flush arp cache on device change
If IFF_NOARP is changed, we must flush the arp cache.
Signed-off-by: Timo Teras <timo.teras@iki.fi>
---
net/ipv4/arp.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 4e80f33..580bfc3 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1200,6 +1200,9 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, vo
neigh_changeaddr(&arp_tbl, dev);
rt_cache_flush(dev_net(dev), 0);
break;
+ case NETDEV_CHANGE:
+ neigh_changeaddr(&arp_tbl, dev);
+ break;
default:
break;
}
--
1.7.0.2
Subject: [PATCH] staging: hv: fix netvsc sleeping while atomic
Date: Fri, 17 Dec 2010 11:40:24 +0200
Message-Id: <1292578824-14408-1-git-send-email-timo.teras@iki.fi>
X-Mailer: git-send-email 1.7.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: ClamAV using ClamSMTP
Status: O
Content-Length: 845
Lines: 29
The channel callbacks are called directly from vmbus_event_dpc
which runs in tasklet context. These callbacks need to use
GFP_ATOMIC.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16701
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
drivers/staging/hv/netvsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 8022781..3784923 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -1236,7 +1236,7 @@ static void NetVscOnChannelCallback(void *Context)
/* ASSERT(device); */
packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
- GFP_KERNEL);
+ GFP_ATOMIC);
if (!packet)
return;
buffer = packet;
--
1.7.1
......@@ -2,9 +2,9 @@
_flavor=grsec
pkgname=linux-${_flavor}
pkgver=2.6.35.10
_kernver=2.6.35
pkgrel=3
pkgver=2.6.37
_kernver=2.6.37
pkgrel=0
pkgdesc="Linux kernel with grsecurity"
url=http://grsecurity.net
depends="mkinitfs linux-firmware"
......@@ -13,17 +13,8 @@ options="!strip"
_config=${config:-kernelconfig.${CARCH}}
install=
source="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_kernver.tar.bz2
http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v${pkgver%.*}/patch-$pkgver.bz2
grsecurity-2.2.0-$pkgver-unofficial.patch
0001-xfrm-use-gre-key-as-flow-upper-protocol-info.patch
xfrm-fix-gre-key-endianess.patch
0004-arp-flush-arp-cache-on-device-change.patch
r8169-add-gro-support.patch
grsecurity-2.2.1-2.6.37-201102121148.patch
0001-Staging-hv-fix-sleeping-while-atomic-issue.patch
0004-staging-hv-fix-netvsc-sleeping-while-atomic.patch
setlocalversion.patch
kernelconfig.x86
kernelconfig.x86_64
"
......@@ -146,15 +137,7 @@ firmware() {
mv "$pkgdir"/lib/firmware "$subpkgdir"/lib/
}
md5sums="091abeb4684ce03d1d936851618687b6 linux-2.6.35.tar.bz2
0741b3219a009fdfc41c766416007fcf patch-2.6.35.10.bz2
3855791bfc2ee4fff05fc3c783a3a477 grsecurity-2.2.0-2.6.35.10-unofficial.patch
eed5bd98c0a3b976891c897763eceff5 0001-xfrm-use-gre-key-as-flow-upper-protocol-info.patch
ea7a7eb2775b71ae5ef24d029a4905bd xfrm-fix-gre-key-endianess.patch
776adeeb5272093574f8836c5037dd7d 0004-arp-flush-arp-cache-on-device-change.patch
139b39da44ecb577275be53d7d365949 r8169-add-gro-support.patch
648d8b477248f233c318a3b7a961febf 0001-Staging-hv-fix-sleeping-while-atomic-issue.patch
7cae2d1e1947fa57d7aaaf31c649471c 0004-staging-hv-fix-netvsc-sleeping-while-atomic.patch
8c224ba0cdf0aa572c7eb50379435be4 setlocalversion.patch
md5sums="c8ee37b4fdccdb651e0603d35350b434 linux-2.6.37.tar.bz2
f56bdcd16fa540cddf075be6842edaaa grsecurity-2.2.1-2.6.37-201102121148.patch
b331582845fd4a702591b67eec47d687 kernelconfig.x86
1f9af7129d5b44eb3c3a60237af4ef70 kernelconfig.x86_64"
This diff is collapsed.
This diff is collapsed.
- Use napi_gro_receive() and vlan_gro_receive()
- Enable GRO by default
Tested on a RTL8111/8168 adapter
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/net/r8169.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 56a11e2..ddff42b 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1076,7 +1076,12 @@ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
int ret;
if (vlgrp && (opts2 & RxVlanTag)) {
- __vlan_hwaccel_rx(skb, vlgrp, swab16(opts2 & 0xffff), polling);
+ u16 vtag = swab16(opts2 & 0xffff);
+
+ if (polling)
+ vlan_gro_receive(&tp->napi, vlgrp, vtag, skb);
+ else
+ __vlan_hwaccel_rx(skb, vlgrp, vtag, polling);
ret = 0;
} else
ret = -1;
@@ -3186,6 +3191,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
#ifdef CONFIG_R8169_VLAN
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
#endif
+ dev->features |= NETIF_F_GRO;
tp->intr_mask = 0xffff;
tp->align = cfg->align;
@@ -4561,7 +4567,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
if (rtl8169_rx_vlan_skb(tp, desc, skb, polling) < 0) {
if (likely(polling))
- netif_receive_skb(skb);
+ napi_gro_receive(&tp->napi, skb);
else
netif_rx(skb);
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
\ No newline at end of file
--- ./scripts/setlocalversion.orig
+++ ./scripts/setlocalversion
@@ -43,7 +43,7 @@
fi
# Check for git and a git repo.
- if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
+ if [ -d "$srctree"/.git ] && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
# it, because this version is defined in the top level Makefile.
From aa285b1740f5b13e5a2606a927f3129954583d78 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Tue, 23 Nov 2010 04:03:45 +0000
Subject: [PATCH] xfrm: fix gre key endianess
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
fl->fl_gre_key is network byte order contrary to fl->fl_icmp_*.
Make xfrm_flowi_{s|d}port return network byte order values for gre
key too.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/net/xfrm.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 54b2832..7fa5b00 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -806,7 +806,7 @@ __be16 xfrm_flowi_sport(struct flowi *fl)
port = htons(fl->fl_mh_type);
break;
case IPPROTO_GRE:
- port = htonl(fl->fl_gre_key) >> 16;
+ port = htons(ntohl(fl->fl_gre_key) >> 16);
break;
default:
port = 0; /*XXX*/
@@ -830,7 +830,7 @@ __be16 xfrm_flowi_dport(struct flowi *fl)
port = htons(fl->fl_icmp_code);
break;
case IPPROTO_GRE:
- port = htonl(fl->fl_gre_key) & 0xffff;
+ port = htons(ntohl(fl->fl_gre_key) & 0xffff);
break;
default:
port = 0; /*XXX*/
--
1.7.3.2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xorg-server
pkgver=1.9.4
pkgrel=0
pkgrel=1
pkgdesc="X.Org X servers"
url="http://xorg.freedesktop.org"
arch="all"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment