Changeset 746 for vendor/current/source3/smbd/process.c
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/process.c
r740 r746 452 452 p_unread, &len); 453 453 if (!NT_STATUS_IS_OK(status)) { 454 DEBUG(1, ("read_smb_length_return_keepalive failed for " 455 "client %s read error = %s.\n", 456 sconn->client_id.addr, nt_errstr(status))); 454 DEBUG(NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)?5:1, 455 ("receive_smb_raw_talloc failed for client %s " 456 "read error = %s.\n", 457 sconn->client_id.addr, nt_errstr(status))); 457 458 return status; 458 459 } … … 1442 1443 /* Make sure this is an SMB packet. smb_size contains NetBIOS header 1443 1444 * so subtract 4 from it. */ 1444 if ( !valid_smb_header(req->inbuf)1445 || (size < (smb_size - 4))) {1445 if ((size < (smb_size - 4)) || 1446 !valid_smb_header(req->inbuf)) { 1446 1447 DEBUG(2,("Non-SMB packet of length %d. Terminating server\n", 1447 1448 smb_len(req->inbuf))); … … 2089 2090 2090 2091 /* 2091 * Check if the client tries to fool us. The request so far uses the 2092 * space to the end of the byte buffer in the request just 2093 * processed. The chain_offset can't point into that area. If that was 2094 * the case, we could end up with an endless processing of the chain, 2095 * we would always handle the same request. 2092 * Check if the client tries to fool us. The chain offset 2093 * needs to point beyond the current request in the chain, it 2094 * needs to strictly grow. Otherwise we might be tricked into 2095 * an endless loop always processing the same request over and 2096 * over again. We used to assume that vwv and the byte buffer 2097 * array in a chain are always attached, but OS/2 the 2098 * Write&X/Read&X chain puts the Read&X vwv array right behind 2099 * the Write&X vwv chain. The Write&X bcc array is put behind 2100 * the Read&X vwv array. So now we check whether the chain 2101 * offset points strictly behind the previous vwv 2102 * array. req->buf points right after the vwv array of the 2103 * previous request. See 2104 * https://bugzilla.samba.org/show_bug.cgi?id=8360 for more 2105 * information. 2096 2106 */ 2097 2107 2098 already_used = PTR_DIFF(req->buf +req->buflen, smb_base(req->inbuf));2099 if (chain_offset < already_used) {2108 already_used = PTR_DIFF(req->buf, smb_base(req->inbuf)); 2109 if (chain_offset <= already_used) { 2100 2110 goto error; 2101 2111 } … … 2798 2808 * Handle SMBecho requests in a forked child process 2799 2809 */ 2800 staticbool fork_echo_handler(struct smbd_server_connection *sconn)2810 bool fork_echo_handler(struct smbd_server_connection *sconn) 2801 2811 { 2802 2812 int listener_pipe[2]; … … 2912 2922 int ret; 2913 2923 2914 if (lp_maxprotocol() == PROTOCOL_SMB2 && 2915 !lp_async_smb_echo_handler()) { 2924 if (lp_maxprotocol() == PROTOCOL_SMB2) { 2916 2925 /* 2917 2926 * We're not making the decision here, … … 3034 3043 } 3035 3044 3036 if (lp_async_smb_echo_handler() && !fork_echo_handler(sconn)) {3037 exit_server("Failed to fork echo handler");3038 }3039 3040 3045 /* Setup oplocks */ 3041 3046 if (!init_oplocks(sconn->msg_ctx))
Note:
See TracChangeset
for help on using the changeset viewer.