linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bernd Edlinger <bernd.edlinger@hotmail.de>,
	Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 3.18 26/27] ARM: fix put_user() for gcc-8
Date: Fri, 27 Jul 2018 12:27:03 +0200	[thread overview]
Message-ID: <20180727102650.001671150@linuxfoundation.org> (raw)
In-Reply-To: <20180727102649.049641021@linuxfoundation.org>

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

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(-)

--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -220,7 +220,7 @@ extern int __put_user_8(void *, unsigned
 	({								\
 		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");				\



  parent reply	other threads:[~2018-07-27 10:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 10:26 [PATCH 3.18 00/27] 3.18.117-stable review Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 01/27] x86/MCE: Remove min interval polling limitation Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 02/27] fat: fix memory allocation failure handling of match_strdup() Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 03/27] ALSA: rawmidi: Change resized buffers atomically Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 04/27] ARC: Fix CONFIG_SWAP Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 05/27] ARC: mm: allow mprotect to make stack mappings executable Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 06/27] ipv4: Return EINVAL when ping_group_range sysctl doesnt map to user ns Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 07/27] ptp: fix missing break in switch Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 08/27] net: Dont copy pfmemalloc flag in __copy_skb_header() Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 09/27] skbuff: Unconditionally copy pfmemalloc in __skb_clone() Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 10/27] ip: hash fragments consistently Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 11/27] net/mlx4_core: Save the qpn from the input modifier in RST2INIT wrapper Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 12/27] rtnetlink: add rtnl_link_state check in rtnl_configure_link Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 13/27] tcp: fix dctcp delayed ACK schedule Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 14/27] tcp: helpers to send special DCTCP ack Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 15/27] tcp: do not cancel delay-AcK on DCTCP special ACK Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 16/27] tcp: do not delay ACK in DCTCP upon CE status change Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 17/27] tcp: avoid collapses in tcp_prune_queue() if possible Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 18/27] tcp: detect malicious patterns in tcp_collapse_ofo_queue() Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 19/27] usb: cdc_acm: Add quirk for Castles VEGA3000 Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 20/27] usb: core: handle hub C_PORT_OVER_CURRENT condition Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 21/27] usb: gadget: f_fs: Only return delayed status when len is 0 Greg Kroah-Hartman
2018-07-27 10:26 ` [PATCH 3.18 22/27] can: xilinx_can: fix RX loop if RXNEMP is asserted without RXOK Greg Kroah-Hartman
2018-07-27 10:27 ` [PATCH 3.18 23/27] can: xilinx_can: fix device dropping off bus on RX overrun Greg Kroah-Hartman
2018-07-27 10:27 ` [PATCH 3.18 24/27] can: xilinx_can: keep only 1-2 frames in TX FIFO to fix TX accounting Greg Kroah-Hartman
2018-07-27 10:27 ` [PATCH 3.18 25/27] can: xilinx_can: fix RX overflow interrupt not being enabled Greg Kroah-Hartman
2018-07-27 10:27 ` Greg Kroah-Hartman [this message]
2018-07-27 10:27 ` [PATCH 3.18 27/27] turn off -Wattribute-alias Greg Kroah-Hartman
2018-07-27 12:21 ` [PATCH 3.18 00/27] 3.18.117-stable review Nathan Chancellor
2018-07-27 12:29   ` Greg Kroah-Hartman
2018-07-27 17:28 ` Guenter Roeck
2018-07-27 20:25 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180727102650.001671150@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=bernd.edlinger@hotmail.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).