From 375799657fc8f3beaa88692c9736c764cda2be99 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 30 Mar 2020 14:22:51 +0200 Subject: [PATCH] 4.19-stable patches added patches: arm-dts-dra7-add-bus_dma_limit-for-l3-bus.patch arm-dts-omap5-add-bus_dma_limit-for-l3-bus.patch ceph-check-pool_flag_full-nearfull-in-addition-to-osdmap_full-nearfull.patch mac80211-check-port-authorization-in-the-ieee80211_tx_dequeue-case.patch mac80211-mark-station-unauthorized-before-key-removal.patch nl80211-fix-nl80211_attr_channel_width-attribute-type.patch perf-probe-do-not-depend-on-dwfl_module_addrsym.patch scripts-dtc-remove-redundant-yyloc-global-declaration.patch scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch tools-let-o-makes-handle-a-relative-path-with-c-option.patch --- ...ts-dra7-add-bus_dma_limit-for-l3-bus.patch | 45 ++++++ ...s-omap5-add-bus_dma_limit-for-l3-bus.patch | 38 +++++ ...-in-addition-to-osdmap_full-nearfull.patch | 133 ++++++++++++++++++ ...ion-in-the-ieee80211_tx_dequeue-case.patch | 56 ++++++++ ...tion-unauthorized-before-key-removal.patch | 46 ++++++ ...11_attr_channel_width-attribute-type.patch | 37 +++++ ...do-not-depend-on-dwfl_module_addrsym.patch | 63 +++++++++ ...e-redundant-yyloc-global-declaration.patch | 52 +++++++ ...-devices-that-change-reported-values.patch | 54 +++++++ queue-4.19/series | 10 ++ ...handle-a-relative-path-with-c-option.patch | 72 ++++++++++ 11 files changed, 606 insertions(+) create mode 100644 queue-4.19/arm-dts-dra7-add-bus_dma_limit-for-l3-bus.patch create mode 100644 queue-4.19/arm-dts-omap5-add-bus_dma_limit-for-l3-bus.patch create mode 100644 queue-4.19/ceph-check-pool_flag_full-nearfull-in-addition-to-osdmap_full-nearfull.patch create mode 100644 queue-4.19/mac80211-check-port-authorization-in-the-ieee80211_tx_dequeue-case.patch create mode 100644 queue-4.19/mac80211-mark-station-unauthorized-before-key-removal.patch create mode 100644 queue-4.19/nl80211-fix-nl80211_attr_channel_width-attribute-type.patch create mode 100644 queue-4.19/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch create mode 100644 queue-4.19/scripts-dtc-remove-redundant-yyloc-global-declaration.patch create mode 100644 queue-4.19/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch create mode 100644 queue-4.19/tools-let-o-makes-handle-a-relative-path-with-c-option.patch diff --git a/queue-4.19/arm-dts-dra7-add-bus_dma_limit-for-l3-bus.patch b/queue-4.19/arm-dts-dra7-add-bus_dma_limit-for-l3-bus.patch new file mode 100644 index 00000000000..45ce6d70395 --- /dev/null +++ b/queue-4.19/arm-dts-dra7-add-bus_dma_limit-for-l3-bus.patch @@ -0,0 +1,45 @@ +From cfb5d65f25959f724081bae8445a0241db606af6 Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Fri, 13 Mar 2020 11:47:17 +0200 +Subject: ARM: dts: dra7: Add bus_dma_limit for L3 bus + +From: Roger Quadros + +commit cfb5d65f25959f724081bae8445a0241db606af6 upstream. + +The L3 interconnect's memory map is from 0x0 to +0xffffffff. Out of this, System memory (SDRAM) can be +accessed from 0x80000000 to 0xffffffff (2GB) + +DRA7 does support 4GB of SDRAM but upper 2GB can only be +accessed by the MPU subsystem. + +Add the dma-ranges property to reflect the physical address limit +of the L3 bus. + +Issues ere observed only with SATA on DRA7-EVM with 4GB RAM +and CONFIG_ARM_LPAE enabled. This is because the controller +supports 64-bit DMA and its driver sets the dma_mask to 64-bit +thus resulting in DMA accesses beyond L3 limit of 2G. + +Setting the correct bus_dma_limit fixes the issue. + +Signed-off-by: Roger Quadros +Cc: stable@kernel.org +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/dra7.dtsi | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/dra7.dtsi ++++ b/arch/arm/boot/dts/dra7.dtsi +@@ -150,6 +150,7 @@ + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x0 0xc0000000>; ++ dma-ranges = <0x80000000 0x0 0x80000000 0x80000000>; + ti,hwmods = "l3_main_1", "l3_main_2"; + reg = <0x0 0x44000000 0x0 0x1000000>, + <0x0 0x45000000 0x0 0x1000>; diff --git a/queue-4.19/arm-dts-omap5-add-bus_dma_limit-for-l3-bus.patch b/queue-4.19/arm-dts-omap5-add-bus_dma_limit-for-l3-bus.patch new file mode 100644 index 00000000000..68d21119dc5 --- /dev/null +++ b/queue-4.19/arm-dts-omap5-add-bus_dma_limit-for-l3-bus.patch @@ -0,0 +1,38 @@ +From dfa7ea303f56a3a8b1ed3b91ef35af2da67ca4ee Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Mon, 16 Mar 2020 12:27:31 +0200 +Subject: ARM: dts: omap5: Add bus_dma_limit for L3 bus + +From: Roger Quadros + +commit dfa7ea303f56a3a8b1ed3b91ef35af2da67ca4ee upstream. + +The L3 interconnect's memory map is from 0x0 to +0xffffffff. Out of this, System memory (SDRAM) can be +accessed from 0x80000000 to 0xffffffff (2GB) + +OMAP5 does support 4GB of SDRAM but upper 2GB can only be +accessed by the MPU subsystem. + +Add the dma-ranges property to reflect the physical address limit +of the L3 bus. + +Cc: stable@kernel.org +Signed-off-by: Roger Quadros +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/omap5.dtsi | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/omap5.dtsi ++++ b/arch/arm/boot/dts/omap5.dtsi +@@ -144,6 +144,7 @@ + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0xc0000000>; ++ dma-ranges = <0x80000000 0x0 0x80000000 0x80000000>; + ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; + reg = <0 0x44000000 0 0x2000>, + <0 0x44800000 0 0x3000>, diff --git a/queue-4.19/ceph-check-pool_flag_full-nearfull-in-addition-to-osdmap_full-nearfull.patch b/queue-4.19/ceph-check-pool_flag_full-nearfull-in-addition-to-osdmap_full-nearfull.patch new file mode 100644 index 00000000000..0f7c0d0c53d --- /dev/null +++ b/queue-4.19/ceph-check-pool_flag_full-nearfull-in-addition-to-osdmap_full-nearfull.patch @@ -0,0 +1,133 @@ +From 7614209736fbc4927584d4387faade4f31444fce Mon Sep 17 00:00:00 2001 +From: Ilya Dryomov +Date: Mon, 9 Mar 2020 12:03:14 +0100 +Subject: ceph: check POOL_FLAG_FULL/NEARFULL in addition to OSDMAP_FULL/NEARFULL + +From: Ilya Dryomov + +commit 7614209736fbc4927584d4387faade4f31444fce upstream. + +CEPH_OSDMAP_FULL/NEARFULL aren't set since mimic, so we need to consult +per-pool flags as well. Unfortunately the backwards compatibility here +is lacking: + +- the change that deprecated OSDMAP_FULL/NEARFULL went into mimic, but + was guarded by require_osd_release >= RELEASE_LUMINOUS +- it was subsequently backported to luminous in v12.2.2, but that makes + no difference to clients that only check OSDMAP_FULL/NEARFULL because + require_osd_release is not client-facing -- it is for OSDs + +Since all kernels are affected, the best we can do here is just start +checking both map flags and pool flags and send that to stable. + +These checks are best effort, so take osdc->lock and look up pool flags +just once. Remove the FIXME, since filesystem quotas are checked above +and RADOS quotas are reflected in POOL_FLAG_FULL: when the pool reaches +its quota, both POOL_FLAG_FULL and POOL_FLAG_FULL_QUOTA are set. + +Cc: stable@vger.kernel.org +Reported-by: Yanhu Cao +Signed-off-by: Ilya Dryomov +Reviewed-by: Jeff Layton +Acked-by: Sage Weil +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ceph/file.c | 14 +++++++++++--- + include/linux/ceph/osdmap.h | 4 ++++ + include/linux/ceph/rados.h | 6 ++++-- + net/ceph/osdmap.c | 9 +++++++++ + 4 files changed, 28 insertions(+), 5 deletions(-) + +--- a/fs/ceph/file.c ++++ b/fs/ceph/file.c +@@ -1384,9 +1384,12 @@ static ssize_t ceph_write_iter(struct ki + struct inode *inode = file_inode(file); + struct ceph_inode_info *ci = ceph_inode(inode); + struct ceph_fs_client *fsc = ceph_inode_to_client(inode); ++ struct ceph_osd_client *osdc = &fsc->client->osdc; + struct ceph_cap_flush *prealloc_cf; + ssize_t count, written = 0; + int err, want, got; ++ u32 map_flags; ++ u64 pool_flags; + loff_t pos; + loff_t limit = max(i_size_read(inode), fsc->max_file_size); + +@@ -1441,8 +1444,12 @@ retry_snap: + goto out; + } + +- /* FIXME: not complete since it doesn't account for being at quota */ +- if (ceph_osdmap_flag(&fsc->client->osdc, CEPH_OSDMAP_FULL)) { ++ down_read(&osdc->lock); ++ map_flags = osdc->osdmap->flags; ++ pool_flags = ceph_pg_pool_flags(osdc->osdmap, ci->i_layout.pool_id); ++ up_read(&osdc->lock); ++ if ((map_flags & CEPH_OSDMAP_FULL) || ++ (pool_flags & CEPH_POOL_FLAG_FULL)) { + err = -ENOSPC; + goto out; + } +@@ -1532,7 +1539,8 @@ retry_snap: + } + + if (written >= 0) { +- if (ceph_osdmap_flag(&fsc->client->osdc, CEPH_OSDMAP_NEARFULL)) ++ if ((map_flags & CEPH_OSDMAP_NEARFULL) || ++ (pool_flags & CEPH_POOL_FLAG_NEARFULL)) + iocb->ki_flags |= IOCB_DSYNC; + written = generic_write_sync(iocb, written); + } +--- a/include/linux/ceph/osdmap.h ++++ b/include/linux/ceph/osdmap.h +@@ -37,6 +37,9 @@ int ceph_spg_compare(const struct ceph_s + #define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id + together */ + #define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */ ++#define CEPH_POOL_FLAG_FULL_QUOTA (1ULL << 10) /* pool ran out of quota, ++ will set FULL too */ ++#define CEPH_POOL_FLAG_NEARFULL (1ULL << 11) /* pool is nearfull */ + + struct ceph_pg_pool_info { + struct rb_node node; +@@ -305,5 +308,6 @@ extern struct ceph_pg_pool_info *ceph_pg + + extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); + extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); ++u64 ceph_pg_pool_flags(struct ceph_osdmap *map, u64 id); + + #endif +--- a/include/linux/ceph/rados.h ++++ b/include/linux/ceph/rados.h +@@ -143,8 +143,10 @@ extern const char *ceph_osd_state_name(i + /* + * osd map flag bits + */ +-#define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC) */ +-#define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC) */ ++#define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC), ++ not set since ~luminous */ ++#define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC), ++ not set since ~luminous */ + #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ + #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ + #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ +--- a/net/ceph/osdmap.c ++++ b/net/ceph/osdmap.c +@@ -711,6 +711,15 @@ int ceph_pg_poolid_by_name(struct ceph_o + } + EXPORT_SYMBOL(ceph_pg_poolid_by_name); + ++u64 ceph_pg_pool_flags(struct ceph_osdmap *map, u64 id) ++{ ++ struct ceph_pg_pool_info *pi; ++ ++ pi = __lookup_pg_pool(&map->pg_pools, id); ++ return pi ? pi->flags : 0; ++} ++EXPORT_SYMBOL(ceph_pg_pool_flags); ++ + static void __remove_pg_pool(struct rb_root *root, struct ceph_pg_pool_info *pi) + { + rb_erase(&pi->node, root); diff --git a/queue-4.19/mac80211-check-port-authorization-in-the-ieee80211_tx_dequeue-case.patch b/queue-4.19/mac80211-check-port-authorization-in-the-ieee80211_tx_dequeue-case.patch new file mode 100644 index 00000000000..064f9cd7158 --- /dev/null +++ b/queue-4.19/mac80211-check-port-authorization-in-the-ieee80211_tx_dequeue-case.patch @@ -0,0 +1,56 @@ +From ce2e1ca703071723ca2dd94d492a5ab6d15050da Mon Sep 17 00:00:00 2001 +From: Jouni Malinen +Date: Thu, 26 Mar 2020 15:51:34 +0100 +Subject: mac80211: Check port authorization in the ieee80211_tx_dequeue() case + +From: Jouni Malinen + +commit ce2e1ca703071723ca2dd94d492a5ab6d15050da upstream. + +mac80211 used to check port authorization in the Data frame enqueue case +when going through start_xmit(). However, that authorization status may +change while the frame is waiting in a queue. Add a similar check in the +dequeue case to avoid sending previously accepted frames after +authorization change. This provides additional protection against +potential leaking of frames after a station has been disconnected and +the keys for it are being removed. + +Cc: stable@vger.kernel.org +Signed-off-by: Jouni Malinen +Link: https://lore.kernel.org/r/20200326155133.ced84317ea29.I34d4c47cd8cc8a4042b38a76f16a601fbcbfd9b3@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/tx.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3511,8 +3511,25 @@ begin: + tx.skb = skb; + tx.sdata = vif_to_sdata(info->control.vif); + +- if (txq->sta) ++ if (txq->sta) { + tx.sta = container_of(txq->sta, struct sta_info, sta); ++ /* ++ * Drop unicast frames to unauthorised stations unless they are ++ * EAPOL frames from the local station. ++ */ ++ if (unlikely(!ieee80211_vif_is_mesh(&tx.sdata->vif) && ++ tx.sdata->vif.type != NL80211_IFTYPE_OCB && ++ !is_multicast_ether_addr(hdr->addr1) && ++ !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) && ++ (!(info->control.flags & ++ IEEE80211_TX_CTRL_PORT_CTRL_PROTO) || ++ !ether_addr_equal(tx.sdata->vif.addr, ++ hdr->addr2)))) { ++ I802_DEBUG_INC(local->tx_handlers_drop_unauth_port); ++ ieee80211_free_txskb(&local->hw, skb); ++ goto begin; ++ } ++ } + + /* + * The key can be removed while the packet was queued, so need to call diff --git a/queue-4.19/mac80211-mark-station-unauthorized-before-key-removal.patch b/queue-4.19/mac80211-mark-station-unauthorized-before-key-removal.patch new file mode 100644 index 00000000000..bff96fa413b --- /dev/null +++ b/queue-4.19/mac80211-mark-station-unauthorized-before-key-removal.patch @@ -0,0 +1,46 @@ +From b16798f5b907733966fd1a558fca823b3c67e4a1 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Thu, 26 Mar 2020 15:51:35 +0100 +Subject: mac80211: mark station unauthorized before key removal + +From: Johannes Berg + +commit b16798f5b907733966fd1a558fca823b3c67e4a1 upstream. + +If a station is still marked as authorized, mark it as no longer +so before removing its keys. This allows frames transmitted to it +to be rejected, providing additional protection against leaking +plain text data during the disconnection flow. + +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200326155133.ccb4fb0bb356.If48f0f0504efdcf16b8921f48c6d3bb2cb763c99@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/sta_info.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -3,7 +3,7 @@ + * Copyright 2006-2007 Jiri Benc + * Copyright 2013-2014 Intel Mobile Communications GmbH + * Copyright (C) 2015 - 2017 Intel Deutschland GmbH +- * Copyright (C) 2018 Intel Corporation ++ * Copyright (C) 2018-2020 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as +@@ -979,6 +979,11 @@ static void __sta_info_destroy_part2(str + might_sleep(); + lockdep_assert_held(&local->sta_mtx); + ++ while (sta->sta_state == IEEE80211_STA_AUTHORIZED) { ++ ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); ++ WARN_ON_ONCE(ret); ++ } ++ + /* now keys can no longer be reached */ + ieee80211_free_sta_keys(local, sta); + diff --git a/queue-4.19/nl80211-fix-nl80211_attr_channel_width-attribute-type.patch b/queue-4.19/nl80211-fix-nl80211_attr_channel_width-attribute-type.patch new file mode 100644 index 00000000000..e802944c8de --- /dev/null +++ b/queue-4.19/nl80211-fix-nl80211_attr_channel_width-attribute-type.patch @@ -0,0 +1,37 @@ +From 0016d3201753b59f3ae84b868fe66c86ad256f19 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Wed, 25 Mar 2020 09:05:32 +0100 +Subject: nl80211: fix NL80211_ATTR_CHANNEL_WIDTH attribute type + +From: Johannes Berg + +commit 0016d3201753b59f3ae84b868fe66c86ad256f19 upstream. + +The new opmode notification used this attribute with a u8, when +it's documented as a u32 and indeed used in userspace as such, +it just happens to work on little-endian systems since userspace +isn't doing any strict size validation, and the u8 goes into the +lower byte. Fix this. + +Cc: stable@vger.kernel.org +Fixes: 466b9936bf93 ("cfg80211: Add support to notify station's opmode change to userspace") +Signed-off-by: Johannes Berg +Link: https://lore.kernel.org/r/20200325090531.be124f0a11c7.Iedbf4e197a85471ebd729b186d5365c0343bf7a8@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/wireless/nl80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -15607,7 +15607,7 @@ void cfg80211_sta_opmode_change_notify(s + goto nla_put_failure; + + if ((sta_opmode->changed & STA_OPMODE_MAX_BW_CHANGED) && +- nla_put_u8(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw)) ++ nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw)) + goto nla_put_failure; + + if ((sta_opmode->changed & STA_OPMODE_N_SS_CHANGED) && diff --git a/queue-4.19/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch b/queue-4.19/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch new file mode 100644 index 00000000000..4a38382351e --- /dev/null +++ b/queue-4.19/perf-probe-do-not-depend-on-dwfl_module_addrsym.patch @@ -0,0 +1,63 @@ +From 1efde2754275dbd9d11c6e0132a4f09facf297ab Mon Sep 17 00:00:00 2001 +From: Masami Hiramatsu +Date: Fri, 28 Feb 2020 00:42:01 +0900 +Subject: perf probe: Do not depend on dwfl_module_addrsym() + +From: Masami Hiramatsu + +commit 1efde2754275dbd9d11c6e0132a4f09facf297ab upstream. + +Do not depend on dwfl_module_addrsym() because it can fail on user-space +shared libraries. + +Actually, same bug was fixed by commit 664fee3dc379 ("perf probe: Do not +use dwfl_module_addrsym if dwarf_diename finds symbol name"), but commit +07d369857808 ("perf probe: Fix wrong address verification) reverted to +get actual symbol address from symtab. + +This fixes it again by getting symbol address from DIE, and only if the +DIE has only address range, it uses dwfl_module_addrsym(). + +Fixes: 07d369857808 ("perf probe: Fix wrong address verification) +Reported-by: Alexandre Ghiti +Signed-off-by: Masami Hiramatsu +Tested-by: Alexandre Ghiti +Cc: Alexander Shishkin +Cc: Greg Kroah-Hartman +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Sasha Levin +Link: http://lore.kernel.org/lkml/158281812176.476.14164573830975116234.stgit@devnote2 +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/probe-finder.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/tools/perf/util/probe-finder.c ++++ b/tools/perf/util/probe-finder.c +@@ -623,14 +623,19 @@ static int convert_to_trace_point(Dwarf_ + return -EINVAL; + } + +- /* Try to get actual symbol name from symtab */ +- symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); ++ if (dwarf_entrypc(sp_die, &eaddr) == 0) { ++ /* If the DIE has entrypc, use it. */ ++ symbol = dwarf_diename(sp_die); ++ } else { ++ /* Try to get actual symbol name and address from symtab */ ++ symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); ++ eaddr = sym.st_value; ++ } + if (!symbol) { + pr_warning("Failed to find symbol at 0x%lx\n", + (unsigned long)paddr); + return -ENOENT; + } +- eaddr = sym.st_value; + + tp->offset = (unsigned long)(paddr - eaddr); + tp->address = (unsigned long)paddr; diff --git a/queue-4.19/scripts-dtc-remove-redundant-yyloc-global-declaration.patch b/queue-4.19/scripts-dtc-remove-redundant-yyloc-global-declaration.patch new file mode 100644 index 00000000000..55dbb87370e --- /dev/null +++ b/queue-4.19/scripts-dtc-remove-redundant-yyloc-global-declaration.patch @@ -0,0 +1,52 @@ +From e33a814e772cdc36436c8c188d8c42d019fda639 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Tue, 14 Jan 2020 18:53:41 +0100 +Subject: scripts/dtc: Remove redundant YYLOC global declaration + +From: Dirk Mueller + +commit e33a814e772cdc36436c8c188d8c42d019fda639 upstream. + +gcc 10 will default to -fno-common, which causes this error at link +time: + + (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here + +This is because both dtc-lexer as well as dtc-parser define the same +global symbol yyloc. Before with -fcommon those were merged into one +defintion. The proper solution would be to to mark this as "extern", +however that leads to: + + dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls] + 26 | extern YYLTYPE yylloc; + | ^~~~~~ +In file included from dtc-lexer.l:24: +dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here + 127 | extern YYLTYPE yylloc; + | ^~~~~~ +cc1: all warnings being treated as errors + +which means the declaration is completely redundant and can just be +dropped. + +Signed-off-by: Dirk Mueller +Signed-off-by: David Gibson +[robh: cherry-pick from upstream] +Cc: stable@vger.kernel.org +Signed-off-by: Rob Herring +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/dtc/dtc-lexer.l | 1 - + 1 file changed, 1 deletion(-) + +--- a/scripts/dtc/dtc-lexer.l ++++ b/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ diff --git a/queue-4.19/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch b/queue-4.19/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch new file mode 100644 index 00000000000..4bbf4a37243 --- /dev/null +++ b/queue-4.19/scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch @@ -0,0 +1,54 @@ +From ea697a8bf5a4161e59806fab14f6e4a46dc7dcb0 Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Tue, 24 Mar 2020 11:16:15 -0400 +Subject: scsi: sd: Fix optimal I/O size for devices that change reported values + +From: Martin K. Petersen + +commit ea697a8bf5a4161e59806fab14f6e4a46dc7dcb0 upstream. + +Some USB bridge devices will return a default set of characteristics during +initialization. And then, once an attached drive has spun up, substitute +the actual parameters reported by the drive. According to the SCSI spec, +the device should return a UNIT ATTENTION in case any reported parameters +change. But in this case the change is made silently after a small window +where default values are reported. + +Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of +physical block size") validated the reported optimal I/O size against the +physical block size to overcome problems with devices reporting nonsensical +transfer sizes. However, this validation did not account for the fact that +aforementioned devices will return default values during a brief window +during spin-up. The subsequent change in reported characteristics would +invalidate the checking that had previously been performed. + +Unset a previously configured optimal I/O size should the sanity checking +fail on subsequent revalidate attempts. + +Link: https://lore.kernel.org/r/33fb522e-4f61-1b76-914f-c9e6a3553c9b@gmail.com +Cc: Bryan Gurney +Cc: +Reported-by: Bernhard Sulzer +Tested-by: Bernhard Sulzer +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/sd.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -3210,9 +3210,11 @@ static int sd_revalidate_disk(struct gen + if (sd_validate_opt_xfer_size(sdkp, dev_max)) { + q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); + rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); +- } else ++ } else { ++ q->limits.io_opt = 0; + rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), + (sector_t)BLK_DEF_MAX_SECTORS); ++ } + + /* Do not exceed controller limit */ + rw_max = min(rw_max, queue_max_hw_sectors(q)); diff --git a/queue-4.19/series b/queue-4.19/series index 1a972ec13e9..d73b7e816d4 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -48,3 +48,13 @@ i2c-hix5hd2-add-missed-clk_disable_unprepare-in-remove.patch input-raydium_i2c_ts-fix-error-codes-in-raydium_i2c_boot_trigger.patch input-synaptics-enable-rmi-on-hp-envy-13-ad105ng.patch input-avoid-bit-macro-usage-in-the-serio.h-uapi-header.patch +ceph-check-pool_flag_full-nearfull-in-addition-to-osdmap_full-nearfull.patch +arm-dts-dra7-add-bus_dma_limit-for-l3-bus.patch +arm-dts-omap5-add-bus_dma_limit-for-l3-bus.patch +perf-probe-do-not-depend-on-dwfl_module_addrsym.patch +tools-let-o-makes-handle-a-relative-path-with-c-option.patch +scripts-dtc-remove-redundant-yyloc-global-declaration.patch +scsi-sd-fix-optimal-i-o-size-for-devices-that-change-reported-values.patch +nl80211-fix-nl80211_attr_channel_width-attribute-type.patch +mac80211-check-port-authorization-in-the-ieee80211_tx_dequeue-case.patch +mac80211-mark-station-unauthorized-before-key-removal.patch diff --git a/queue-4.19/tools-let-o-makes-handle-a-relative-path-with-c-option.patch b/queue-4.19/tools-let-o-makes-handle-a-relative-path-with-c-option.patch new file mode 100644 index 00000000000..d8f098302ee --- /dev/null +++ b/queue-4.19/tools-let-o-makes-handle-a-relative-path-with-c-option.patch @@ -0,0 +1,72 @@ +From be40920fbf1003c38ccdc02b571e01a75d890c82 Mon Sep 17 00:00:00 2001 +From: Masami Hiramatsu +Date: Sat, 7 Mar 2020 03:32:58 +0900 +Subject: tools: Let O= makes handle a relative path with -C option + +From: Masami Hiramatsu + +commit be40920fbf1003c38ccdc02b571e01a75d890c82 upstream. + +When I tried to compile tools/perf from the top directory with the -C +option, the O= option didn't work correctly if I passed a relative path: + + $ make O=BUILD -C tools/perf/ + make: Entering directory '/home/mhiramat/ksrc/linux/tools/perf' + BUILD: Doing 'make -j8' parallel build + ../scripts/Makefile.include:4: *** O=/home/mhiramat/ksrc/linux/tools/perf/BUILD does not exist. Stop. + make: *** [Makefile:70: all] Error 2 + make: Leaving directory '/home/mhiramat/ksrc/linux/tools/perf' + +The O= directory existence check failed because the check script ran in +the build target directory instead of the directory where I ran the make +command. + +To fix that, once change directory to $(PWD) and check O= directory, +since the PWD is set to where the make command runs. + +Fixes: c883122acc0d ("perf tools: Let O= makes handle relative paths") +Reported-by: Randy Dunlap +Signed-off-by: Masami Hiramatsu +Cc: Andrew Morton +Cc: Borislav Petkov +Cc: Geert Uytterhoeven +Cc: Jiri Olsa +Cc: Masahiro Yamada +Cc: Michal Marek +Cc: Peter Zijlstra +Cc: Sasha Levin +Cc: Steven Rostedt (VMware) +Cc: stable@vger.kernel.org +Link: http://lore.kernel.org/lkml/158351957799.3363.15269768530697526765.stgit@devnote2 +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/Makefile | 2 +- + tools/scripts/Makefile.include | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/tools/perf/Makefile ++++ b/tools/perf/Makefile +@@ -35,7 +35,7 @@ endif + # Only pass canonical directory names as the output directory: + # + ifneq ($(O),) +- FULL_O := $(shell readlink -f $(O) || echo $(O)) ++ FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O)) + endif + + # +--- a/tools/scripts/Makefile.include ++++ b/tools/scripts/Makefile.include +@@ -1,8 +1,8 @@ + # SPDX-License-Identifier: GPL-2.0 + ifneq ($(O),) + ifeq ($(origin O), command line) +- dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) +- ABSOLUTE_O := $(shell cd $(O) ; pwd) ++ dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) ++ ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/) + COMMAND_O := O=$(ABSOLUTE_O) + ifeq ($(objtree),) -- 2.47.3