-
由 Thiago Rafael Becker 提交于
mainline inclusion from mainline-v5.16-rc6 commit a3108089 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6D6RL CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a31080899d5fdafcccf7f39dd214a814a2c82626 -------------------------------- mount.cifs can pass a device with multiple delimiters in it. This will cause rename(2) to fail with ENOENT. V2: - Make sanitize_path more readable. - Fix multiple delimiters between UNC and prepath. - Avoid a memory leak if a bad user starts putting a lot of delimiters in the path on purpose. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2031200 Fixes: 24e0a1ef ("cifs: switch to new mount api") Cc: stable@vger.kernel.org # 5.11+ Acked-by: NRonnie Sahlberg <lsahlber@redhat.com> Signed-off-by: NThiago Rafael Becker <trbecker@gmail.com> Signed-off-by: NSteve French <stfrench@microsoft.com> conflicts: fs/cifs/fs_context.c Signed-off-by: NZhaoLong Wang <wangzhaolong1@huawei.com> Reviewed-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
2c407019