Daniel Borkmann
faa74a862a
bpf: reject stores into ctx via st and xadd
...
[ upstream commit f37a8cb84cce18762e8f86a70bd6a49a66ab964c ]
Alexei found that verifier does not reject stores into context
via BPF_ST instead of BPF_STX. And while looking at it, we
also should not allow XADD variant of BPF_STX.
The context rewriter is only assuming either BPF_LDX_MEM- or
BPF_STX_MEM-type operations, thus reject anything other than
that so that assumptions in the rewriter properly hold. Add
test cases as well for BPF selftests.
Fixes: d691f9e8d4 ("bpf: allow programs to write to certain skb fields")
Reported-by: Alexei Starovoitov <ast@kernel.org >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-02-03 17:04:25 +01:00
..
2018-02-03 17:04:25 +01:00
2016-09-24 10:07:42 +02:00
2017-12-16 10:33:49 +01:00
2017-10-21 17:09:02 +02:00
2018-01-23 19:50:10 +01:00
2017-06-26 07:13:10 +02:00
2015-11-11 17:36:04 +01:00
2018-01-17 09:35:27 +01:00
2017-10-12 11:27:35 +02:00
2017-02-23 17:43:10 +01:00
2017-10-18 09:20:41 +02:00
2018-01-31 12:06:07 +01:00
2018-01-31 12:06:12 +01:00
2018-01-23 19:50:16 +01:00
2015-10-21 15:18:35 +01:00
2018-01-10 09:27:08 +01:00
2015-08-06 16:14:53 -04:00
2015-11-04 08:23:51 -05:00
2017-08-24 17:02:35 -07:00
2017-12-16 10:33:56 +01:00
2015-11-04 08:23:51 -05:00
2015-11-04 08:23:51 -05:00
2016-08-20 18:09:22 +02:00
2017-01-06 11:16:14 +01:00
2015-12-03 10:18:21 -05:00
2015-12-03 10:18:21 -05:00
2017-04-21 09:30:04 +02:00
2015-11-10 12:06:23 +01:00
2015-09-03 02:42:20 +02:00
2017-01-12 11:22:48 +01:00
2017-10-12 11:27:35 +02:00
2016-09-15 08:27:49 +02:00
2016-06-07 18:14:35 -07:00
2017-07-21 07:44:56 +02:00
2018-01-05 15:44:23 +01:00
2016-02-25 12:01:16 -08:00
2018-01-23 19:50:14 +01:00
2018-01-10 09:27:10 +01:00
2015-11-23 09:44:58 +01:00
2017-12-16 10:33:55 +01:00
2016-02-25 12:01:16 -08:00
2015-11-06 17:50:42 -08:00
2016-09-24 10:07:36 +02:00
2015-09-10 13:29:01 -07:00
2015-11-06 17:50:42 -08:00
2015-10-23 17:55:10 +09:00
2017-05-25 14:30:17 +02:00
2015-09-10 13:29:01 -07:00
2017-04-21 09:30:04 +02:00
2015-09-11 15:21:34 -07:00
2017-03-12 06:37:26 +01:00
2017-01-19 20:17:18 +01:00
2015-10-21 15:18:36 +01:00
2018-01-10 09:27:14 +01:00
2015-09-01 08:40:25 -07:00
2017-05-20 14:27:02 +02:00
2017-07-05 14:37:19 +02:00
2015-11-09 15:53:39 -08:00
2017-05-25 14:30:11 +02:00
2017-08-24 17:02:36 -07:00
2015-09-08 15:35:28 -07:00
2017-06-14 13:16:20 +02:00
2015-09-10 13:29:01 -07:00
2017-08-06 19:19:42 -07:00
2017-10-05 09:41:46 +02:00
2018-01-10 09:27:11 +01:00
2015-11-06 17:50:42 -08:00
2015-10-20 10:23:55 +02:00
2015-12-12 10:15:34 -08:00
2015-11-05 19:34:48 -08:00
2016-02-25 12:01:25 -08:00
2016-04-12 09:08:58 -07:00
2017-10-05 09:41:47 +02:00
2015-09-05 13:46:58 -07:00
2015-10-06 11:25:01 -07:00
2015-10-25 21:33:54 -04:00
2018-01-10 09:27:10 +01:00
2015-09-04 16:54:41 -07:00
2017-01-06 11:16:16 +01:00
2017-11-15 17:13:11 +01:00
2017-12-16 10:33:52 +01:00