From: Greg Kroah-Hartman Date: Thu, 21 Nov 2019 21:35:44 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v5.3.13~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a859983e1718f194992e61b7c182297ee855527b;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: fbdev-ditch-fb_edid_add_monspecs.patch ipv4-reset-rt_iif-for-recirculated-mcast-bcast-out-pkts.patch --- diff --git a/queue-4.14/fbdev-ditch-fb_edid_add_monspecs.patch b/queue-4.14/fbdev-ditch-fb_edid_add_monspecs.patch new file mode 100644 index 00000000000..7f873305a90 --- /dev/null +++ b/queue-4.14/fbdev-ditch-fb_edid_add_monspecs.patch @@ -0,0 +1,237 @@ +From 3b8720e63f4a1fc6f422a49ecbaa3b59c86d5aaf Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Sun, 21 Jul 2019 22:19:56 +0200 +Subject: fbdev: Ditch fb_edid_add_monspecs + +From: Daniel Vetter + +commit 3b8720e63f4a1fc6f422a49ecbaa3b59c86d5aaf upstream. + +It's dead code ever since + +commit 34280340b1dc74c521e636f45cd728f9abf56ee2 +Author: Geert Uytterhoeven +Date: Fri Dec 4 17:01:43 2015 +0100 + + fbdev: Remove unused SH-Mobile HDMI driver + +Also with this gone we can remove the cea_modes db. This entire thing +is massively incomplete anyway, compared to the CEA parsing that +drm_edid.c does. + +Acked-by: Linus Torvalds +Cc: Tavis Ormandy +Signed-off-by: Daniel Vetter +Signed-off-by: Bartlomiej Zolnierkiewicz +Link: https://patchwork.freedesktop.org/patch/msgid/20190721201956.941-1-daniel.vetter@ffwll.ch +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/video/fbdev/core/fbmon.c | 95 -------------------------------------- + drivers/video/fbdev/core/modedb.c | 57 ---------------------- + include/linux/fb.h | 3 - + 3 files changed, 155 deletions(-) + +--- a/drivers/video/fbdev/core/fbmon.c ++++ b/drivers/video/fbdev/core/fbmon.c +@@ -997,97 +997,6 @@ void fb_edid_to_monspecs(unsigned char * + DPRINTK("========================================\n"); + } + +-/** +- * fb_edid_add_monspecs() - add monitor video modes from E-EDID data +- * @edid: 128 byte array with an E-EDID block +- * @spacs: monitor specs to be extended +- */ +-void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs) +-{ +- unsigned char *block; +- struct fb_videomode *m; +- int num = 0, i; +- u8 svd[64], edt[(128 - 4) / DETAILED_TIMING_DESCRIPTION_SIZE]; +- u8 pos = 4, svd_n = 0; +- +- if (!edid) +- return; +- +- if (!edid_checksum(edid)) +- return; +- +- if (edid[0] != 0x2 || +- edid[2] < 4 || edid[2] > 128 - DETAILED_TIMING_DESCRIPTION_SIZE) +- return; +- +- DPRINTK(" Short Video Descriptors\n"); +- +- while (pos < edid[2]) { +- u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7; +- pr_debug("Data block %u of %u bytes\n", type, len); +- if (type == 2) { +- for (i = pos; i < pos + len; i++) { +- u8 idx = edid[pos + i] & 0x7f; +- svd[svd_n++] = idx; +- pr_debug("N%sative mode #%d\n", +- edid[pos + i] & 0x80 ? "" : "on-n", idx); +- } +- } else if (type == 3 && len >= 3) { +- /* Check Vendor Specific Data Block. For HDMI, +- it is always 00-0C-03 for HDMI Licensing, LLC. */ +- if (edid[pos + 1] == 3 && edid[pos + 2] == 0xc && +- edid[pos + 3] == 0) +- specs->misc |= FB_MISC_HDMI; +- } +- pos += len + 1; +- } +- +- block = edid + edid[2]; +- +- DPRINTK(" Extended Detailed Timings\n"); +- +- for (i = 0; i < (128 - edid[2]) / DETAILED_TIMING_DESCRIPTION_SIZE; +- i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) +- if (PIXEL_CLOCK != 0) +- edt[num++] = block - edid; +- +- /* Yikes, EDID data is totally useless */ +- if (!(num + svd_n)) +- return; +- +- m = kzalloc((specs->modedb_len + num + svd_n) * +- sizeof(struct fb_videomode), GFP_KERNEL); +- +- if (!m) +- return; +- +- memcpy(m, specs->modedb, specs->modedb_len * sizeof(struct fb_videomode)); +- +- for (i = specs->modedb_len; i < specs->modedb_len + num; i++) { +- get_detailed_timing(edid + edt[i - specs->modedb_len], &m[i]); +- if (i == specs->modedb_len) +- m[i].flag |= FB_MODE_IS_FIRST; +- pr_debug("Adding %ux%u@%u\n", m[i].xres, m[i].yres, m[i].refresh); +- } +- +- for (i = specs->modedb_len + num; i < specs->modedb_len + num + svd_n; i++) { +- int idx = svd[i - specs->modedb_len - num]; +- if (!idx || idx >= ARRAY_SIZE(cea_modes)) { +- pr_warn("Reserved SVD code %d\n", idx); +- } else if (!cea_modes[idx].xres) { +- pr_warn("Unimplemented SVD code %d\n", idx); +- } else { +- memcpy(&m[i], cea_modes + idx, sizeof(m[i])); +- pr_debug("Adding SVD #%d: %ux%u@%u\n", idx, +- m[i].xres, m[i].yres, m[i].refresh); +- } +- } +- +- kfree(specs->modedb); +- specs->modedb = m; +- specs->modedb_len = specs->modedb_len + num + svd_n; +-} +- + /* + * VESA Generalized Timing Formula (GTF) + */ +@@ -1497,9 +1406,6 @@ int fb_parse_edid(unsigned char *edid, s + void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs) + { + } +-void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs) +-{ +-} + void fb_destroy_modedb(struct fb_videomode *modedb) + { + } +@@ -1607,7 +1513,6 @@ EXPORT_SYMBOL(fb_firmware_edid); + + EXPORT_SYMBOL(fb_parse_edid); + EXPORT_SYMBOL(fb_edid_to_monspecs); +-EXPORT_SYMBOL(fb_edid_add_monspecs); + EXPORT_SYMBOL(fb_get_mode); + EXPORT_SYMBOL(fb_validate_mode); + EXPORT_SYMBOL(fb_destroy_modedb); +--- a/drivers/video/fbdev/core/modedb.c ++++ b/drivers/video/fbdev/core/modedb.c +@@ -289,63 +289,6 @@ static const struct fb_videomode modedb[ + }; + + #ifdef CONFIG_FB_MODE_HELPERS +-const struct fb_videomode cea_modes[65] = { +- /* #1: 640x480p@59.94/60Hz */ +- [1] = { +- NULL, 60, 640, 480, 39722, 48, 16, 33, 10, 96, 2, 0, +- FB_VMODE_NONINTERLACED, 0, +- }, +- /* #3: 720x480p@59.94/60Hz */ +- [3] = { +- NULL, 60, 720, 480, 37037, 60, 16, 30, 9, 62, 6, 0, +- FB_VMODE_NONINTERLACED, 0, +- }, +- /* #5: 1920x1080i@59.94/60Hz */ +- [5] = { +- NULL, 60, 1920, 1080, 13763, 148, 88, 15, 2, 44, 5, +- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, +- FB_VMODE_INTERLACED, 0, +- }, +- /* #7: 720(1440)x480iH@59.94/60Hz */ +- [7] = { +- NULL, 60, 1440, 480, 18554/*37108*/, 114, 38, 15, 4, 124, 3, 0, +- FB_VMODE_INTERLACED, 0, +- }, +- /* #9: 720(1440)x240pH@59.94/60Hz */ +- [9] = { +- NULL, 60, 1440, 240, 18554, 114, 38, 16, 4, 124, 3, 0, +- FB_VMODE_NONINTERLACED, 0, +- }, +- /* #18: 720x576pH@50Hz */ +- [18] = { +- NULL, 50, 720, 576, 37037, 68, 12, 39, 5, 64, 5, 0, +- FB_VMODE_NONINTERLACED, 0, +- }, +- /* #19: 1280x720p@50Hz */ +- [19] = { +- NULL, 50, 1280, 720, 13468, 220, 440, 20, 5, 40, 5, +- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, +- FB_VMODE_NONINTERLACED, 0, +- }, +- /* #20: 1920x1080i@50Hz */ +- [20] = { +- NULL, 50, 1920, 1080, 13480, 148, 528, 15, 5, 528, 5, +- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, +- FB_VMODE_INTERLACED, 0, +- }, +- /* #32: 1920x1080p@23.98/24Hz */ +- [32] = { +- NULL, 24, 1920, 1080, 13468, 148, 638, 36, 4, 44, 5, +- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, +- FB_VMODE_NONINTERLACED, 0, +- }, +- /* #35: (2880)x480p4x@59.94/60Hz */ +- [35] = { +- NULL, 60, 2880, 480, 9250, 240, 64, 30, 9, 248, 6, 0, +- FB_VMODE_NONINTERLACED, 0, +- }, +-}; +- + const struct fb_videomode vesa_modes[] = { + /* 0 640x350-85 VESA */ + { NULL, 85, 640, 350, 31746, 96, 32, 60, 32, 64, 3, +--- a/include/linux/fb.h ++++ b/include/linux/fb.h +@@ -725,8 +725,6 @@ extern int fb_parse_edid(unsigned char * + extern const unsigned char *fb_firmware_edid(struct device *device); + extern void fb_edid_to_monspecs(unsigned char *edid, + struct fb_monspecs *specs); +-extern void fb_edid_add_monspecs(unsigned char *edid, +- struct fb_monspecs *specs); + extern void fb_destroy_modedb(struct fb_videomode *modedb); + extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); + extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); +@@ -800,7 +798,6 @@ struct dmt_videomode { + + extern const char *fb_mode_option; + extern const struct fb_videomode vesa_modes[]; +-extern const struct fb_videomode cea_modes[65]; + extern const struct dmt_videomode dmt_modes[]; + + struct fb_modelist { diff --git a/queue-4.14/ipv4-reset-rt_iif-for-recirculated-mcast-bcast-out-pkts.patch b/queue-4.14/ipv4-reset-rt_iif-for-recirculated-mcast-bcast-out-pkts.patch new file mode 100644 index 00000000000..82bc3099fc8 --- /dev/null +++ b/queue-4.14/ipv4-reset-rt_iif-for-recirculated-mcast-bcast-out-pkts.patch @@ -0,0 +1,108 @@ +From 5b18f1289808fee5d04a7e6ecf200189f41a4db6 Mon Sep 17 00:00:00 2001 +From: Stephen Suryaputra +Date: Wed, 26 Jun 2019 02:21:16 -0400 +Subject: ipv4: reset rt_iif for recirculated mcast/bcast out pkts + +From: Stephen Suryaputra + +commit 5b18f1289808fee5d04a7e6ecf200189f41a4db6 upstream. + +Multicast or broadcast egress packets have rt_iif set to the oif. These +packets might be recirculated back as input and lookup to the raw +sockets may fail because they are bound to the incoming interface +(skb_iif). If rt_iif is not zero, during the lookup, inet_iif() function +returns rt_iif instead of skb_iif. Hence, the lookup fails. + +v2: Make it non vrf specific (David Ahern). Reword the changelog to + reflect it. +Signed-off-by: Stephen Suryaputra +Reviewed-by: David Ahern +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + include/net/route.h | 1 + + net/ipv4/ip_output.c | 12 ++++++++++++ + net/ipv4/route.c | 33 +++++++++++++++++++++++++++++++++ + 3 files changed, 46 insertions(+) + +--- a/include/net/route.h ++++ b/include/net/route.h +@@ -223,6 +223,7 @@ void ip_rt_get_source(u8 *src, struct sk + struct rtable *rt_dst_alloc(struct net_device *dev, + unsigned int flags, u16 type, + bool nopolicy, bool noxfrm, bool will_cache); ++struct rtable *rt_dst_clone(struct net_device *dev, struct rtable *rt); + + struct in_ifaddr; + void fib_add_ifaddr(struct in_ifaddr *); +--- a/net/ipv4/ip_output.c ++++ b/net/ipv4/ip_output.c +@@ -320,6 +320,7 @@ static int ip_finish_output(struct net * + static int ip_mc_finish_output(struct net *net, struct sock *sk, + struct sk_buff *skb) + { ++ struct rtable *new_rt; + int ret; + + ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb); +@@ -328,6 +329,17 @@ static int ip_mc_finish_output(struct ne + return ret; + } + ++ /* Reset rt_iif so that inet_iif() will return skb->skb_iif. Setting ++ * this to non-zero causes ipi_ifindex in in_pktinfo to be overwritten, ++ * see ipv4_pktinfo_prepare(). ++ */ ++ new_rt = rt_dst_clone(net->loopback_dev, skb_rtable(skb)); ++ if (new_rt) { ++ new_rt->rt_iif = 0; ++ skb_dst_drop(skb); ++ skb_dst_set(skb, &new_rt->dst); ++ } ++ + return dev_loopback_xmit(net, sk, skb); + } + +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -1607,6 +1607,39 @@ struct rtable *rt_dst_alloc(struct net_d + } + EXPORT_SYMBOL(rt_dst_alloc); + ++struct rtable *rt_dst_clone(struct net_device *dev, struct rtable *rt) ++{ ++ struct rtable *new_rt; ++ ++ new_rt = dst_alloc(&ipv4_dst_ops, dev, 1, DST_OBSOLETE_FORCE_CHK, ++ rt->dst.flags); ++ ++ if (new_rt) { ++ new_rt->rt_genid = rt_genid_ipv4(dev_net(dev)); ++ new_rt->rt_flags = rt->rt_flags; ++ new_rt->rt_type = rt->rt_type; ++ new_rt->rt_is_input = rt->rt_is_input; ++ new_rt->rt_iif = rt->rt_iif; ++ new_rt->rt_pmtu = rt->rt_pmtu; ++ new_rt->rt_mtu_locked = rt->rt_mtu_locked; ++ new_rt->rt_gw_family = rt->rt_gw_family; ++ if (rt->rt_gw_family == AF_INET) ++ new_rt->rt_gw4 = rt->rt_gw4; ++ else if (rt->rt_gw_family == AF_INET6) ++ new_rt->rt_gw6 = rt->rt_gw6; ++ INIT_LIST_HEAD(&new_rt->rt_uncached); ++ ++ new_rt->dst.flags |= DST_HOST; ++ new_rt->dst.input = rt->dst.input; ++ new_rt->dst.output = rt->dst.output; ++ new_rt->dst.error = rt->dst.error; ++ new_rt->dst.lastuse = jiffies; ++ new_rt->dst.lwtstate = lwtstate_get(rt->dst.lwtstate); ++ } ++ return new_rt; ++} ++EXPORT_SYMBOL(rt_dst_clone); ++ + /* called in rcu_read_lock() section */ + int ip_mc_validate_source(struct sk_buff *skb, __be32 daddr, __be32 saddr, + u8 tos, struct net_device *dev, diff --git a/queue-4.14/series b/queue-4.14/series index 9fcbc2e5cc9..d36a7840d2e 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -6,3 +6,5 @@ idr-fix-idr_get_next-race-with-idr_remove.patch mm-memory_hotplug-don-t-access-uninitialized-memmaps-in-shrink_pgdat_span.patch mm-memory_hotplug-fix-updating-the-node-span.patch arm64-uaccess-ensure-pan-is-re-enabled-after-unhandled-uaccess-fault.patch +fbdev-ditch-fb_edid_add_monspecs.patch +ipv4-reset-rt_iif-for-recirculated-mcast-bcast-out-pkts.patch