diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-09-03 12:00:50 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-09-08 17:22:35 -0400 |
commit | 32670396e7fc6e4f37451a69339968985461a374 (patch) | |
tree | df01cb3461125f341d61bde1d527f575372803ef /fs/cifs/connect.c | |
parent | 7332f2a6217ee6925f83ef0e725013067ed316ba (diff) |
cifs: prevent possible memory corruption in cifs_demultiplex_thread
cifs_demultiplex_thread sets the addr.sockAddr.sin_port without any
regard for the socket family. While it may be that the error in question
here never occurs on an IPv6 socket, it's probably best to be safe and
set the port properly if it ever does.
Break the port setting code out of cifs_fill_sockaddr and into a new
function, and call that from cifs_demultiplex_thread.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5fde83f0c75e..67dad54fbfa1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -463,7 +463,8 @@ incomplete_rcv: | |||
463 | * is since we do not begin with RFC1001 session | 463 | * is since we do not begin with RFC1001 session |
464 | * initialize frame) | 464 | * initialize frame) |
465 | */ | 465 | */ |
466 | server->addr.sockAddr.sin_port = htons(CIFS_PORT); | 466 | cifs_set_port((struct sockaddr *) |
467 | &server->addr.sockAddr, CIFS_PORT); | ||
467 | cifs_reconnect(server); | 468 | cifs_reconnect(server); |
468 | csocket = server->ssocket; | 469 | csocket = server->ssocket; |
469 | wake_up(&server->response_q); | 470 | wake_up(&server->response_q); |