Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 225171 Details for
Bug 301828
<net-proxy/squid-3.1.6-r1 DoS (CVE-2010-{0308,0639})
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated adapted-zph patch for offset changes
squid-3.0.25-adapted-zph.patch (text/plain), 6.87 KB, created by
Brian De Wolf
on 2010-03-24 23:39:46 UTC
(
hide
)
Description:
Updated adapted-zph patch for offset changes
Filename:
MIME Type:
Creator:
Brian De Wolf
Created:
2010-03-24 23:39:46 UTC
Size:
6.87 KB
patch
obsolete
>diff -ur squid-3.0.STABLE25.orig/src/cf.data.pre squid-3.0.STABLE25.zph/src/cf.data.pre >--- squid-3.0.STABLE25.orig/src/cf.data.pre 2010-03-13 21:45:43.000000000 -0800 >+++ squid-3.0.STABLE25.zph/src/cf.data.pre 2010-03-24 13:30:41.000000000 -0800 >@@ -1125,6 +1125,60 @@ > making the request. > DOC_END > >+NAME: zph_tos_local >+TYPE: int >+DEFAULT: 0 >+LOC: Config.zph_tos_local >+DOC_START >+ Allows you to select a TOS/Diffserv value to mark local hits. Read above >+ (tcp_outgoing_tos) for details/requirements about TOS. >+ Default: 0 (disabled). >+DOC_END >+ >+NAME: zph_tos_peer >+TYPE: int >+DEFAULT: 0 >+LOC: Config.zph_tos_peer >+DOC_START >+ Allows you to select a TOS/Diffserv value to mark peer hits. Read above >+ (tcp_outgoing_tos) for details/requirements about TOS. >+ Default: 0 (disabled). >+DOC_END >+ >+NAME: zph_tos_parent >+COMMENT: on|off >+TYPE: onoff >+LOC: Config.onoff.zph_tos_parent >+DEFAULT: on >+DOC_START >+ Set this to off if you want only sibling hits to be marked. >+ If set to on (default), parent hits are being marked too. >+DOC_END >+ >+NAME: zph_preserve_miss_tos >+COMMENT: on|off >+TYPE: onoff >+LOC: Config.onoff.zph_preserve_miss_tos >+DEFAULT: on >+DOC_START >+ If set to on (default), any HTTP response towards clients will >+ have the TOS value of the response comming from the remote >+ server masked with the value of zph_preserve_miss_tos_mask. >+ For this to work correctly, you will need to patch your linux >+ kernel with the TOS preserving ZPH patch. >+DOC_END >+ >+NAME: zph_preserve_miss_tos_mask >+TYPE: int >+DEFAULT: 255 >+LOC: Config.zph_preserve_miss_tos_mask >+DOC_START >+ Allows you to mask certain bits in the TOS received from the >+ remote server, before copying the value to the TOS send towards >+ clients. >+ Default: 255 (TOS from server is not changed). >+DOC_END >+ > NAME: tcp_outgoing_address > TYPE: acl_address > DEFAULT: none >Only in squid-3.0.STABLE25.zph/src: cf.data.pre.orig >diff -ur squid-3.0.STABLE25.orig/src/client_side_reply.cc squid-3.0.STABLE25.zph/src/client_side_reply.cc >--- squid-3.0.STABLE25.orig/src/client_side_reply.cc 2010-03-13 21:45:41.000000000 -0800 >+++ squid-3.0.STABLE25.zph/src/client_side_reply.cc 2010-03-24 13:30:41.000000000 -0800 >@@ -48,6 +48,7 @@ > #include "ESI.h" > #endif > #include "MemObject.h" >+#include "fde.h" > #include "ACLChecklist.h" > #include "ACL.h" > #if DELAY_POOLS >@@ -1549,6 +1550,11 @@ > /* guarantee nothing has been sent yet! */ > assert(http->out.size == 0); > assert(http->out.offset == 0); >+ if (Config.zph_tos_local) >+ { >+ debugs(33, 1, "ZPH hit hier.code=" << http->request->hier.code <<" TOS="<<Config.zph_tos_local); >+ comm_set_tos(http->getConn()->fd,Config.zph_tos_local); >+ } > tempBuffer.offset = reqofs; > tempBuffer.length = getNextNode()->readBuffer.length; > tempBuffer.data = getNextNode()->readBuffer.data; >@@ -1829,6 +1835,24 @@ > char *buf = next()->readBuffer.data; > > char *body_buf = buf; >+ >+ if (reqofs==0 && !logTypeIsATcpHit(http->logType)) >+ { >+ int tos = 0; >+ if (Config.zph_tos_peer && >+ (http->request->hier.code==SIBLING_HIT || >+ (Config.onoff.zph_tos_parent && http->request->hier.code==PARENT_HIT))) >+ { >+ tos = Config.zph_tos_peer; >+ debugs(33, 1, "ZPH: Peer hit, TOS="<<tos<<" hier.code="<<http->request->hier.code); >+ } >+ else if (Config.onoff.zph_preserve_miss_tos && Config.zph_preserve_miss_tos_mask) >+ { >+ tos = fd_table[fd].upstreamTOS & Config.zph_preserve_miss_tos_mask; >+ debugs(33, 1, "ZPH: Preserving TOS on miss, TOS="<<tos); >+ } >+ comm_set_tos(fd,tos); >+ } > > if (buf != result.data) { > /* we've got to copy some data */ >diff -ur squid-3.0.STABLE25.orig/src/fde.h squid-3.0.STABLE25.zph/src/fde.h >--- squid-3.0.STABLE25.orig/src/fde.h 2010-03-13 21:45:39.000000000 -0800 >+++ squid-3.0.STABLE25.zph/src/fde.h 2010-03-24 13:30:41.000000000 -0800 >@@ -106,7 +106,7 @@ > long handle; > } win32; > #endif >- >+ unsigned char upstreamTOS; /* see FwdState::dispatch() */ > }; > > #endif /* SQUID_FDE_H */ >diff -ur squid-3.0.STABLE25.orig/src/forward.cc squid-3.0.STABLE25.zph/src/forward.cc >--- squid-3.0.STABLE25.orig/src/forward.cc 2010-03-13 21:45:40.000000000 -0800 >+++ squid-3.0.STABLE25.zph/src/forward.cc 2010-03-24 13:30:41.000000000 -0800 >@@ -965,6 +965,57 @@ > > netdbPingSite(request->host); > >+ /* Retrieves remote server TOS value, and stores it as part of the >+ * original client request FD object. It is later used to forward >+ * remote server's TOS in the response to the client in case of a MISS. >+ */ >+ fde * clientFde = &fd_table[client_fd]; >+ if (clientFde) >+ { >+ int tos = 1; >+ int tos_len = sizeof(tos); >+ clientFde->upstreamTOS = 0; >+ if (setsockopt(server_fd,SOL_IP,IP_RECVTOS,&tos,tos_len)==0) >+ { >+ unsigned char buf[512]; >+ int len = 512; >+ if (getsockopt(server_fd,SOL_IP,IP_PKTOPTIONS,buf,(socklen_t*)&len) == 0) >+ { >+ /* Parse the PKTOPTIONS structure to locate the TOS data message >+ * prepared in the kernel by the ZPH incoming TCP TOS preserving >+ * patch. >+ */ >+ unsigned char * p = buf; >+ while (p-buf < len) >+ { >+ struct cmsghdr *o = (struct cmsghdr*)p; >+ if (o->cmsg_len<=0) >+ break; >+ >+ if (o->cmsg_level == SOL_IP && o->cmsg_type == IP_TOS) >+ { >+ union { >+ unsigned char *pchar; >+ int *pint; >+ } data; >+ data.pchar = CMSG_DATA(o); >+ clientFde->upstreamTOS = (unsigned char)*data.pint; >+ break; >+ } >+ p += CMSG_LEN(o->cmsg_len); >+ } >+ } >+ else >+ { >+ debugs(33, 1, "ZPH: error in getsockopt(IP_PKTOPTIONS) on FD "<<server_fd<<" "<<xstrerror()); >+ } >+ } >+ else >+ { >+ debugs(33, 1, "ZPH: error in setsockopt(IP_RECVTOS) on FD "<<server_fd<<" "<<xstrerror()); >+ } >+ } >+ > if (servers && (p = servers->_peer)) { > p->stats.fetches++; > request->peer_login = p->login; >diff -ur squid-3.0.STABLE25.orig/src/structs.h squid-3.0.STABLE25.zph/src/structs.h >--- squid-3.0.STABLE25.orig/src/structs.h 2010-03-13 21:45:39.000000000 -0800 >+++ squid-3.0.STABLE25.zph/src/structs.h 2010-03-24 13:30:41.000000000 -0800 >@@ -554,6 +554,8 @@ > int emailErrData; > int httpd_suppress_version_string; > int global_internal_static; >+ int zph_tos_parent; >+ int zph_preserve_miss_tos; > int debug_override_X; > int WIN32_IpAddrChangeMonitor; > } >@@ -722,6 +724,9 @@ > int sleep_after_fork; /* microseconds */ > time_t minimum_expiry_time; /* seconds */ > external_acl *externalAclHelperList; >+ int zph_tos_local; >+ int zph_tos_peer; >+ int zph_preserve_miss_tos_mask; > #if USE_SSL > > struct
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 301828
:
225165
|
225167
|
225169
| 225171