]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for fixes for 4.19
authorSasha Levin <sashal@kernel.org>
Thu, 21 Mar 2019 05:47:46 +0000 (01:47 -0400)
committerSasha Levin <sashal@kernel.org>
Thu, 21 Mar 2019 05:54:18 +0000 (01:54 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.19/bpf-only-test-gso-type-on-gso-packets.patch [new file with mode: 0644]
queue-4.19/can-flexcan-flexcan_iflag_mb-add-around-macro-argume.patch [new file with mode: 0644]
queue-4.19/drm-i915-relax-mmap-vma-check.patch [new file with mode: 0644]
queue-4.19/series

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 (file)
index 0000000..c69e60b
--- /dev/null
@@ -0,0 +1,81 @@
+From f1fbe7fd6984e96f2a84bab9d47de7225db66581 Mon Sep 17 00:00:00 2001
+From: Willem de Bruijn <willemb@google.com>
+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 <willemb@google.com>
+Acked-by: Yonghong Song <yhs@fb.com>
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 (file)
index 0000000..8080d25
--- /dev/null
@@ -0,0 +1,34 @@
+From 571bbe1ac2c2f0ac5e3a819e2479be3523245386 Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+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 <mkl@pengutronix.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 (file)
index 0000000..8601bcb
--- /dev/null
@@ -0,0 +1,50 @@
+From 3b99fdca0c85219f9576c3b378441d1531d3ec69 Mon Sep 17 00:00:00 2001
+From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
+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 <tvrtko.ursulin@intel.com>
+Fixes: 5c4604e757ba ("drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set")
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Cc: Adam Zabrocki <adamza@microsoft.com>
+Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
+Cc: <stable@vger.kernel.org> # v4.0+
+Cc: Akash Goel <akash.goel@intel.com>
+Cc: Chris Wilson <chris@chris-wilson.co.uk>
+Cc: Jani Nikula <jani.nikula@linux.intel.com>
+Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
+Cc: intel-gfx@lists.freedesktop.org
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+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 <rodrigo.vivi@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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
+
index e5bd4d016a919d479233d3b81928edfe1c802b48..4b820fa3a1333b403c847bbe598cb0570aa9d7c7 100644 (file)
@@ -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