Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Linus Torvalds committed Jan 24, 2007
2 parents 6f3776c + 8e6f195 commit 5394cd2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
4 changes: 4 additions & 0 deletions fs/cifs/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 1.47
------------
Fix oops in list_del during mount caused by unaligned string.

Version 1.46
------------
Support deep tree mounts. Better support OS/2, Win9x (DOS) time stamps.
Expand Down
4 changes: 2 additions & 2 deletions fs/cifs/cifs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList);
if((ses->serverDomain == NULL) || (ses->serverOS == NULL) ||
(ses->serverNOS == NULL)) {
buf += sprintf("\nentry for %s not fully displayed\n\t",
ses->serverName);
buf += sprintf(buf, "\nentry for %s not fully "
"displayed\n\t", ses->serverName);

} else {
length =
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
extern int cifs_ioctl (struct inode * inode, struct file * filep,
unsigned int command, unsigned long arg);
#define CIFS_VERSION "1.46"
#define CIFS_VERSION "1.47"
#endif /* _CIFSFS_H */
8 changes: 2 additions & 6 deletions fs/cifs/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ sesInfoAlloc(void)
{
struct cifsSesInfo *ret_buf;

ret_buf =
(struct cifsSesInfo *) kzalloc(sizeof (struct cifsSesInfo),
GFP_KERNEL);
ret_buf = kzalloc(sizeof (struct cifsSesInfo), GFP_KERNEL);
if (ret_buf) {
write_lock(&GlobalSMBSeslock);
atomic_inc(&sesInfoAllocCount);
Expand Down Expand Up @@ -109,9 +107,7 @@ struct cifsTconInfo *
tconInfoAlloc(void)
{
struct cifsTconInfo *ret_buf;
ret_buf =
(struct cifsTconInfo *) kzalloc(sizeof (struct cifsTconInfo),
GFP_KERNEL);
ret_buf = kzalloc(sizeof (struct cifsTconInfo), GFP_KERNEL);
if (ret_buf) {
write_lock(&GlobalSMBSeslock);
atomic_inc(&tconInfoAllocCount);
Expand Down
13 changes: 8 additions & 5 deletions fs/cifs/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,14 @@ static int decode_unicode_ssetup(char ** pbcc_area, int bleft, struct cifsSesInf
cFYI(1,("bleft %d",bleft));


/* word align, if bytes remaining is not even */
if(bleft % 2) {
bleft--;
data++;
}
/* SMB header is unaligned, so cifs servers word align start of
Unicode strings */
data++;
bleft--; /* Windows servers do not always double null terminate
their final Unicode string - in which case we
now will not attempt to decode the byte of junk
which follows it */

words_left = bleft / 2;

/* save off server operating system */
Expand Down

0 comments on commit 5394cd2

Please sign in to comment.