From: Sasha Levin Date: Thu, 21 Mar 2019 05:47:46 +0000 (-0400) Subject: fixes for fixes for 4.19 X-Git-Tag: v3.18.137~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d1d37cb0c22e5c52c537897070af992ead95df8;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/bpf-only-test-gso-type-on-gso-packets.patch b/queue-4.19/bpf-only-test-gso-type-on-gso-packets.patch new file mode 100644 index 00000000000..c69e60b7619 --- /dev/null +++ b/queue-4.19/bpf-only-test-gso-type-on-gso-packets.patch @@ -0,0 +1,81 @@ +From f1fbe7fd6984e96f2a84bab9d47de7225db66581 Mon Sep 17 00:00:00 2001 +From: Willem de Bruijn +Date: Wed, 6 Mar 2019 14:35:15 -0500 +Subject: bpf: only test gso type on gso packets + +[ Upstream commit 4c3024debf62de4c6ac6d3cb4c0063be21d4f652 ] + +BPF can adjust gso only for tcp bytestreams. Fail on other gso types. + +But only on gso packets. It does not touch this field if !gso_size. + +Fixes: b90efd225874 ("bpf: only adjust gso_size on bytestream protocols") +Signed-off-by: Willem de Bruijn +Acked-by: Yonghong Song +Signed-off-by: Daniel Borkmann +Signed-off-by: Sasha Levin +--- + include/linux/skbuff.h | 4 ++-- + net/core/filter.c | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h +index 3b0a25bb7c6f..820903ceac4f 100644 +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -4086,10 +4086,10 @@ static inline bool skb_is_gso_sctp(const struct sk_buff *skb) + return skb_shinfo(skb)->gso_type & SKB_GSO_SCTP; + } + ++/* Note: Should be called only if skb_is_gso(skb) is true */ + static inline bool skb_is_gso_tcp(const struct sk_buff *skb) + { +- return skb_is_gso(skb) && +- skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); ++ return skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); + } + + static inline void skb_gso_reset(struct sk_buff *skb) +diff --git a/net/core/filter.c b/net/core/filter.c +index b1369edce113..eb81e9db4093 100644 +--- a/net/core/filter.c ++++ b/net/core/filter.c +@@ -2614,7 +2614,7 @@ static int bpf_skb_proto_4_to_6(struct sk_buff *skb) + u32 off = skb_mac_header_len(skb); + int ret; + +- if (!skb_is_gso_tcp(skb)) ++ if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) + return -ENOTSUPP; + + ret = skb_cow(skb, len_diff); +@@ -2655,7 +2655,7 @@ static int bpf_skb_proto_6_to_4(struct sk_buff *skb) + u32 off = skb_mac_header_len(skb); + int ret; + +- if (!skb_is_gso_tcp(skb)) ++ if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) + return -ENOTSUPP; + + ret = skb_unclone(skb, GFP_ATOMIC); +@@ -2780,7 +2780,7 @@ static int bpf_skb_net_grow(struct sk_buff *skb, u32 len_diff) + u32 off = skb_mac_header_len(skb) + bpf_skb_net_base_len(skb); + int ret; + +- if (!skb_is_gso_tcp(skb)) ++ if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) + return -ENOTSUPP; + + ret = skb_cow(skb, len_diff); +@@ -2809,7 +2809,7 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 len_diff) + u32 off = skb_mac_header_len(skb) + bpf_skb_net_base_len(skb); + int ret; + +- if (!skb_is_gso_tcp(skb)) ++ if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) + return -ENOTSUPP; + + ret = skb_unclone(skb, GFP_ATOMIC); +-- +2.19.1 + diff --git a/queue-4.19/can-flexcan-flexcan_iflag_mb-add-around-macro-argume.patch b/queue-4.19/can-flexcan-flexcan_iflag_mb-add-around-macro-argume.patch new file mode 100644 index 00000000000..8080d2541c4 --- /dev/null +++ b/queue-4.19/can-flexcan-flexcan_iflag_mb-add-around-macro-argume.patch @@ -0,0 +1,34 @@ +From 571bbe1ac2c2f0ac5e3a819e2479be3523245386 Mon Sep 17 00:00:00 2001 +From: Marc Kleine-Budde +Date: Wed, 28 Nov 2018 15:31:37 +0100 +Subject: can: flexcan: FLEXCAN_IFLAG_MB: add () around macro argument + +[ Upstream commit 22233f7bf2c99ef52ec19d30876a12d2f725972e ] + +This patch fixes the following checkpatch warning: + +| Macro argument 'x' may be better as '(x)' to avoid precedence issues + +Fixes: cbffaf7aa09e ("can: flexcan: Always use last mailbox for TX") +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Sasha Levin +--- + drivers/net/can/flexcan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c +index ae219b8a7754..2646faffd36e 100644 +--- a/drivers/net/can/flexcan.c ++++ b/drivers/net/can/flexcan.c +@@ -140,7 +140,7 @@ + #define FLEXCAN_TX_MB 63 + #define FLEXCAN_RX_MB_OFF_TIMESTAMP_FIRST (FLEXCAN_TX_MB_RESERVED_OFF_TIMESTAMP + 1) + #define FLEXCAN_RX_MB_OFF_TIMESTAMP_LAST (FLEXCAN_TX_MB - 1) +-#define FLEXCAN_IFLAG_MB(x) BIT(x & 0x1f) ++#define FLEXCAN_IFLAG_MB(x) BIT((x) & 0x1f) + #define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW BIT(7) + #define FLEXCAN_IFLAG_RX_FIFO_WARN BIT(6) + #define FLEXCAN_IFLAG_RX_FIFO_AVAILABLE BIT(5) +-- +2.19.1 + diff --git a/queue-4.19/drm-i915-relax-mmap-vma-check.patch b/queue-4.19/drm-i915-relax-mmap-vma-check.patch new file mode 100644 index 00000000000..8601bcb8a5e --- /dev/null +++ b/queue-4.19/drm-i915-relax-mmap-vma-check.patch @@ -0,0 +1,50 @@ +From 3b99fdca0c85219f9576c3b378441d1531d3ec69 Mon Sep 17 00:00:00 2001 +From: Tvrtko Ursulin +Date: Tue, 5 Mar 2019 11:04:08 +0000 +Subject: drm/i915: Relax mmap VMA check + +[ Upstream commit ca22f32a6296cbfa29de56328c8505560a18cfa8 ] + +Legacy behaviour was to allow non-page-aligned mmap requests, as does the +linux mmap(2) implementation by virtue of automatically rounding up for +the caller. + +To avoid breaking legacy userspace relax the newly introduced fix. + +Signed-off-by: Tvrtko Ursulin +Fixes: 5c4604e757ba ("drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set") +Reported-by: Guenter Roeck +Cc: Adam Zabrocki +Cc: Joonas Lahtinen +Cc: # v4.0+ +Cc: Akash Goel +Cc: Chris Wilson +Cc: Jani Nikula +Cc: Rodrigo Vivi +Cc: intel-gfx@lists.freedesktop.org +Reviewed-by: Chris Wilson +Link: https://patchwork.freedesktop.org/patch/msgid/20190305110409.28633-1-tvrtko.ursulin@linux.intel.com +(cherry picked from commit a90e1948efb648f567444f87f3c19b2a0787affd) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/i915/i915_gem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c +index 280c851714e6..03cda197fb6b 100644 +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -1828,7 +1828,8 @@ __vma_matches(struct vm_area_struct *vma, struct file *filp, + if (vma->vm_file != filp) + return false; + +- return vma->vm_start == addr && (vma->vm_end - vma->vm_start) == size; ++ return vma->vm_start == addr && ++ (vma->vm_end - vma->vm_start) == PAGE_ALIGN(size); + } + + /** +-- +2.19.1 + diff --git a/queue-4.19/series b/queue-4.19/series index e5bd4d016a9..4b820fa3a13 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -207,3 +207,6 @@ parport_pc-fix-find_superio-io-compare-code-should-use-equal-test.patch i2c-tegra-fix-maximum-transfer-size.patch media-i2c-ov5640-fix-post-reset-delay.patch gpio-pca953x-fix-dereference-of-irq-data-in-shutdown.patch +can-flexcan-flexcan_iflag_mb-add-around-macro-argume.patch +drm-i915-relax-mmap-vma-check.patch +bpf-only-test-gso-type-on-gso-packets.patch