Skip to content

Commit 2608a4e

Browse files
Achal Vermamobile promotions
Achal Verma
authored and
mobile promotions
committed
Merge branch 'android-201' into rel-32
Upgrading kernel from 4.9.178 to 4.9.201 Bug 2969628 Change-Id: Ifb7a148fe38f26145f76e6104cc940bb83cd8b04 Signed-off-by: Achal Verma <[email protected]> Reviewed-on: https://git-master.nvidia.com/r/c/linux-4.9/+/2392668 GVS: Gerrit_Virtual_Submit Reviewed-by: Hardik T Shah <[email protected]> Reviewed-by: Phoenix Jung <[email protected]> Reviewed-by: mobile promotions <[email protected]> Tested-by: mobile promotions <[email protected]>
1 parent 40953d8 commit 2608a4e

File tree

1,476 files changed

+14925
-10030
lines changed

Some content is hidden

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

1,476 files changed

+14925
-10030
lines changed

Documentation/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain']
3838

3939
# The name of the math extension changed on Sphinx 1.4
40-
if major == 1 and minor > 3:
40+
if (major == 1 and minor > 3) or (major > 1):
4141
extensions.append("sphinx.ext.imgmath")
4242
else:
4343
extensions.append("sphinx.ext.pngmath")

Documentation/devicetree/bindings/net/can/microchip,mcp251x.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Required properties:
44
- compatible: Should be one of the following:
55
- "microchip,mcp2510" for MCP2510.
66
- "microchip,mcp2515" for MCP2515.
7+
- "microchip,mcp25625" for MCP25625.
78
- reg: SPI chip select.
89
- clocks: The clock feeding the CAN controller.
910
- interrupt-parent: The parent interrupt controller.

Documentation/devicetree/bindings/serial/mvebu-uart.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ Required properties:
88
Example:
99
serial@12000 {
1010
compatible = "marvell,armada-3700-uart";
11-
reg = <0x12000 0x400>;
11+
reg = <0x12000 0x200>;
1212
interrupts = <43>;
1313
};

Documentation/kernel-parameters.txt

+12
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
24962496
improves system performance, but it may also
24972497
expose users to several CPU vulnerabilities.
24982498
Equivalent to: nopti [X86]
2499+
nospectre_v1 [X86]
24992500
nospectre_v2 [X86]
25002501
spectre_v2_user=off [X86]
25012502
spec_store_bypass_disable=off [X86]
@@ -2842,6 +2843,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
28422843
nosmt=force: Force disable SMT, cannot be undone
28432844
via the sysfs control file.
28442845

2846+
nospectre_v1 [X86,PPC] Disable mitigations for Spectre Variant 1
2847+
(bounds check bypass). With this option data leaks are
2848+
possible in the system.
2849+
28452850
nospectre_v2 [X86,PPC_FSL_BOOK3E] Disable all mitigations for the Spectre variant 2
28462851
(indirect branch prediction) vulnerability. System may
28472852
allow data leaks with this option, which is equivalent
@@ -3840,6 +3845,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
38403845
Run specified binary instead of /init from the ramdisk,
38413846
used for early userspace startup. See initrd.
38423847

3848+
rdrand= [X86]
3849+
force - Override the decision by the kernel to hide the
3850+
advertisement of RDRAND support (this affects
3851+
certain AMD processors because of buggy BIOS
3852+
support, specifically around the suspend/resume
3853+
path).
3854+
38433855
reboot= [KNL]
38443856
Format (x86 or x86_64):
38453857
[w[arm] | c[old] | h[ard] | s[oft] | g[pio]] \

