summaryrefslogtreecommitdiffstats
path: root/source/smbd/dnsregister.c
diff options
context:
space:
mode:
authorKarolin Seeger <kseeger@samba.org>2011-02-27 18:28:29 +0100
committerKarolin Seeger <kseeger@samba.org>2011-02-27 18:28:29 +0100
commit724e44eed299c618066dec411530aa9f156119ec (patch)
tree143e8ac3903ebff1b46382c5b0e89fc74a5d8eac /source/smbd/dnsregister.c
parent23ec2b1a988fff922864a03b6061c6bc2e584ce0 (diff)
downloadsamba-724e44eed299c618066dec411530aa9f156119ec.tar.gz
samba-724e44eed299c618066dec411530aa9f156119ec.tar.xz
samba-724e44eed299c618066dec411530aa9f156119ec.zip
Fix denial of service - memory corruption.
CVE-2011-0719 Fix bug #7949 (DoS in Winbind and smbd with many file descriptors open). All current released versions of Samba are vulnerable to a denial of service caused by memory corruption. Range checks on file descriptors being used in the FD_SET macro were not present allowing stack corruption. This can cause the Samba code to crash or to loop attempting to select on a bad file descriptor set. A connection to a file share, or a local account is needed to exploit this problem, either authenticated or unauthenticated (guest connection). Currently we do not believe this flaw is exploitable beyond a crash or causing the code to loop, but on the advice of our security reviewers we are releasing fixes in case an exploit is discovered at a later date.
Diffstat (limited to 'source/smbd/dnsregister.c')
-rw-r--r--source/smbd/dnsregister.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/smbd/dnsregister.c b/source/smbd/dnsregister.c
index f02739ef8df..3c689b9cf3e 100644
--- a/source/smbd/dnsregister.c
+++ b/source/smbd/dnsregister.c
@@ -125,6 +125,9 @@ void dns_register_smbd(struct dns_reg_state ** dns_state_ptr,
*/
if (dns_state->srv_ref != NULL) {
mdnsd_conn_fd = DNSServiceRefSockFD(dns_state->srv_ref);
+ if (mdnsd_conn_fd < 0 || mdnsd_conn_fd >= FD_SETSIZE) {
+ return;
+ }
FD_SET(mdnsd_conn_fd, listen_set);
return;
}
@@ -156,6 +159,9 @@ void dns_register_smbd(struct dns_reg_state ** dns_state_ptr,
}
mdnsd_conn_fd = DNSServiceRefSockFD(dns_state->srv_ref);
+ if (mdnsd_conn_fd < 0 || mdnsd_conn_fd >= FD_SETSIZE) {
+ return;
+ }
FD_SET(mdnsd_conn_fd, listen_set);
*maxfd = MAX(*maxfd, mdnsd_conn_fd);
*timeout = timeval_zero();