From fc3e586ae06332a2cb9824c2e2fb143726e719f7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 17 Nov 2020 13:19:22 +0100 Subject: [PATCH] 4.19-stable patches added patches: convert-trailing-spaces-and-periods-in-path-components.patch net-sch_generic-fix-the-missing-new-qdisc-assignment-bug.patch --- ...paces-and-periods-in-path-components.patch | 43 ++++++++++++++++++ ...the-missing-new-qdisc-assignment-bug.patch | 44 +++++++++++++++++++ queue-4.19/series | 2 + 3 files changed, 89 insertions(+) create mode 100644 queue-4.19/convert-trailing-spaces-and-periods-in-path-components.patch create mode 100644 queue-4.19/net-sch_generic-fix-the-missing-new-qdisc-assignment-bug.patch diff --git a/queue-4.19/convert-trailing-spaces-and-periods-in-path-components.patch b/queue-4.19/convert-trailing-spaces-and-periods-in-path-components.patch new file mode 100644 index 00000000000..f064fe6ebf5 --- /dev/null +++ b/queue-4.19/convert-trailing-spaces-and-periods-in-path-components.patch @@ -0,0 +1,43 @@ +From 57c176074057531b249cf522d90c22313fa74b0b Mon Sep 17 00:00:00 2001 +From: Boris Protopopov +Date: Thu, 24 Sep 2020 00:36:38 +0000 +Subject: Convert trailing spaces and periods in path components + +From: Boris Protopopov + +commit 57c176074057531b249cf522d90c22313fa74b0b upstream. + +When converting trailing spaces and periods in paths, do so +for every component of the path, not just the last component. +If the conversion is not done for every path component, then +subsequent operations in directories with trailing spaces or +periods (e.g. create(), mkdir()) will fail with ENOENT. This +is because on the server, the directory will have a special +symbol in its name, and the client needs to provide the same. + +Signed-off-by: Boris Protopopov +Acked-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/cifs_unicode.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/fs/cifs/cifs_unicode.c ++++ b/fs/cifs/cifs_unicode.c +@@ -501,7 +501,13 @@ cifsConvertToUTF16(__le16 *target, const + else if (map_chars == SFM_MAP_UNI_RSVD) { + bool end_of_string; + +- if (i == srclen - 1) ++ /** ++ * Remap spaces and periods found at the end of every ++ * component of the path. The special cases of '.' and ++ * '..' do not need to be dealt with explicitly because ++ * they are addressed in namei.c:link_path_walk(). ++ **/ ++ if ((i == srclen - 1) || (source[i+1] == '\\')) + end_of_string = true; + else + end_of_string = false; diff --git a/queue-4.19/net-sch_generic-fix-the-missing-new-qdisc-assignment-bug.patch b/queue-4.19/net-sch_generic-fix-the-missing-new-qdisc-assignment-bug.patch new file mode 100644 index 00000000000..e1373aa1949 --- /dev/null +++ b/queue-4.19/net-sch_generic-fix-the-missing-new-qdisc-assignment-bug.patch @@ -0,0 +1,44 @@ +From linyunsheng@huawei.com Tue Nov 17 13:08:29 2020 +From: Yunsheng Lin +Date: Tue, 3 Nov 2020 11:25:38 +0800 +Subject: net: sch_generic: fix the missing new qdisc assignment bug +To: , +Cc: , , , , , , , , , , , , , +Message-ID: <1604373938-211588-1-git-send-email-linyunsheng@huawei.com> + + +When commit 2fb541c862c9 ("net: sch_generic: aviod concurrent reset and +enqueue op for lockless qdisc") is backported to stable kernel, one +assignment is missing, which causes two problems reported by Joakim and +Vishwanath, see [1] and [2]. + +So add the assignment back to fix it. + +1. https://www.spinics.net/lists/netdev/msg693916.html +2. https://www.spinics.net/lists/netdev/msg695131.html + +Fixes: 749cc0b0c7f3 ("net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc") +Signed-off-by: Yunsheng Lin +Acked-by: Jakub Kicinski +Tested-by: Brian Norris +Signed-off-by: Greg Kroah-Hartman +--- + net/sched/sch_generic.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -1116,10 +1116,13 @@ static void dev_deactivate_queue(struct + void *_qdisc_default) + { + struct Qdisc *qdisc = rtnl_dereference(dev_queue->qdisc); ++ struct Qdisc *qdisc_default = _qdisc_default; + + if (qdisc) { + if (!(qdisc->flags & TCQ_F_BUILTIN)) + set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); ++ ++ rcu_assign_pointer(dev_queue->qdisc, qdisc_default); + } + } + diff --git a/queue-4.19/series b/queue-4.19/series index 09569d674e5..e944bea76d3 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -97,3 +97,5 @@ perf-scripting-python-avoid-declaring-function-pointers-with-a-visibility-attrib perf-core-fix-race-in-the-perf_mmap_close-function.patch revert-kernel-reboot.c-convert-simple_strtoul-to-kstrtoint.patch reboot-fix-overflow-parsing-reboot-cpu-number.patch +net-sch_generic-fix-the-missing-new-qdisc-assignment-bug.patch +convert-trailing-spaces-and-periods-in-path-components.patch -- 2.47.3