diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-24 12:46:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-24 12:46:54 -0500 |
commit | 5394cd218735bf462e72bb827fbb7e47fc15f2f0 (patch) | |
tree | bdbc64d378a015fd921d2adc1cac49752f3121f1 | |
parent | 6f3776c9cd03998f0e6d11774a03aa1788b4e463 (diff) | |
parent | 8e6f195af0e1f226e9b2e0256af8df46adb9d595 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] Fix oops when Windows server sent bad domain name null terminator
[CIFS] cifs sprintf fix
[CIFS] Remove 2 unneeded kzalloc casts
[CIFS] Update CIFS version number
-rw-r--r-- | fs/cifs/CHANGES | 4 | ||||
-rw-r--r-- | fs/cifs/cifs_debug.c | 4 | ||||
-rw-r--r-- | fs/cifs/cifsfs.h | 2 | ||||
-rw-r--r-- | fs/cifs/misc.c | 8 | ||||
-rw-r--r-- | fs/cifs/sess.c | 13 |
5 files changed, 17 insertions, 14 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 3539d6ef9611..d04d2f7448d9 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -1,3 +1,7 @@ | |||
1 | Version 1.47 | ||
2 | ------------ | ||
3 | Fix oops in list_del during mount caused by unaligned string. | ||
4 | |||
1 | Version 1.46 | 5 | Version 1.46 |
2 | ------------ | 6 | ------------ |
3 | Support deep tree mounts. Better support OS/2, Win9x (DOS) time stamps. | 7 | Support deep tree mounts. Better support OS/2, Win9x (DOS) time stamps. |
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 96abeb738978..6017c465440e 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -143,8 +143,8 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
143 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); | 143 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); |
144 | if((ses->serverDomain == NULL) || (ses->serverOS == NULL) || | 144 | if((ses->serverDomain == NULL) || (ses->serverOS == NULL) || |
145 | (ses->serverNOS == NULL)) { | 145 | (ses->serverNOS == NULL)) { |
146 | buf += sprintf("\nentry for %s not fully displayed\n\t", | 146 | buf += sprintf(buf, "\nentry for %s not fully " |
147 | ses->serverName); | 147 | "displayed\n\t", ses->serverName); |
148 | 148 | ||
149 | } else { | 149 | } else { |
150 | length = | 150 | length = |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index a243f779b363..8aa66dcf13bd 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -100,5 +100,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t); | |||
100 | extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); | 100 | extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); |
101 | extern int cifs_ioctl (struct inode * inode, struct file * filep, | 101 | extern int cifs_ioctl (struct inode * inode, struct file * filep, |
102 | unsigned int command, unsigned long arg); | 102 | unsigned int command, unsigned long arg); |
103 | #define CIFS_VERSION "1.46" | 103 | #define CIFS_VERSION "1.47" |
104 | #endif /* _CIFSFS_H */ | 104 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index aedf683f011f..19cc294c7c70 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -71,9 +71,7 @@ sesInfoAlloc(void) | |||
71 | { | 71 | { |
72 | struct cifsSesInfo *ret_buf; | 72 | struct cifsSesInfo *ret_buf; |
73 | 73 | ||
74 | ret_buf = | 74 | ret_buf = kzalloc(sizeof (struct cifsSesInfo), GFP_KERNEL); |
75 | (struct cifsSesInfo *) kzalloc(sizeof (struct cifsSesInfo), | ||
76 | GFP_KERNEL); | ||
77 | if (ret_buf) { | 75 | if (ret_buf) { |
78 | write_lock(&GlobalSMBSeslock); | 76 | write_lock(&GlobalSMBSeslock); |
79 | atomic_inc(&sesInfoAllocCount); | 77 | atomic_inc(&sesInfoAllocCount); |
@@ -109,9 +107,7 @@ struct cifsTconInfo * | |||
109 | tconInfoAlloc(void) | 107 | tconInfoAlloc(void) |
110 | { | 108 | { |
111 | struct cifsTconInfo *ret_buf; | 109 | struct cifsTconInfo *ret_buf; |
112 | ret_buf = | 110 | ret_buf = kzalloc(sizeof (struct cifsTconInfo), GFP_KERNEL); |
113 | (struct cifsTconInfo *) kzalloc(sizeof (struct cifsTconInfo), | ||
114 | GFP_KERNEL); | ||
115 | if (ret_buf) { | 111 | if (ret_buf) { |
116 | write_lock(&GlobalSMBSeslock); | 112 | write_lock(&GlobalSMBSeslock); |
117 | atomic_inc(&tconInfoAllocCount); | 113 | atomic_inc(&tconInfoAllocCount); |
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index bbdda99dce61..758464630893 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -182,11 +182,14 @@ static int decode_unicode_ssetup(char ** pbcc_area, int bleft, struct cifsSesInf | |||
182 | cFYI(1,("bleft %d",bleft)); | 182 | cFYI(1,("bleft %d",bleft)); |
183 | 183 | ||
184 | 184 | ||
185 | /* word align, if bytes remaining is not even */ | 185 | /* SMB header is unaligned, so cifs servers word align start of |
186 | if(bleft % 2) { | 186 | Unicode strings */ |
187 | bleft--; | 187 | data++; |
188 | data++; | 188 | bleft--; /* Windows servers do not always double null terminate |
189 | } | 189 | their final Unicode string - in which case we |
190 | now will not attempt to decode the byte of junk | ||
191 | which follows it */ | ||
192 | |||
190 | words_left = bleft / 2; | 193 | words_left = bleft / 2; |
191 | 194 | ||
192 | /* save off server operating system */ | 195 | /* save off server operating system */ |