]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/cifs-fix-parsing-of-hostname-in-dfs-referrals.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / cifs-fix-parsing-of-hostname-in-dfs-referrals.patch
1 From ba03864872691c0bb580a7fb47388da337ef4aa2 Mon Sep 17 00:00:00 2001
2 From: Jeff Layton <jlayton@redhat.com>
3 Date: Tue, 30 Nov 2010 15:14:48 -0500
4 Subject: cifs: fix parsing of hostname in dfs referrals
5
6 From: Jeff Layton <jlayton@redhat.com>
7
8 commit ba03864872691c0bb580a7fb47388da337ef4aa2 upstream.
9
10 The DFS referral parsing code does a memchr() call to find the '\\'
11 delimiter that separates the hostname in the referral UNC from the
12 sharename. It then uses that value to set the length of the hostname via
13 pointer subtraction. Instead of subtracting the start of the hostname
14 however, it subtracts the start of the UNC, which causes the code to
15 pass in a hostname length that is 2 bytes too long.
16
17 Regression introduced in commit 1a4240f4.
18
19 Reported-and-Tested-by: Robbert Kouprie <robbert@exx.nl>
20 Signed-off-by: Jeff Layton <jlayton@redhat.com>
21 Cc: Wang Lei <wang840925@gmail.com>
22 Cc: David Howells <dhowells@redhat.com>
23 Signed-off-by: Steve French <sfrench@us.ibm.com>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
25
26 ---
27 fs/cifs/dns_resolve.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30 --- a/fs/cifs/dns_resolve.c
31 +++ b/fs/cifs/dns_resolve.c
32 @@ -66,7 +66,7 @@ dns_resolve_server_name_to_ip(const char
33 /* Search for server name delimiter */
34 sep = memchr(hostname, '\\', len);
35 if (sep)
36 - len = sep - unc;
37 + len = sep - hostname;
38 else
39 cFYI(1, "%s: probably server name is whole unc: %s",
40 __func__, unc);