mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
s3: Limit the number of unexpected packets per client to 10
Non-reading clients could maliciously make nmbd allocate memory
This commit is contained in:
parent
5f4ff3bfbd
commit
0cff82e054
@ -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"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user