<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/arch/mips/net, branch v3.16</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>MIPS: bpf: Fix stack space allocation for BPF memwords on MIPS64</title>
<updated>2014-06-26T09:48:23+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:39:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d8214ef14a1db4172c93e5694906bda9b00fac93'/>
<id>d8214ef14a1db4172c93e5694906bda9b00fac93</id>
<content type='text'>
When allocating stack space for BPF memwords we need to use the
appropriate 32 or 64-bit instruction to avoid losing the top 32 bits
of the stack pointer.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7135/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When allocating stack space for BPF memwords we need to use the
appropriate 32 or 64-bit instruction to avoid losing the top 32 bits
of the stack pointer.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7135/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: BPF: Use 32 or 64-bit load instruction to load an address to register</title>
<updated>2014-06-26T09:48:22+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-25T08:39:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b6a14a9845259eb21c9d8121330c4c3b22de182e'/>
<id>b6a14a9845259eb21c9d8121330c4c3b22de182e</id>
<content type='text'>
When loading a pointer to register we need to use the appropriate
32 or 64bit instruction to preserve the pointers' top 32bits.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7180/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When loading a pointer to register we need to use the appropriate
32 or 64bit instruction to preserve the pointers' top 32bits.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7180/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: bpf: Fix PKT_TYPE case for big-endian cores</title>
<updated>2014-06-26T09:48:22+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:38:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b4fe0ec86dae91abfa9f932cd0e2e9d50e336c8b'/>
<id>b4fe0ec86dae91abfa9f932cd0e2e9d50e336c8b</id>
<content type='text'>
The skb-&gt;pkt_type field is defined as follows:

u8 pkt_type:3,
   fclone:2,
   ipvs_property:1,
   peeked:1,
   nf_trace:1

resulting to the following layout in big-endian systems

[pkt_type][fclone][ipvs_propery][peeked][nf_trace]
^                                                ^
|                                                |
LSB                                             MSB

As a result, the existing code did not work because it was trying to
match pkt_type == 7 whereas in reality it is 7&lt;&lt;5 on big-endian
systems.

This has been fixed in the interpreter in
0dcceabb0c1bf2d4c12a748df9933fad303072a7
"net: filter: fix SKF_AD_PKTTYPE extension on big-endian"

The fix is to look for 7&lt;&lt;5 on big-endian systems for the pkt_type
field, and shift by 5 so the packet type will be at the lower 3 bits
of the A register.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7132/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The skb-&gt;pkt_type field is defined as follows:

u8 pkt_type:3,
   fclone:2,
   ipvs_property:1,
   peeked:1,
   nf_trace:1

resulting to the following layout in big-endian systems

[pkt_type][fclone][ipvs_propery][peeked][nf_trace]
^                                                ^
|                                                |
LSB                                             MSB

As a result, the existing code did not work because it was trying to
match pkt_type == 7 whereas in reality it is 7&lt;&lt;5 on big-endian
systems.

This has been fixed in the interpreter in
0dcceabb0c1bf2d4c12a748df9933fad303072a7
"net: filter: fix SKF_AD_PKTTYPE extension on big-endian"

