Recreate gcc8-fix-put-user.patch without context (!87)

gcc-fix-put-user.patch doesn't apply cleanly to any kernel that
includes commit 538094 ("ARM: 8051/1: put_user: fix possible data
corruption in put_user") or a backport of it because the surrounding
lines (context) of the patch are different:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=537094b64b229bf3ad146042f83e74cf6abe59df

This commit fixes the problem by removing the context from the patch. It
also changes linux-sony-amami, linux-sony-aries, and linux-sony-taoshan
to use the shared patch.

I have confirmed that all six affected kernels still compile. [skip ci]
This commit is contained in:
Grant Miller 2018-11-30 10:51:42 -06:00 committed by Oliver Smith
parent 6e7c39bbe7
commit 242ab9ac7a
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
10 changed files with 17 additions and 91 deletions

View file

@ -31,15 +31,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 292c3f88f..48decaa00 100644
index b04850fdeb5..f8ad54b24ac 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -158,7 +158,7 @@ extern int __put_user_8(void *, unsigned long long);
#define put_user(x,p) \
({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \
@@ -162 +162 @@ extern int __put_user_8(void *, unsigned long long);
- register const typeof(*(p)) __r2 asm("r2") = (x); \
+ register typeof(*(p)) __r2 asm("r2") = (x); \
register const typeof(*(p)) __user *__p asm("r0") = (p);\
register unsigned long __l asm("r1") = __limit; \
register int __e asm("r0"); \

View file

@ -3,7 +3,7 @@
pkgname="linux-lg-mako"
pkgver=3.4.0
pkgrel=9
pkgrel=10
pkgdesc="Google Nexus 4 kernel fork"
arch="armhf"
_carch="arm"
@ -65,6 +65,6 @@ package() {
sha512sums="41d6b4446dbccf8a8b0e362ad0875341fb17b2a2e95c5be0450f419b838bd5b65de27dda5cce2d9d51c97d45884343f2ecf2a1323671926a82815ea2b5c13294 linux-lg-mako-1495bfcf93f9e0e896331f29e1850387c31d6714.tar.gz
898d5e7c3c5f5d4c8c899345a56876bc55f0d45aa8d5833bbf1571d10714712066248e2b0c9b21660e0c7491af84bee1788dc240bf40f93e2c6712039aa2e98a config-lg-mako.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
0b33408a0c024c6a9103cc1006bf1534d0146333815a91406a8ae87ce5ec09da0ec427f2c7df211ecbd0a0a59206b3757f6196b9f2d3963734acc69807a5bbf2 gcc8-fix-put-user.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
f85ced49ee2f2461adea68dac0a10452aa809a7d41d869092d94eb085344919a9a385dec0c48011f4601ca4f441700f7fe49075c7eca4fb2d66b01f7d413ccb7 01_msm-fix-perf_trace_counters.patch
7be03a9e78b7ac330a54b1f00509caa0621a95c0c55901878ad757f9dd69cc05ba2c8b5ea987063ae1224f92c4d090d515fa5d369e7755181a4871b0d0f82881 02_gpu-msm-fix-gcc5-compile.patch"

View file

@ -3,7 +3,7 @@
pkgname=linux-samsung-i9100
pkgver=3.0.101
pkgrel=12
pkgrel=13
pkgdesc="Samsung Galaxy SII kernel fork"
arch="armhf"
_carch="arm"
@ -89,5 +89,5 @@ package() {
sha512sums="285ffd2c82d0444b99da583573d19443b73de22d7382aae54413af229a28bebf4ea32ecbe248ae54ae64bbbc0af7d722b1ef86d5dd099e2990dcc6284fb195fa linux-samsung-i9100-349a3e91e76d17e67ef6213e1f6712e700695631.tar.gz
087372ce82f8eae44694d7c6288822e5565c6bbed3a07cb42a6b009fa25a84a16ec44d76fe5f504bcf945e28237e1d62cf3686d1a60126525e3fdea2613cbb3c config-samsung-i9100.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
0b33408a0c024c6a9103cc1006bf1534d0146333815a91406a8ae87ce5ec09da0ec427f2c7df211ecbd0a0a59206b3757f6196b9f2d3963734acc69807a5bbf2 gcc8-fix-put-user.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
dd4094d5f4ec281d32f12af88cb22a782e497c8e52f69cf60b73ac7d6171fc95f1f8040b3d0ad2ff3f016d22ac1d91c5b522e5d03203534a76742bc55a082af5 init"

View file

@ -3,7 +3,7 @@
pkgname="linux-sony-amami"
pkgver=3.10.84
pkgrel=3
pkgrel=4
pkgdesc="Sony Xperia Z1 Compact kernel fork"
arch="armhf"
_carch="arm"
@ -65,5 +65,5 @@ package() {
sha512sums="fae2299d9d36956be71f40ae724ac0a5069b53d440c114184f82495550c76743e9275e37ad00f6d4a012d32e91a580f424cdb1a1222647c5f2fd678a405a225f linux-sony-amami-2134cafba220b32c43701368413ee333b41b7fe0.tar.gz
0896618a3bb536dc5f8d9932fe704e8f279000207054039bf8df25e89fb9b2d7d70175cbc4af2ee42982ff7af39fd98c41ec5d79d517a36d9ac3fad5344ce615 config-sony-amami.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
00ef6044df2e904289fcbbe268c0200e94b085c374e6126b7f8ff7763285c689bafe9781dc17b85b3684d1d438f3839891925d6ca892ddb6610e68f12e3784a2 gcc8-fix-put-user.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
b921570e799682d3ac6bff5dae2c7a69da24cd6988e57605fea0bd039e8b677e8335e11846c51798a5fb15011eaf0495fe6a410833a244319140798d7b70fea1 downstream-backport-getrandom.patch"

View file

@ -1,13 +0,0 @@
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 272c4072..fad6c342 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -177,7 +177,7 @@ extern int __put_user_8(void *, unsigned long long);
({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \
const typeof(*(p)) __user *__tmp_p = (p); \
- register const typeof(*(p)) __r2 asm("r2") = (x); \
+ register typeof(*(p)) __r2 asm("r2") = (x); \
register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \
register unsigned long __l asm("r1") = __limit; \
register int __e asm("r0"); \

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch

View file

@ -3,7 +3,7 @@
pkgname="linux-sony-aries"
pkgver=3.10.84
pkgrel=8
pkgrel=9
pkgdesc="Sony Xperia Z3 Compact kernel"
arch="armhf"
_carch="arm"
@ -64,4 +64,4 @@ package() {
sha512sums="fae2299d9d36956be71f40ae724ac0a5069b53d440c114184f82495550c76743e9275e37ad00f6d4a012d32e91a580f424cdb1a1222647c5f2fd678a405a225f linux-sony-aries-2134cafba220b32c43701368413ee333b41b7fe0.tar.gz
0c453c3f74941854e98d3a4465e667e6996192b2c0e8ef69a3de5815cd26317642099bf7e85b91f200c5ba5edd70c43fb7a5982f0268fb8d31788a537914c8ef config-sony-aries.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
00ef6044df2e904289fcbbe268c0200e94b085c374e6126b7f8ff7763285c689bafe9781dc17b85b3684d1d438f3839891925d6ca892ddb6610e68f12e3784a2 gcc8-fix-put-user.patch"
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch"

View file

@ -1,13 +0,0 @@
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 272c4072..fad6c342 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -177,7 +177,7 @@ extern int __put_user_8(void *, unsigned long long);
({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \
const typeof(*(p)) __user *__tmp_p = (p); \
- register const typeof(*(p)) __r2 asm("r2") = (x); \
+ register typeof(*(p)) __r2 asm("r2") = (x); \
register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \
register unsigned long __l asm("r1") = __limit; \
register int __e asm("r0"); \

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch

View file

@ -3,7 +3,7 @@
pkgname="linux-sony-nicki"
pkgver=3.4.0
pkgrel=1
pkgrel=2
pkgdesc="Sony Xperia M kernel fork"
arch="armhf"
_carch="arm"
@ -75,4 +75,4 @@ a8c955bf718f155011e980f3d0948be98e1fee5649f418299a4851780543019daf7afa406aa7b082
f7e31cfe422696922aec52002e56c58103183966edee3bb8e1995d33f8d37b07c32280a8ecc213874e358a6ff367418556a4542fba7e3c17e4b8e82e05c3a543 04_psmouse_base.patch
270aa134a7040409cf2ec5502939b8aa68470c47eeb2bef8f378aa2758a8b546b79018298a81625351f1c06241d8f76bf016793474f58b888db7871a5d745801 05_try_to_make_kgsl_work.patch
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
0b33408a0c024c6a9103cc1006bf1534d0146333815a91406a8ae87ce5ec09da0ec427f2c7df211ecbd0a0a59206b3757f6196b9f2d3963734acc69807a5bbf2 gcc8-fix-put-user.patch"
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch"

View file

@ -3,7 +3,7 @@
pkgname="linux-sony-taoshan"
pkgver=3.4.0
pkgrel=0
pkgrel=1
pkgdesc="Sony Xperia L kernel fork"
arch="armhf"
_carch="arm"
@ -65,6 +65,6 @@ package() {
sha512sums="c81a890e9905547106a00ecb308d176d55a19f7d4ec0dcfde10c5d62647a917292c2098be2a657ff3cf6963f03ffaa019ddc1586ab378b9a39d10a850c806f53 linux-sony-taoshan-df6292bc628cece5925d0f67fbc8c8a2cab2d524.tar.gz
8236631fdd7ea8f382b1e5eb3eb53f44c11c488b2033615f57a298e66f4f0aec8c664fd3b01787c818c3f8806c254402dd9eebc3e2d0c0067231a68fd07e3408 config-sony-taoshan.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
0b33408a0c024c6a9103cc1006bf1534d0146333815a91406a8ae87ce5ec09da0ec427f2c7df211ecbd0a0a59206b3757f6196b9f2d3963734acc69807a5bbf2 gcc8-fix-put-user.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
7be03a9e78b7ac330a54b1f00509caa0621a95c0c55901878ad757f9dd69cc05ba2c8b5ea987063ae1224f92c4d090d515fa5d369e7755181a4871b0d0f82881 gpu-msm-fix-gcc5-compile.patch
a8c955bf718f155011e980f3d0948be98e1fee5649f418299a4851780543019daf7afa406aa7b0829375645107e4e6fbf241026b0cabe2b2ac895a47df83d2d8 mdss_fb_refresh_rate.patch"

View file

@ -1,45 +0,0 @@
From 8c8187d41b99acd4f2078d0fff6807e0eeb47407 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 26 Jul 2018 10:13:23 +0200
Subject: [PATCH] ARM: fix put_user() for gcc-8
Building kernels before linux-4.7 with gcc-8 results in many build failures
when gcc triggers a check that was meant to catch broken compilers:
/tmp/ccCGMQmS.s:648: Error: .err encountered
According to the discussion in the gcc bugzilla, a local "register
asm()" variable is still supposed to be the correct way to force an
inline assembly to use a particular register, but marking it 'const'
lets the compiler do optimizations that break that, i.e the compiler is
free to treat the variable as either 'const' or 'register' in that case.
Upstream commit 9f73bd8bb445 ("ARM: uaccess: remove put_user() code
duplication") fixed this problem in linux-4.8 as part of a larger change,
but seems a little too big to be backported to 4.4.
Let's take the simplest fix and change only the one broken line in the
same way as newer kernels.
Suggested-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85745
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/include/asm/uaccess.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 292c3f88f..48decaa00 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -158,7 +158,7 @@ extern int __put_user_8(void *, unsigned long long);
#define put_user(x,p) \
({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \
- register const typeof(*(p)) __r2 asm("r2") = (x); \
+ register typeof(*(p)) __r2 asm("r2") = (x); \
register const typeof(*(p)) __user *__p asm("r0") = (p);\
register unsigned long __l asm("r1") = __limit; \
register int __e asm("r0"); \

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch