summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Wiggins2016-12-21 22:57:35 +0000
committerAlex Wiggins2016-12-21 22:57:35 +0000
commit40d91e89d4bffc0e4f41a6051d041f2eb9456a0a (patch)
tree8f6b2d208faa45601f089956bd56ab1eaf1950be
parent7ba3b086987376a0689b36a120436cbc3dfa840b (diff)
downloadaur-40d91e89d4bffc0e4f41a6051d041f2eb9456a0a.tar.gz
Add patch for kernel 4.8 CONFIG_HARDENED_USERCOPY
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD11
-rw-r--r--linux-4.8-usercopy.patch44
3 files changed, 54 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5845fae4c464..e6b023fb4545 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = oss
pkgver = 4.2_2011
- pkgrel = 5
+ pkgrel = 6
url = http://developer.opensound.com/
arch = i686
arch = x86_64
@@ -10,6 +10,7 @@ pkgbase = oss
source = linux-4.0.patch::http://www.4front-tech.com/forum/download/file.php?id=164
source = gcc-5.patch
source = linux-4.6.patch
+ source = linux-4.8-usercopy.patch
source = oss.service
source = remove-hal.patch
source = rm-init-scripts.patch
@@ -20,6 +21,7 @@ pkgbase = oss
sha512sums = 504efe3af933af69e14408215a8a71d6b94d181e076f90be538f859f1d2c2ae6d2e8e49499c1e50ee3f074004e3f79c1da2b734c95cc666b98d566d404cfc7a5
sha512sums = 762a8e84d3106ae26ee50e4022c62bee551d2a46923945b291975d3c1ff7a87876ad4a94408fe1718a5dd4613d279a0f7a8820f8fcb0479ca1f210bc711ea835
sha512sums = 0186ee1d81cf6c64c4e51418434116cadcdf2a40bc4662de01ddfa1e014fe12ed7b135fc4f49e1d12113d826695047a1b64cef3c06befc56d03ec41453c77253
+ sha512sums = 02917796e664e321270fd87fc20e27f045f7c0530109b9764999102605dbef980f0a0c60726cb628151a970e62d8eddbc5d9f48a204470c1d6b441b341e87056
sha512sums = 355e1380432947c0e9caa21114b2c3debeb162fb5abcf845125ec281ce52b437ad1ee1db04d37e9b7a5ac79816c4dcbc21b4ed4cf8191f71218d99acd7bab70e
sha512sums = 6956e5e2e9323b568bb18e80bbee591b0e5ffd3d4612a50df09879941b2733c31d6b3178dc9a46c283bd1629f76b7ff5e2b54893a42a47f6379eaee4731fd9be
sha512sums = 64e6d9d8eb5320f737d3a0698a245da2b2d141b68cfb2f02e448144d1c610aa8b8a6c38b56fcca364d63171a49afe93161a00545cdb90086b5328997b3096690
diff --git a/PKGBUILD b/PKGBUILD
index cec1e7b98e39..ed0d56a013f8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,7 +11,7 @@ pkgbase=oss
pkgname=oss
true && pkgname=(oss libflashsupport-oss)
pkgver=4.2_2011
-pkgrel=5
+pkgrel=6
arch=(i686 x86_64)
url="http://developer.opensound.com/"
license=(GPL2)
@@ -20,6 +20,7 @@ source=("http://www.4front-tech.com/developer/sources/stable/gpl/oss-v${pkgver/_
linux-4.0.patch::http://www.4front-tech.com/forum/download/file.php?id=164
gcc-5.patch
linux-4.6.patch
+ linux-4.8-usercopy.patch
oss.service
remove-hal.patch
rm-init-scripts.patch
@@ -27,9 +28,10 @@ source=("http://www.4front-tech.com/developer/sources/stable/gpl/oss-v${pkgver/_
kmod-link.patch
ossvermagic.patch)
sha512sums=('2e48bf5fa14521feedb18bc3b4c96ba996c5ef9d54f00f1e39c9412152db65972438b7408cb8161e32609af2c56207251d14e1106668cde32a8f0b56a98311fb'
- '504efe3af933af69e14408215a8a71d6b94d181e076f90be538f859f1d2c2ae6d2e8e49499c1e50ee3f074004e3f79c1da2b734c95cc666b98d566d404cfc7a5'
- '762a8e84d3106ae26ee50e4022c62bee551d2a46923945b291975d3c1ff7a87876ad4a94408fe1718a5dd4613d279a0f7a8820f8fcb0479ca1f210bc711ea835'
- '0186ee1d81cf6c64c4e51418434116cadcdf2a40bc4662de01ddfa1e014fe12ed7b135fc4f49e1d12113d826695047a1b64cef3c06befc56d03ec41453c77253'
+ '504efe3af933af69e14408215a8a71d6b94d181e076f90be538f859f1d2c2ae6d2e8e49499c1e50ee3f074004e3f79c1da2b734c95cc666b98d566d404cfc7a5'
+ '762a8e84d3106ae26ee50e4022c62bee551d2a46923945b291975d3c1ff7a87876ad4a94408fe1718a5dd4613d279a0f7a8820f8fcb0479ca1f210bc711ea835'
+ '0186ee1d81cf6c64c4e51418434116cadcdf2a40bc4662de01ddfa1e014fe12ed7b135fc4f49e1d12113d826695047a1b64cef3c06befc56d03ec41453c77253'
+ '02917796e664e321270fd87fc20e27f045f7c0530109b9764999102605dbef980f0a0c60726cb628151a970e62d8eddbc5d9f48a204470c1d6b441b341e87056'
'355e1380432947c0e9caa21114b2c3debeb162fb5abcf845125ec281ce52b437ad1ee1db04d37e9b7a5ac79816c4dcbc21b4ed4cf8191f71218d99acd7bab70e'
'6956e5e2e9323b568bb18e80bbee591b0e5ffd3d4612a50df09879941b2733c31d6b3178dc9a46c283bd1629f76b7ff5e2b54893a42a47f6379eaee4731fd9be'
'64e6d9d8eb5320f737d3a0698a245da2b2d141b68cfb2f02e448144d1c610aa8b8a6c38b56fcca364d63171a49afe93161a00545cdb90086b5328997b3096690'
@@ -49,6 +51,7 @@ prepare() {
patch -p1 < "$srcdir/linux-4.0.patch"
# patch -p0 < "$srcdir/linux-3.14.0.patch"
patch -p0 < "$srcdir/linux-4.6.patch"
+ patch -p0 < "$srcdir/linux-4.8-usercopy.patch"
patch -p0 < "$srcdir/ossvermagic.patch"
# make OSS compile with gcc-5
diff --git a/linux-4.8-usercopy.patch b/linux-4.8-usercopy.patch
new file mode 100644
index 000000000000..7ff26c08914a
--- /dev/null
+++ b/linux-4.8-usercopy.patch
@@ -0,0 +1,44 @@
+--- kernel/OS/Linux/os_linux.c 2015-01-28 08:07:23.000000000 +0000
++++ kernel/OS/Linux/os_linux.c 2016-12-21 22:38:46.369612126 +0000
+@@ -640,7 +640,8 @@
+ int dev = d;
+ oss_cdev_t *cdev;
+ int err;
+- int localbuf[64]; /* 256 bytes is the largest frequently used ioctl size */
++ /* Remove localbuf (workaround for CONFIG_HARDENED_USERCOPY from kernel 4.8) */
++ /* int localbuf[64]; */ /* 256 bytes is the largest frequently used ioctl size */
+
+ int len = 0;
+ int alloced = 0;
+@@ -666,14 +667,18 @@
+ return OSS_EFAULT;
+ }
+
++ /* Always use dynamic kernel memory allocation (instead of static localbuf)
++ (workaround for CONFIG_HARDENED_USERCOPY from kernel 4.8) */
++ ptr = KERNEL_MALLOC (len);
++ alloced = 1;
+ /* Use statically allocated buffer for short arguments */
+- if (len > sizeof (localbuf))
++ /*if (len > sizeof (localbuf))
+ {
+ ptr = KERNEL_MALLOC (len);
+ alloced = 1;
+ }
+ else
+- ptr = localbuf;
++ ptr = localbuf;*/
+
+ if (ptr == NULL || arg == 0)
+ {
+@@ -710,8 +715,8 @@
+
+ /* Free the local buffer unless it was statically allocated */
+ if (ptr != NULL && alloced)
+- if (len > sizeof (localbuf))
+- KERNEL_FREE (ptr);
++// if (len > sizeof (localbuf))
++ KERNEL_FREE (ptr);
+
+ return ((err < 0) ? err : 0);
+