Documentation/siphash.txt

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
SipHash - a short input PRF
2+
-----------------------------------------------
3+
Written by Jason A. Donenfeld <[email protected]>
4+
5+
SipHash is a cryptographically secure PRF -- a keyed hash function -- that
6+
performs very well for short inputs, hence the name. It was designed by
7+
cryptographers Daniel J. Bernstein and Jean-Philippe Aumasson. It is intended
8+
as a replacement for some uses of: `jhash`, `md5_transform`, `sha_transform`,
9+
and so forth.
10+
11+
SipHash takes a secret key filled with randomly generated numbers and either
12+
an input buffer or several input integers. It spits out an integer that is
13+
indistinguishable from random. You may then use that integer as part of secure
14+
sequence numbers, secure cookies, or mask it off for use in a hash table.
15+
16+
1. Generating a key
17+
18+
Keys should always be generated from a cryptographically secure source of
19+
random numbers, either using get_random_bytes or get_random_once:
20+
21+
siphash_key_t key;
22+
get_random_bytes(&key, sizeof(key));
23+
24+
If you're not deriving your key from here, you're doing it wrong.
25+
26+
2. Using the functions
27+
28+
There are two variants of the function, one that takes a list of integers, and
29+
one that takes a buffer:
30+
31+
u64 siphash(const void *data, size_t len, const siphash_key_t *key);
32+
33+
And:
34+
35+
u64 siphash_1u64(u64, const siphash_key_t *key);
36+
u64 siphash_2u64(u64, u64, const siphash_key_t *key);
37+
u64 siphash_3u64(u64, u64, u64, const siphash_key_t *key);
38+
u64 siphash_4u64(u64, u64, u64, u64, const siphash_key_t *key);
39+
u64 siphash_1u32(u32, const siphash_key_t *key);
40+
u64 siphash_2u32(u32, u32, const siphash_key_t *key);
41+
u64 siphash_3u32(u32, u32, u32, const siphash_key_t *key);
42+
u64 siphash_4u32(u32, u32, u32, u32, const siphash_key_t *key);
43+
44+
If you pass the generic siphash function something of a constant length, it
45+
will constant fold at compile-time and automatically choose one of the
46+
optimized functions.
47+
48+
3. Hashtable key function usage:
49+
50+
struct some_hashtable {
51+
DECLARE_HASHTABLE(hashtable, 8);
52+
siphash_key_t key;
53+
};
54+
55+
void init_hashtable(struct some_hashtable *table)
56+
{
57+
get_random_bytes(&table->key, sizeof(table->key));
58+
}
59+
60+
static inline hlist_head *some_hashtable_bucket(struct some_hashtable *table, struct interesting_input *input)
61+
{
62+
return &table->hashtable[siphash(input, sizeof(*input), &table->key) & (HASH_SIZE(table->hashtable) - 1)];
63+
}
64+
65+
You may then iterate like usual over the returned hash bucket.
66+
67+
4. Security
68+
69+
SipHash has a very high security margin, with its 128-bit key. So long as the
70+
key is kept secret, it is impossible for an attacker to guess the outputs of
71+
the function, even if being able to observe many outputs, since 2^128 outputs
72+
is significant.
73+
74+
Linux implements the "2-4" variant of SipHash.
75+
76+
5. Struct-passing Pitfalls
77+
78+
Often times the XuY functions will not be large enough, and instead you'll
79+
want to pass a pre-filled struct to siphash. When doing this, it's important
80+
to always ensure the struct has no padding holes. The easiest way to do this
81+
is to simply arrange the members of the struct in descending order of size,
82+
and to use offsetendof() instead of sizeof() for getting the size. For
83+
performance reasons, if possible, it's probably a good thing to align the
84+
struct to the right boundary. Here's an example:
85+
86+
const struct {
87+
struct in6_addr saddr;
88+
u32 counter;
89+
u16 dport;
90+
} __aligned(SIPHASH_ALIGNMENT) combined = {
91+
.saddr = *(struct in6_addr *)saddr,
92+
.counter = counter,
93+
.dport = dport
94+
};
95+
u64 h = siphash(&combined, offsetofend(typeof(combined), dport), &secret);
96+
97+
6. Resources
98+
99+
Read the SipHash paper if you're interested in learning more:
100+
https://131002.net/siphash/siphash.pdf
101+
102+
103+
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
104+
105+
HalfSipHash - SipHash's insecure younger cousin
106+
-----------------------------------------------
107+
Written by Jason A. Donenfeld <[email protected]>
108+
109+
On the off-chance that SipHash is not fast enough for your needs, you might be
110+
able to justify using HalfSipHash, a terrifying but potentially useful
111+
possibility. HalfSipHash cuts SipHash's rounds down from "2-4" to "1-3" and,
112+
even scarier, uses an easily brute-forcable 64-bit key (with a 32-bit output)
113+
instead of SipHash's 128-bit key. However, this may appeal to some
114+
high-performance `jhash` users.
115+
116+
Danger!
117+
118+
Do not ever use HalfSipHash except for as a hashtable key function, and only
119+
then when you can be absolutely certain that the outputs will never be
120+
transmitted out of the kernel. This is only remotely useful over `jhash` as a
121+
means of mitigating hashtable flooding denial of service attacks.
122+
123+
1. Generating a key
124+
125+
Keys should always be generated from a cryptographically secure source of
126+
random numbers, either using get_random_bytes or get_random_once:
127+
128+
hsiphash_key_t key;
129+
get_random_bytes(&key, sizeof(key));
130+
131+
If you're not deriving your key from here, you're doing it wrong.
132+
133+
2. Using the functions
134+
135+
There are two variants of the function, one that takes a list of integers, and
136+
one that takes a buffer:
137+
138+
u32 hsiphash(const void *data, size_t len, const hsiphash_key_t *key);
139+
140+
And:
141+
142+
u32 hsiphash_1u32(u32, const hsiphash_key_t *key);
143+
u32 hsiphash_2u32(u32, u32, const hsiphash_key_t *key);
144+
u32 hsiphash_3u32(u32, u32, u32, const hsiphash_key_t *key);
145+
u32 hsiphash_4u32(u32, u32, u32, u32, const hsiphash_key_t *key);
146+
147+
If you pass the generic hsiphash function something of a constant length, it
148+
will constant fold at compile-time and automatically choose one of the
149+
optimized functions.
150+
151+
3. Hashtable key function usage:
152+
153+
struct some_hashtable {
154+
DECLARE_HASHTABLE(hashtable, 8);
155+
hsiphash_key_t key;
156+
};
157+
158+
void init_hashtable(struct some_hashtable *table)
159+
{
160+
get_random_bytes(&table->key, sizeof(table->key));
161+
}
162+
163+
static inline hlist_head *some_hashtable_bucket(struct some_hashtable *table, struct interesting_input *input)
164+
{
165+
return &table->hashtable[hsiphash(input, sizeof(*input), &table->key) & (HASH_SIZE(table->hashtable) - 1)];
166+
}
167+
168+
You may then iterate like usual over the returned hash bucket.
169+
170+
4. Performance
171+
172+
HalfSipHash is roughly 3 times slower than JenkinsHash. For many replacements,
173+
this will not be a problem, as the hashtable lookup isn't the bottleneck. And
174+
in general, this is probably a good sacrifice to make for the security and DoS
175+
resistance of HalfSipHash.

Documentation/sysctl/net.txt

+8
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ Values :
5454
1 - enable JIT hardening for unprivileged users only
5555
2 - enable JIT hardening for all users
5656

57+
bpf_jit_limit
58+
-------------
59+
60+
This enforces a global limit for memory allocations to the BPF JIT
61+
compiler in order to reject unprivileged JIT requests once it has
62+
been surpassed. bpf_jit_limit contains the value of the global limit
63+
in bytes.
64+
5765
dev_weight
5866
--------------
5967

Documentation/usb/rio.txt

-138
This file was deleted.

0 commit comments

Comments
 (0)