git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f4ff3b
)
s3: Limit the number of unexpected packets per client to 10
author
Volker Lendecke
<vl@samba.org>
Wed, 5 Jan 2011 13:34:04 +0000
(14:34 +0100)
committer
Volker Lendecke
<vl@samba.org>
Fri, 7 Jan 2011 12:28:07 +0000
(13:28 +0100)
Non-reading clients could maliciously make nmbd allocate memory
source3/libsmb/unexpected.c
patch
|
blob
|
history
diff --git
a/source3/libsmb/unexpected.c
b/source3/libsmb/unexpected.c
index ce1e31dc59feefd6da6e84a3072b78c46accb5f2..7ec5800e69af468be643cba8062e5201656f27d6 100644
(file)
--- a/
source3/libsmb/unexpected.c
+++ b/
source3/libsmb/unexpected.c
@@
-672,6
+672,14
@@
static void nb_packet_client_send(struct nb_packet_client *client,
struct nb_packet_client_state *state;
struct tevent_req *req;
+ if (tevent_queue_length(client->out_queue) > 10) {
+ /*
+ * Skip clients that don't listen anyway, some form of DoS
+ * protection
+ */
+ return;
+ }
+
state = TALLOC_ZERO_P(client, struct nb_packet_client_state);
if (state == NULL) {
DEBUG(10, ("talloc failed\n"));