The fix is to look for 7&lt;&lt;5 on big-endian systems for the pkt_type
field, and shift by 5 so the packet type will be at the lower 3 bits
of the A register.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7132/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: BPF: Prevent kernel fall over for &gt;=32bit shifts</title>
<updated>2014-06-26T09:48:22+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-25T08:37:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=95782bf434437b3292f5cb9ce21b53bdbc1beda1'/>
<id>95782bf434437b3292f5cb9ce21b53bdbc1beda1</id>
<content type='text'>
Remove BUG_ON() if the shift immediate is &gt;=32 to avoid kernel crashes
due to malicious user input. If the shift immediate is &gt;= 32,
we simply load the destination register with 0 since only
32-bit instructions are used by JIT so this will do the
correct thing even on MIPS64.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7179/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove BUG_ON() if the shift immediate is &gt;=32 to avoid kernel crashes
due to malicious user input. If the shift immediate is &gt;= 32,
we simply load the destination register with 0 since only
32-bit instructions are used by JIT so this will do the
correct thing even on MIPS64.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7179/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: bpf: Drop update_on_xread and always initialize the X register</title>
<updated>2014-06-26T09:48:22+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:38:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e5bb48b0553d75918094c5a6f7b60a4359887218'/>
<id>e5bb48b0553d75918094c5a6f7b60a4359887218</id>
<content type='text'>
Previously, update_on_xread() only set the reset flag if SEEN_X hasn't
been set already. However, SEEN_X is used to indicate that X is used
as destination or source register so there are some cases where X
is only used as source register and we really need to make sure that it
has been initialized in time. As a result of which, drop this function and
always set X to zero if it's used in any of the opcodes.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7133/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, update_on_xread() only set the reset flag if SEEN_X hasn't
been set already. However, SEEN_X is used to indicate that X is used
as destination or source register so there are some cases where X
is only used as source register and we really need to make sure that it
has been initialized in time. As a result of which, drop this function and
always set X to zero if it's used in any of the opcodes.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7133/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: bpf: Fix is_range() semantics</title>
<updated>2014-06-26T09:48:21+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:38:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=10c4d614d2ffcfc17add01f9648c3e530fb308d1'/>
<id>10c4d614d2ffcfc17add01f9648c3e530fb308d1</id>
<content type='text'>
is_range() was meant to check whether the number is within
the s16 range or not. However the return values and consumers expected
the exact opposite. We fix that by inverting the logic in the function
to return 'true' for &lt; s16 and 'false' for &gt; s16.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Reported-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7131/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
is_range() was meant to check whether the number is within
the s16 range or not. However the return values and consumers expected
the exact opposite. We fix that by inverting the logic in the function
to return 'true' for &lt; s16 and 'false' for &gt; s16.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Reported-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7131/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: bpf: Use pr_debug instead of pr_warn for unhandled opcodes</title>
<updated>2014-06-26T09:48:21+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:38:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=78b95b662c4c633206c997fe2bd25a9c680e047a'/>
<id>78b95b662c4c633206c997fe2bd25a9c680e047a</id>
<content type='text'>
We should prevent spamming the logs during normal execution of bpf-jit.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Suggested-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7129/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We should prevent spamming the logs during normal execution of bpf-jit.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Suggested-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7129/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: bpf: Fix return values for VLAN_TAG_PRESENT case</title>
<updated>2014-06-26T09:48:21+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:38:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=91a41d7f972b1d78b4bcbb61ada4a33c9d7ba8a3'/>
<id>91a41d7f972b1d78b4bcbb61ada4a33c9d7ba8a3</id>
<content type='text'>
If VLAN_TAG_PRESENT is not zero, then return 1 as expected by
classic BPF. Otherwise return 0.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7128/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If VLAN_TAG_PRESENT is not zero, then return 1 as expected by
classic BPF. Otherwise return 0.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7128/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: bpf: Use correct mask for VLAN_TAG case</title>
<updated>2014-06-26T09:48:21+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6e86c59d4d0d04e7ebefd05b8af245c968892f81'/>
<id>6e86c59d4d0d04e7ebefd05b8af245c968892f81</id>
<content type='text'>
Using VLAN_VID_MASK is not correct to get the vlan tag. Use
~VLAN_PRESENT_MASK instead and make sure it's u16 so the top 16-bits
will be removed. This will ensure that the emit_andi() code will not
treat this as a big 32-bit unsigned value.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7127/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using VLAN_VID_MASK is not correct to get the vlan tag. Use
~VLAN_PRESENT_MASK instead and make sure it's u16 so the top 16-bits
will be removed. This will ensure that the emit_andi() code will not
treat this as a big 32-bit unsigned value.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7127/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: bpf: Fix branch conditional for BPF_J{GT/GE} cases</title>
<updated>2014-06-26T09:48:21+00:00</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2014-06-23T09:38:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1ab24a4e3de1ec37d8ed255841d2d94d77e8a4f4'/>
<id>1ab24a4e3de1ec37d8ed255841d2d94d77e8a4f4</id>
<content type='text'>
The sltiu and sltu instructions will set the scratch register
to 1 if A &lt;= X|K so fix the emitted branch conditional to check
for scratch != zero rather than scratch &gt;= zero which would complicate
the resuling branch logic given that MIPS does not have a BGT or BGET
instructions to compare general purpose registers directly.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7126/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The sltiu and sltu instructions will set the scratch register
to 1 if A &lt;= X|K so fix the emitted branch conditional to check
for scratch != zero rather than scratch &gt;= zero which would complicate
the resuling branch logic given that MIPS does not have a BGT or BGET
instructions to compare general purpose registers directly.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7126/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
