<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/Makefile, branch linux-4.1.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-4.1.y</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2018-05-28T02:26:45+00:00</updated>
<entry>
<title>Linux 4.1.52</title>
<updated>2018-05-28T02:26:45+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>alexander.levin@microsoft.com</email>
</author>
<published>2018-05-28T02:26:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c4ff7514e71ddb85d05f262cd40f841f494775c8'/>
<id>urn:sha1:c4ff7514e71ddb85d05f262cd40f841f494775c8</id>
<content type='text'>
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>kbuild: disable clang's default use of -fmerge-all-constants</title>
<updated>2018-05-23T01:33:54+00:00</updated>
<author>
<name>Daniel Borkmann</name>
<email>daniel@iogearbox.net</email>
</author>
<published>2018-03-21T00:18:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=09e095de7ab22d7df11d3aca26de407fcf1121ae'/>
<id>urn:sha1:09e095de7ab22d7df11d3aca26de407fcf1121ae</id>
<content type='text'>
[ Upstream commit 87e0d4f0f37fb0c8c4aeeac46fff5e957738df79 ]

Prasad reported that he has seen crashes in BPF subsystem with netd
on Android with arm64 in the form of (note, the taint is unrelated):

  [ 4134.721483] Unable to handle kernel paging request at virtual address 800000001
  [ 4134.820925] Mem abort info:
  [ 4134.901283]   Exception class = DABT (current EL), IL = 32 bits
  [ 4135.016736]   SET = 0, FnV = 0
  [ 4135.119820]   EA = 0, S1PTW = 0
  [ 4135.201431] Data abort info:
  [ 4135.301388]   ISV = 0, ISS = 0x00000021
  [ 4135.359599]   CM = 0, WnR = 0
  [ 4135.470873] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffe39b946000
  [ 4135.499757] [0000000800000001] *pgd=0000000000000000, *pud=0000000000000000
  [ 4135.660725] Internal error: Oops: 96000021 [#1] PREEMPT SMP
  [ 4135.674610] Modules linked in:
  [ 4135.682883] CPU: 5 PID: 1260 Comm: netd Tainted: G S      W       4.14.19+ #1
  [ 4135.716188] task: ffffffe39f4aa380 task.stack: ffffff801d4e0000
  [ 4135.731599] PC is at bpf_prog_add+0x20/0x68
  [ 4135.741746] LR is at bpf_prog_inc+0x20/0x2c
  [ 4135.751788] pc : [&lt;ffffff94ab7ad584&gt;] lr : [&lt;ffffff94ab7ad638&gt;] pstate: 60400145
  [ 4135.769062] sp : ffffff801d4e3ce0
  [...]
  [ 4136.258315] Process netd (pid: 1260, stack limit = 0xffffff801d4e0000)
  [ 4136.273746] Call trace:
  [...]
  [ 4136.442494] 3ca0: ffffff94ab7ad584 0000000060400145 ffffffe3a01bf8f8 0000000000000006
  [ 4136.460936] 3cc0: 0000008000000000 ffffff94ab844204 ffffff801d4e3cf0 ffffff94ab7ad584
  [ 4136.479241] [&lt;ffffff94ab7ad584&gt;] bpf_prog_add+0x20/0x68
  [ 4136.491767] [&lt;ffffff94ab7ad638&gt;] bpf_prog_inc+0x20/0x2c
  [ 4136.504536] [&lt;ffffff94ab7b5d08&gt;] bpf_obj_get_user+0x204/0x22c
  [ 4136.518746] [&lt;ffffff94ab7ade68&gt;] SyS_bpf+0x5a8/0x1a88

Android's netd was basically pinning the uid cookie BPF map in BPF
fs (/sys/fs/bpf/traffic_cookie_uid_map) and later on retrieving it
again resulting in above panic. Issue is that the map was wrongly
identified as a prog! Above kernel was compiled with clang 4.0,
and it turns out that clang decided to merge the bpf_prog_iops and
bpf_map_iops into a single memory location, such that the two i_ops
could then not be distinguished anymore.

Reason for this miscompilation is that clang has the more aggressive
-fmerge-all-constants enabled by default. In fact, clang source code
has a comment about it in lib/AST/ExprConstant.cpp on why it is okay
to do so:

  Pointers with different bases cannot represent the same object.
  (Note that clang defaults to -fmerge-all-constants, which can
  lead to inconsistent results for comparisons involving the address
  of a constant; this generally doesn't matter in practice.)

The issue never appeared with gcc however, since gcc does not enable
-fmerge-all-constants by default and even *explicitly* states in
it's option description that using this flag results in non-conforming
behavior, quote from man gcc:

  Languages like C or C++ require each variable, including multiple
  instances of the same variable in recursive calls, to have distinct
  locations, so using this option results in non-conforming behavior.

There are also various clang bug reports open on that matter [1],
where clang developers acknowledge the non-conforming behavior,
and refer to disabling it with -fno-merge-all-constants. But even
if this gets fixed in clang today, there are already users out there
that triggered this. Thus, fix this issue by explicitly adding
-fno-merge-all-constants to the kernel's Makefile to generically
disable this optimization, since potentially other places in the
kernel could subtly break as well.

Note, there is also a flag called -fmerge-constants (not supported
by clang), which is more conservative and only applies to strings
and it's enabled in gcc's -O/-O2/-O3/-Os optimization levels. In
gcc's code, the two flags -fmerge-{all-,}constants share the same
variable internally, so when disabling it via -fno-merge-all-constants,
then we really don't merge any const data (e.g. strings), and text
size increases with gcc (14,927,214 -&gt; 14,942,646 for vmlinux.o).

  $ gcc -fverbose-asm -O2 foo.c -S -o foo.S
    -&gt; foo.S lists -fmerge-constants under options enabled
  $ gcc -fverbose-asm -O2 -fno-merge-all-constants foo.c -S -o foo.S
    -&gt; foo.S doesn't list -fmerge-constants under options enabled
  $ gcc -fverbose-asm -O2 -fno-merge-all-constants -fmerge-constants foo.c -S -o foo.S
    -&gt; foo.S lists -fmerge-constants under options enabled

Thus, as a workaround we need to set both -fno-merge-all-constants
*and* -fmerge-constants in the Makefile in order for text size to
stay as is.

  [1] https://bugs.llvm.org/show_bug.cgi?id=18538

Reported-by: Prasad Sodagudi &lt;psodagud@codeaurora.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Chenbo Feng &lt;fengc@google.com&gt;
Cc: Richard Smith &lt;richard-llvm@metafoo.co.uk&gt;
Cc: Chandler Carruth &lt;chandlerc@gmail.com&gt;
Cc: linux-kernel@vger.kernel.org
Tested-by: Prasad Sodagudi &lt;psodagud@codeaurora.org&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>Linux 4.1.51</title>
<updated>2018-03-27T20:15:21+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>alexander.levin@microsoft.com</email>
</author>
<published>2018-03-27T20:15:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2d61e08a1024d0cf15c26889285004e46c9f0b14'/>
<id>urn:sha1:2d61e08a1024d0cf15c26889285004e46c9f0b14</id>
<content type='text'>
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>Linux 4.1.50</title>
<updated>2018-03-05T21:35:54+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>alexander.levin@microsoft.com</email>
</author>
<published>2018-03-05T21:35:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6f20f6d4c095967c3debdb1d4c224ebf3da85452'/>
<id>urn:sha1:6f20f6d4c095967c3debdb1d4c224ebf3da85452</id>
<content type='text'>
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>kbuild: add '-fno-stack-check' to kernel build options</title>
<updated>2018-03-01T00:32:18+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-12-30T01:34:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=49c74e3181f472eed405345bd4534e53e440ea1b'/>
<id>urn:sha1:49c74e3181f472eed405345bd4534e53e440ea1b</id>
<content type='text'>
[ Upstream commit 3ce120b16cc548472f80cf8644f90eda958cf1b6 ]

It appears that hardened gentoo enables "-fstack-check" by default for
gcc.

That doesn't work _at_all_ for the kernel, because the kernel stack
doesn't act like a user stack at all: it's much smaller, and it doesn't
auto-expand on use.  So the extra "probe one page below the stack" code
generated by -fstack-check just breaks the kernel in horrible ways,
causing infinite double faults etc.

[ I have to say, that the particular code gcc generates looks very
  stupid even for user space where it works, but that's a separate
  issue.  ]

Reported-and-tested-by: Alexander Tsoy &lt;alexander@tsoy.me&gt;
Reported-and-tested-by: Toralf Förster &lt;toralf.foerster@gmx.de&gt;
Cc: stable@kernel.org
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Jiri Kosina &lt;jikos@kernel.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>Linux 4.1.49</title>
<updated>2018-01-22T20:40:06+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>alexander.levin@microsoft.com</email>
</author>
<published>2018-01-22T20:40:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=30ad2851a645bb5f42c72f21ceb166877cf7e695'/>
<id>urn:sha1:30ad2851a645bb5f42c72f21ceb166877cf7e695</id>
<content type='text'>
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>disable new gcc-7.1.1 warnings for now</title>
<updated>2018-01-17T17:55:41+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-07-13T02:25:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cef20adbe64cd8550ede8d551f8f6ebcf805d5ef'/>
<id>urn:sha1:cef20adbe64cd8550ede8d551f8f6ebcf805d5ef</id>
<content type='text'>
[ Upstream commit bd664f6b3e376a8ef4990f87d08271cc2d01ba9a ]

I made the mistake of upgrading my desktop to the new Fedora 26 that
comes with gcc-7.1.1.

There's nothing wrong per se that I've noticed, but I now have 1500
lines of warnings, mostly from the new format-truncation warning
triggering all over the tree.

We use 'snprintf()' and friends in a lot of places, and often know that
the numbers are fairly small (ie a controller index or similar), but gcc
doesn't know that, and sees an 'int', and thinks that it could be some
huge number.  And then complains when our buffers are not able to fit
the name for the ten millionth controller.

These warnings aren't necessarily bad per se, and we probably want to
look through them subsystem by subsystem, but at least during the merge
window they just mean that I can't even see if somebody is introducing
any *real* problems when I pull.

So warnings disabled for now.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>Linux 4.1.48</title>
<updated>2017-12-12T15:21:44+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>alexander.levin@verizon.com</email>
</author>
<published>2017-12-12T15:21:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0199619b21f7320482e8a2db14cf8bc974a7766a'/>
<id>urn:sha1:0199619b21f7320482e8a2db14cf8bc974a7766a</id>
<content type='text'>
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>Linux 4.1.47</title>
<updated>2017-12-07T02:20:16+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>alexander.levin@verizon.com</email>
</author>
<published>2017-12-03T15:08:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c3f4bb14a264a96c2709b026dca37a4eb252a82a'/>
<id>urn:sha1:c3f4bb14a264a96c2709b026dca37a4eb252a82a</id>
<content type='text'>
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>Linux 4.1.46</title>
<updated>2017-11-08T03:44:28+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>alexander.levin@verizon.com</email>
</author>
<published>2017-11-08T03:44:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=200d858d94b4d8ed7a287e3a3c2b860ae9e17e83'/>
<id>urn:sha1:200d858d94b4d8ed7a287e3a3c2b860ae9e17e83</id>
<content type='text'>
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
</feed>
