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