Skip to content

Commit be8cec3

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.70' into linux-linaro-lsk-v4.4
This is the 4.4.70 stable release
2 parents c8603c0 + b409ba3 commit be8cec3

111 files changed

Lines changed: 996 additions & 441 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/arm64/tagged-pointers.txt

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,56 @@ in AArch64 Linux.
1111
The kernel configures the translation tables so that translations made
1212
via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of
1313
the virtual address ignored by the translation hardware. This frees up
14-
this byte for application use, with the following caveats:
14+
this byte for application use.
1515

16-
(1) The kernel requires that all user addresses passed to EL1
17-
are tagged with tag 0x00. This means that any syscall
18-
parameters containing user virtual addresses *must* have
19-
their top byte cleared before trapping to the kernel.
2016

21-
(2) Non-zero tags are not preserved when delivering signals.
22-
This means that signal handlers in applications making use
23-
of tags cannot rely on the tag information for user virtual
24-
addresses being maintained for fields inside siginfo_t.
25-
One exception to this rule is for signals raised in response
26-
to watchpoint debug exceptions, where the tag information
27-
will be preserved.
17+
Passing tagged addresses to the kernel
18+
--------------------------------------
2819

29-
(3) Special care should be taken when using tagged pointers,
30-
since it is likely that C compilers will not hazard two
31-
virtual addresses differing only in the upper byte.
20+
All interpretation of userspace memory addresses by the kernel assumes
21+
an address tag of 0x00.
22+
23+
This includes, but is not limited to, addresses found in:
24+
25+
- pointer arguments to system calls, including pointers in structures
26+
passed to system calls,
27+
28+
- the stack pointer (sp), e.g. when interpreting it to deliver a
29+
signal,
30+
31+
- the frame pointer (x29) and frame records, e.g. when interpreting
32+
them to generate a backtrace or call graph.
33+
34+
Using non-zero address tags in any of these locations may result in an
35+
error code being returned, a (fatal) signal being raised, or other modes
36+
of failure.
37+
38+
For these reasons, passing non-zero address tags to the kernel via
39+
system calls is forbidden, and using a non-zero address tag for sp is
40+
strongly discouraged.
41+
42+
Programs maintaining a frame pointer and frame records that use non-zero
43+
address tags may suffer impaired or inaccurate debug and profiling
44+
visibility.
45+
46+
47+
Preserving tags
48+
---------------
49+
50+
Non-zero tags are not preserved when delivering signals. This means that
51+
signal handlers in applications making use of tags cannot rely on the
52+
tag information for user virtual addresses being maintained for fields
53+
inside siginfo_t. One exception to this rule is for signals raised in
54+
response to watchpoint debug exceptions, where the tag information will
55+
be preserved.
3256

3357
The architecture prevents the use of a tagged PC, so the upper byte will
3458
be set to a sign-extension of bit 55 on exception return.
59+
60+
61+
Other considerations
62+
--------------------
63+
64+
Special care should be taken when using tagged pointers, since it is
65+
likely that C compilers will not hazard two virtual addresses differing
66+
only in the upper byte.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 69
3+
SUBLEVEL = 70
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/alpha/kernel/osf_sys.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,8 +1188,10 @@ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,
11881188
if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur)))
11891189
return -EFAULT;
11901190

1191-
err = 0;
1192-
err |= put_user(status, ustatus);
1191+
err = put_user(status, ustatus);
1192+
if (ret < 0)
1193+
return err ? err : ret;
1194+
11931195
err |= __put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec);
11941196
err |= __put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec);
11951197
err |= __put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec);

arch/arm/boot/dts/at91-sama5d3_xplained.dts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,17 @@
162162
};
163163

164164
adc0: adc@f8018000 {
165+
atmel,adc-vref = <3300>;
166+
atmel,adc-channels-used = <0xfe>;
165167
pinctrl-0 = <
166168
&pinctrl_adc0_adtrg
167-
&pinctrl_adc0_ad0
168169
&pinctrl_adc0_ad1
169170
&pinctrl_adc0_ad2
170171
&pinctrl_adc0_ad3
171172
&pinctrl_adc0_ad4
172173
&pinctrl_adc0_ad5
173174
&pinctrl_adc0_ad6
174175
&pinctrl_adc0_ad7
175-
&pinctrl_adc0_ad8
176-
&pinctrl_adc0_ad9
177176
>;
178177
status = "okay";
179178
};

arch/arm/boot/dts/tegra20-paz00.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@
565565
regulator-name = "+3VS,vdd_pnl";
566566
regulator-min-microvolt = <3300000>;
567567
regulator-max-microvolt = <3300000>;
568+
regulator-boot-on;
568569
gpio = <&gpio TEGRA_GPIO(A, 4) GPIO_ACTIVE_HIGH>;
569570
enable-active-high;
570571
};

arch/arm64/include/asm/cmpxchg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static inline unsigned long __xchg_case_##name(unsigned long x, \
4848
" swp" #acq_lse #rel #sz "\t%" #w "3, %" #w "0, %2\n" \
4949
" nop\n" \
5050
" " #nop_lse) \
51-
: "=&r" (ret), "=&r" (tmp), "+Q" (*(u8 *)ptr) \
51+
: "=&r" (ret), "=&r" (tmp), "+Q" (*(unsigned long *)ptr) \
5252
: "r" (x) \
5353
: cl); \
5454
\

