The Samba-Bugzilla – Attachment 10307 Details for
Bug 10839
High CPU Load samba 4.1.12 possibly because of Notify Request problem w/ AutoCAD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix from Volker (modified).
look (text/plain), 3.67 KB, created by
Jeremy Allison
on 2014-09-25 23:42:44 UTC
(
hide
)
Description:
Fix from Volker (modified).
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2014-09-25 23:42:44 UTC
Size:
3.67 KB
patch
obsolete
>diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c >index 4842d6f..16266cc 100644 >--- a/source3/smbd/notify.c >+++ b/source3/smbd/notify.c >@@ -98,6 +98,14 @@ static bool notify_change_record_identical(struct notify_change *c1, > return False; > } > >+static int compare_notify_change_events(const void *p1, const void *p2) >+{ >+ const struct notify_change_event *e1 = p1; >+ const struct notify_change_event *e2 = p2; >+ >+ return timespec_compare(&e1->when, &e2->when); >+} >+ > static bool notify_marshall_changes(int num_changes, > uint32 max_offset, > struct notify_change *changes, >@@ -109,6 +117,14 @@ static bool notify_marshall_changes(int num_changes, > return false; > } > >+ /* >+ * Sort the notifies by timestamp when the event happened to avoid >+ * coalescing and thus dropping events. >+ */ >+ >+ qsort(changes, num_changes, >+ sizeof(*changes), compare_notify_change_events); >+ > for (i=0; i<num_changes; i++) { > enum ndr_err_code ndr_err; > struct notify_change *c; >diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c >index bbc838d..96226d6 100644 >--- a/source3/smbd/smb2_getinfo.c >+++ b/source3/smbd/smb2_getinfo.c >@@ -105,8 +105,17 @@ NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req) > return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); > } > >- status = smbd_smb2_request_verify_creditcharge(req, >- MAX(in_input_buffer.length,in_output_buffer_length)); >+ /* >+ * According to [MS-SMB2] 3.2.4.1.5 Sending Multi-Credit Requests: >+ * >+ * > For all other requests, the client MUST set CreditCharge to 1, even >+ * > if the payload size of a request or the anticipated response is >+ * > greater than 65536 >+ * >+ * we can only check for 1 credit and ignore in_output_buffer_length >+ * here. >+ */ >+ status = smbd_smb2_request_verify_creditcharge(req, 65536); > if (!NT_STATUS_IS_OK(status)) { > return smbd_smb2_request_error(req, status); > } >diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c >index c35acc5..18fdde7 100644 >--- a/source3/smbd/smb2_notify.c >+++ b/source3/smbd/smb2_notify.c >@@ -78,8 +78,17 @@ NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req) > return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); > } > >- status = smbd_smb2_request_verify_creditcharge(req, >- in_output_buffer_length); >+ /* >+ * According to [MS-SMB2] 3.2.4.1.5 Sending Multi-Credit Requests: >+ * >+ * > For all other requests, the client MUST set CreditCharge to 1, even >+ * > if the payload size of a request or the anticipated response is >+ * > greater than 65536 >+ * >+ * we can only check for 1 credit and ignore in_output_buffer_length >+ * here. >+ */ >+ status = smbd_smb2_request_verify_creditcharge(req, 65536); > > if (!NT_STATUS_IS_OK(status)) { > return smbd_smb2_request_error(req, status); >diff --git a/source3/smbd/smb2_setinfo.c b/source3/smbd/smb2_setinfo.c >index cda8abc..0f8148d 100644 >--- a/source3/smbd/smb2_setinfo.c >+++ b/source3/smbd/smb2_setinfo.c >@@ -89,8 +89,17 @@ NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req) > return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); > } > >- status = smbd_smb2_request_verify_creditcharge(req, >- in_input_buffer.length); >+ /* >+ * According to [MS-SMB2] 3.2.4.1.5 Sending Multi-Credit Requests: >+ * >+ * > For all other requests, the client MUST set CreditCharge to 1, even >+ * > if the payload size of a request or the anticipated response is >+ * > greater than 65536 >+ * >+ * we can only check for 1 credit and ignore in_output_buffer_length >+ * here. >+ */ >+ status = smbd_smb2_request_verify_creditcharge(req, 65536); > if (!NT_STATUS_IS_OK(status)) { > return smbd_smb2_request_error(req, status); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10839
:
10305
|
10307
|
10308
|
10708
|
10709