core/linux-oak to 3.18.0-3

This commit is contained in:
Kevin Mihelich 2016-12-09 02:42:05 +00:00
parent 8b1844cac8
commit 4be5bacc56
11 changed files with 121 additions and 24 deletions

View file

@ -1,7 +1,8 @@
From 0a848d6d2b6985c20911d9328e7fad09a6b88668 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 10 May 2016 23:30:01 +0200
Subject: [PATCH 1/9] kbuild: move -Wunused-const-variable to W=1 warning level
Subject: [PATCH 01/10] kbuild: move -Wunused-const-variable to W=1 warning
level
gcc-6 started warning by default about variables that are not
used anywhere and that are marked 'const', generating many

View file

@ -1,7 +1,7 @@
From 6b11431f4bbb6fbc475959734b809b3805568eb1 Mon Sep 17 00:00:00 2001
From: Firo Yang <firogm@gmail.com>
Date: Thu, 11 Jun 2015 09:41:10 +0800
Subject: [PATCH 2/9] md: fix a build warning
Subject: [PATCH 02/10] md: fix a build warning
Warning like this:

View file

@ -1,7 +1,7 @@
From 4a1b921c63087b9822ede699690035bdd67d27a3 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 14 Mar 2016 15:18:36 +0100
Subject: [PATCH 3/9] ath9k: fix buffer overrun for ar9287
Subject: [PATCH 03/10] ath9k: fix buffer overrun for ar9287
Code that was added back in 2.6.38 has an obvious overflow
when accessing a static array, and at the time it was added

View file

@ -1,7 +1,8 @@
From 0d0312ba7971d1489acba061eb08c180468e4c08 Mon Sep 17 00:00:00 2001
From: David Miller <davem@davemloft.net>
Date: Tue, 7 Apr 2015 23:05:42 -0400
Subject: [PATCH 4/9] netfilter: Fix switch statement warnings with recent gcc.
Subject: [PATCH 04/10] netfilter: Fix switch statement warnings with recent
gcc.
More recent GCC warns about two kinds of switch statement uses:

View file

@ -1,8 +1,8 @@
From f9c2562565b02c6abea430003b3d338f4bda954e Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@gmail.com>
Date: Wed, 24 Dec 2014 23:04:54 +0800
Subject: [PATCH 5/9] netfilter: nfnetlink_cthelper: Remove 'const' and '&' to
avoid warnings
Subject: [PATCH 05/10] netfilter: nfnetlink_cthelper: Remove 'const' and '&'
to avoid warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

View file

@ -1,7 +1,7 @@
From c31761d2a734b0e954a0e0cfb4405f2c9b39129f Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Mon, 27 Apr 2015 13:20:34 -0400
Subject: [PATCH 6/9] netfilter; Add some missing default cases to switch
Subject: [PATCH 06/10] netfilter; Add some missing default cases to switch
statements in nft_reject.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8

View file

@ -1,7 +1,7 @@
From 615070e7e686b5b87ec2d121528049056fda0dba Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sat, 29 Oct 2016 12:04:40 -0600
Subject: [PATCH 7/9] usbtv: remove unused variable
Subject: [PATCH 07/10] usbtv: remove unused variable
Signed-off-by: Kevin Mihelich <kevin@archlinuxarm.org>
---

View file

@ -1,7 +1,7 @@
From 9c89cd2d47daeb945a2d7ca844d317b8a640de59 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Thu, 26 May 2016 06:29:07 -0600
Subject: [PATCH 8/9] add extra errata 843419 build flags
Subject: [PATCH 08/10] add extra errata 843419 build flags
---
arch/arm64/Makefile | 1 +

View file

@ -1,7 +1,7 @@
From d5962d619b422fe4b511ad2779a5ccf152052ace Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sat, 5 Nov 2016 15:28:36 -0600
Subject: [PATCH 9/9] Downgrade mmc1 speed
Subject: [PATCH 09/10] Downgrade mmc1 speed
200MHz causes errors reading the card and filesystem corruption.

View file