arch/arm64/include/asm/uaccess.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ static inline void set_fs(mm_segment_t fs)
104104
*/
105105
#define __range_ok(addr, size) \
106106
({ \
107+
unsigned long __addr = (unsigned long __force)(addr); \
107108
unsigned long flag, roksum; \
108109
__chk_user_ptr(addr); \
109110
asm("adds %1, %1, %3; ccmp %1, %4, #2, cc; cset %0, ls" \
110111
: "=&r" (flag), "=&r" (roksum) \
111-
: "1" (addr), "Ir" (size), \
112+
: "1" (__addr), "Ir" (size), \
112113
"r" (current_thread_info()->addr_limit) \
113114
: "cc"); \
114115
flag; \

arch/metag/include/asm/uaccess.h

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,32 @@
2828

2929
#define segment_eq(a, b) ((a).seg == (b).seg)
3030

31-
#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
32-
/*
33-
* Explicitly allow NULL pointers here. Parts of the kernel such
34-
* as readv/writev use access_ok to validate pointers, but want
35-
* to allow NULL pointers for various reasons. NULL pointers are
36-
* safe to allow through because the first page is not mappable on
37-
* Meta.
38-
*
39-
* We also wish to avoid letting user code access the system area
40-
* and the kernel half of the address space.
41-
*/
42-
#define __user_bad(addr, size) (((addr) > 0 && (addr) < META_MEMORY_BASE) || \
43-
((addr) > PAGE_OFFSET && \
44-
(addr) < LINCORE_BASE))
45-
4631
static inline int __access_ok(unsigned long addr, unsigned long size)
4732
{
48-
return __kernel_ok || !__user_bad(addr, size);
33+
/*
34+
* Allow access to the user mapped memory area, but not the system area
35+
* before it. The check extends to the top of the address space when
36+
* kernel access is allowed (there's no real reason to user copy to the
37+
* system area in any case).
38+
*/
39+
if (likely(addr >= META_MEMORY_BASE && addr < get_fs().seg &&
40+
size <= get_fs().seg - addr))
41+
return true;
42+
/*
43+
* Explicitly allow NULL pointers here. Parts of the kernel such
44+
* as readv/writev use access_ok to validate pointers, but want
45+
* to allow NULL pointers for various reasons. NULL pointers are
46+
* safe to allow through because the first page is not mappable on
47+
* Meta.
48+
*/
49+
if (!addr)
50+
return true;
51+
/* Allow access to core code memory area... */
52+
if (addr >= LINCORE_CODE_BASE && addr <= LINCORE_CODE_LIMIT &&
53+
size <= LINCORE_CODE_LIMIT + 1 - addr)
54+
return true;
55+
/* ... but no other areas. */
56+
return false;
4957
}
5058

5159
#define access_ok(type, addr, size) __access_ok((unsigned long)(addr), \
@@ -186,8 +194,13 @@ do { \
186194
extern long __must_check __strncpy_from_user(char *dst, const char __user *src,
187195
long count);
188196

189-
#define strncpy_from_user(dst, src, count) __strncpy_from_user(dst, src, count)
190-
197+
static inline long
198+
strncpy_from_user(char *dst, const char __user *src, long count)
199+
{
200+
if (!access_ok(VERIFY_READ, src, 1))
201+
return -EFAULT;
202+
return __strncpy_from_user(dst, src, count);
203+
}
191204
/*
192205
* Return the size of a string (including the ending 0)
193206
*

arch/powerpc/kernel/exceptions-64e.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
735735
andis. r15,r14,(DBSR_IC|DBSR_BT)@h
736736
beq+ 1f
737737

738+
#ifdef CONFIG_RELOCATABLE
739+
ld r15,PACATOC(r13)
740+
ld r14,interrupt_base_book3e@got(r15)
741+
ld r15,__end_interrupts@got(r15)
742+
#else
738743
LOAD_REG_IMMEDIATE(r14,interrupt_base_book3e)
739744
LOAD_REG_IMMEDIATE(r15,__end_interrupts)
745+
#endif
740746
cmpld cr0,r10,r14
741747
cmpld cr1,r10,r15
742748
blt+ cr0,1f
@@ -799,8 +805,14 @@ kernel_dbg_exc:
799805
andis. r15,r14,(DBSR_IC|DBSR_BT)@h
800806
beq+ 1f
801807

808+
#ifdef CONFIG_RELOCATABLE
809+
ld r15,PACATOC(r13)
810+
ld r14,interrupt_base_book3e@got(r15)
811+
ld r15,__end_interrupts@got(r15)
812+
#else
802813
LOAD_REG_IMMEDIATE(r14,interrupt_base_book3e)
803814
LOAD_REG_IMMEDIATE(r15,__end_interrupts)
815+
#endif
804816
cmpld cr0,r10,r14
805817
cmpld cr1,r10,r15
806818
blt+ cr0,1f

arch/powerpc/kernel/mce.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ static void machine_check_process_queued_event(struct irq_work *work)
204204
{
205205
int index;
206206

207+
add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
208+
207209
/*
208210
* For now just print it to console.
209211
* TODO: log this error event to FSP or nvram.

0 commit comments

Comments
 (0)