@ -0,0 +1,92 @@
From 0e15824efa64015c4dfd5bc6f6b3263c17df892b Mon Sep 17 00:00:00 2001
From: Philip Pettersson <philip.pettersson@gmail.com>
Date: Wed, 30 Nov 2016 14:55:36 -0800
Subject: [PATCH 10/10] packet: fix race condition in packet_set_ring
When packet_set_ring creates a ring buffer it will initialize a
struct timer_list if the packet version is TPACKET_V3. This value
can then be raced by a different thread calling setsockopt to
set the version to TPACKET_V1 before packet_set_ring has finished.
This leads to a use-after-free on a function pointer in the
struct timer_list when the socket is closed as the previously
initialized timer will not be deleted.
The bug is fixed by taking lock_sock(sk) in packet_setsockopt when
changing the packet version while also taking the lock at the start
of packet_set_ring.
Fixes: f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation.")
Signed-off-by: Philip Pettersson <philip.pettersson@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/packet/af_packet.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 463daaf..a84a444 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3273,19 +3273,25 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
if (optlen != sizeof(val))
return -EINVAL;
- if (po->rx_ring.pg_vec || po->tx_ring.pg_vec)
- return -EBUSY;
if (copy_from_user(&val, optval, sizeof(val)))
return -EFAULT;
switch (val) {
case TPACKET_V1:
case TPACKET_V2:
case TPACKET_V3:
- po->tp_version = val;
- return 0;
+ break;
default:
return -EINVAL;
}
+ lock_sock(sk);
+ if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) {
+ ret = -EBUSY;
+ } else {
+ po->tp_version = val;
+ ret = 0;
+ }
+ release_sock(sk);
+ return ret;
}
case PACKET_RESERVE:
{
@@ -3748,6 +3754,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
/* Added to avoid minimal code churn */
struct tpacket_req *req = &req_u->req;
+ lock_sock(sk);
/* Opening a Tx-ring is NOT supported in TPACKET_V3 */
if (!closing && tx_ring && (po->tp_version > TPACKET_V2)) {
WARN(1, "Tx-ring is not supported.\n");
@@ -3829,7 +3836,6 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
goto out;
}
- lock_sock(sk);
/* Detach socket from network */
spin_lock(&po->bind_lock);
@@ -3878,11 +3884,11 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
if (!tx_ring)
prb_shutdown_retire_blk_timer(po, tx_ring, rb_queue);
}
- release_sock(sk);
if (pg_vec)
free_pg_vec(pg_vec, order, req->tp_block_nr);
out:
+ release_sock(sk);
return err;
}
--
2.10.2

View file

@ -7,8 +7,8 @@ pkgbase=linux-oak
_kernelname=${pkgbase#linux}
_desc="Oak Chromebooks"
pkgver=3.18.0
pkgrel=2
_commit=faaa0586aba977987480e0fbbe62bc13769d6d75
pkgrel=3
_commit=0c37f85cfae2614d52043bc81e18ec8b0d90f2ac
arch=('aarch64')
url="https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18"
license=('GPL2')
@ -24,22 +24,24 @@ source=("https://chromium.googlesource.com/chromiumos/third_party/kernel/+archiv
'0007-usbtv-remove-unused-variable.patch'
'0008-add-extra-errata-843419-build-flags.patch'
'0009-Downgrade-mmc1-speed.patch'
'0010-packet-fix-race-condition-in-packet_set_ring.patch'
'config'
'kernel.its'
'kernel.keyblock'
'kernel_data_key.vbprivk'
'cmdline')
md5sums=('4996445ef49e80b221c8374b492660f0'
'5d12cc890e0c6bb9cc9528a438ae3f64'
'ea7c4bfbe62b0df369610d72d03a35e4'
'ca2e60b021e01c55b540795d4b9e8ea1'
'70549cd54addf2fb60f33ce68fa2cd1b'
'd9d09f62a06c0c8077a1274323aa0545'
'7a255d612fdb87c4e4dfdea8628ce3df'
'e658200d968a8d88eeac798198b888e6'
'c305d36d91e8806dce877af47f9a715b'
'd4f85f0032f193fd9254034b0207740e'
'de6011bd435696b92a07213ecdd5c8b4'
md5sums=('060d2548f591ebc92eb48280dbb96b69'
'3bcbd8becb5622468a75c7f2348d8938'
'8d35566f341fcd923b3d7e4ef92780de'
'c84aa3ed9adf76f38e6ebd0b1f2b1496'
'f348a307ddaefc27b5e968036d72ab67'
'c3e27a7320de37385f5a37b0a7954688'
'7a01e84202e480e212bbf834ecb81571'
'2d3b5be0987a8bc75cbdd3693de6c179'
'6b5247e9a9d140340c6c75915e421564'
'5d571665968468755fa16e6f576a0740'
'b87b734d28cd1b0b509d6ef11d030887'
'8b704f6a698b019c48c7483a297f9bda'
'aef13cb59516e9313cb8947350f717d6'
'61c5ff73c136ed07a7aadbf58db3d96a'
'584777ae88bce2c5659960151b64c7d8'
@ -55,6 +57,7 @@ prepare() {
git apply 0007-usbtv-remove-unused-variable.patch
git apply 0008-add-extra-errata-843419-build-flags.patch
git apply 0009-Downgrade-mmc1-speed.patch
git apply 0010-packet-fix-race-condition-in-packet_set_ring.patch
cp config .config
@ -181,7 +184,7 @@ _package-headers() {
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
for i in acpi asm-generic config crypto drm generated keys linux math-emu \
for i in acpi asm-generic clocksource config crypto drm generated keys linux math-emu \
media net pcmcia scsi sound trace uapi video xen; do
cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
done