[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#547047: marked as done (polipo crashes when server reply contains "Cache-Control: max-age")



Your message dated Fri, 19 Feb 2010 19:55:35 +0000
with message-id <E1NiYwp-0000nI-SQ@ries.debian.org>
and subject line Bug#547047: fixed in polipo 1.0.4-1+lenny1
has caused the Debian Bug report #547047,
regarding polipo crashes when server reply contains "Cache-Control: max-age"
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
547047: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547047
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: polipo
Version: 1.0.4-1
Severity: grave
Tags: patch
Justification: renders package unusable

When polipo receives a "Cache-Control: max-age" line without a value,
it logs a parsing error but then continues to use the not-parsed value,
resulting in a segfault. It does this in several places in http_parse.c.
I have attached a stacktrace and patch that seems to
work for me. You should check that I have not missed an occurence of the
same error.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-1-686 (SMP w/1 CPU core)
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash

Versions of packages polipo depends on:
ii  libc6                         2.9-26     GNU C Library: Shared libraries

polipo recommends no packages.

polipo suggests no packages.

-- no debconf information
--- polipo-1.0.4.orig/http_parse.c
+++ polipo-1.0.4/http_parse.c
@@ -1088,9 +1088,10 @@
                                  (v_end >= 0 ? v_end : token_end) -
                                  token_start);
                         do_log(L_WARN, "\n");
+                    } else {
+                        a = atoi(buf + v_start);
+                        cache_control.max_age = a;
                     }
-                    a = atoi(buf + v_start);
-                    cache_control.max_age = a;
                 } else if(token_compare(buf, token_start, token_end,
                                         "s-maxage")) {
                     int a;
@@ -1100,9 +1101,10 @@
                                  (v_end >= 0 ? v_end : token_end) -
                                  token_start);
                         do_log(L_WARN, "\n");
+                    } else {
+                        a = atoi(buf + v_start);
+                        cache_control.max_age = a;
                     }
-                    a = atoi(buf + v_start);
-                    cache_control.max_age = a;
                 } else if(token_compare(buf, token_start, token_end,
                                         "min-fresh")) {
                     int a;
@@ -1112,9 +1114,10 @@
                                  (v_end >= 0 ? v_end : token_end) -
                                  token_start);
                         do_log(L_WARN, "\n");
+                    } else {
+                        a = atoi(buf + v_start);
+                        cache_control.max_age = a;
                     }
-                    a = atoi(buf + v_start);
-                    cache_control.max_age = a;
                 } else if(token_compare(buf, token_start, token_end,
                                         "max-stale")) {
                     int a;
@@ -1124,9 +1127,10 @@
                                  (v_end >= 0 ? v_end : token_end) -
                                  token_start);
                         do_log(L_WARN, "\n");
+                    } else {
+                        a = atoi(buf + v_start);
+                        cache_control.max_stale = a;
                     }
-                    a = atoi(buf + v_start);
-                    cache_control.max_stale = a;
                 } else {
                     do_log(L_WARN, "Unsupported Cache-Control directive ");
                     do_log_n(L_WARN, buf + token_start, 
(gdb) bt full                                                                                                            
#0  0xb7f22b38 in *__GI_____strtol_l_internal (nptr=0xb7dcefff <Address 0xb7dcefff out of bounds>, endptr=0x0, base=10,  
    group=0, loc=0xb804c380) at strtol_l.c:298                                                                           
        negative = <value optimized out>                                                                                 
        cutoff = <value optimized out>                                                                                   
        i = <value optimized out>                                                                                        
        s = <value optimized out>                                                                                        
        c = <value optimized out>                                                                                        
        save = <value optimized out>                                                                                     
        end = <value optimized out>                                                                                      
        overflow = <value optimized out>                                                                                 
        cnt = <value optimized out>                                                                                      
        current = <value optimized out>                                                                                  
        thousands = 0x0                                                                                                  
        thousands_len = <value optimized out>                                                                            
        grouping = 0x0                                                                                                   
#1  0xb7f228a0 in *__GI_strtol (nptr=0xb7dcefff <Address 0xb7dcefff out of bounds>, endptr=0x0, base=10) at strtol.c:110 
No locals.                                                                                                               
#2  0xb7f1f891 in atoi (nptr=0xb7dcefff <Address 0xb7dcefff out of bounds>) at atoi.c:28                                 
No locals.                                                                                                               
#3  0x08061e18 in httpParseHeaders (client=0, url=0x979fe28,                                                             
    buf=0xb7dcf000 "HTTP/1.1 200 OK\r\nDate: Wed, 16 Sep 2009 21:03:06 GMT\r\nServer: Apache/2.2.9 (Unix) mod_jk/1.2.26\r\nSet-Cookie: GY_1HIST=loc%3Dfeldkirchen%3A%3A%3A%23vaterstetten%3A%3A%3A%23%7C%7Ccat%3Dcopy+shop%23; Exp"...,           
    start=17, request=0x979faf8, headers_return=0xbff52d10, len_return=0xbff52d0c, cache_control_return=0xbff52ccc,      
    condition_return=0x0, te_return=0xbff52d08, date_return=0xbff52d00, last_modified_return=0xbff52cfc,                 
    expires_return=0xbff52cf8, polipo_age_return=0x0, polipo_access_return=0x0, polipo_body_offset_return=0x0,           
    age_return=0xbff52d04, etag_return=0xbff52cf4, expect_return=0x0, range_return=0x0,                                  
    content_range_return=0xbff52ce0, location_return=0x0, via_return=0xbff52cf0, auth_return=0x0) at http_parse.c:1092   
        v_start = -1                                                                                                     
        v_end = -1                                                                                                       
        local = 0                                                                                                        
        hbuf_small = "\r\nServer: Apache/2.2.9 (Unix) mod_jk/1.2.26\r\nSet-Cookie: GY_1HIST=loc%3Dfeldkirchen%3A%3A%3A%23vaterstetten%3A%3A%3A%23%7C%7Ccat%3Dcopy+shop%23; Expires=Thu, 16-Sep-2010 21:03:07 GMT; Path=/\365\277O\361\365\267\364\277\4\270\377\377\334\267\b\276\b\270\360*\365\277\f+\365\277u<\224|X\30\a\270"...                                       
        hbuf = 0xbff529f8 "\r\nServer: Apache/2.2.9 (Unix) mod_jk/1.2.26\r\nSet-Cookie: GY_1HIST=loc%3Dfeldkirchen%3A%3A%3A%23vaterstetten%3A%3A%3A%23%7C%7Ccat%3Dcopy+shop%23; Expires=Thu, 16-Sep-2010 21:03:07 GMT; Path=/\365\277O\361\365\267\364\277\4\270"...                                                                                                       
        hbuf_size = 512                                                                                                  
        hbuf_length = 190                                                                                                
        i = 268                                                                                                          
        j = 268                                                                                                          
        name_start = 244                                                                                                 
        name_end = <value optimized out>                                                                                 
        value_start = 259                                                                                                
        value_end = 266                                                                                                  
        token_start = 259                                                                                                
        token_end = 266                                                                                                  
        end = 1                                                                                                          
        name = 0x979ab68                                                                                                 
        date = 1253134986                                                                                                
        last_modified = -1                                                                                               
        expires = -1                                                                                                     
        polipo_age = -1                                                                                                  
        polipo_access = -1                                                                                               
        polipo_body_offset = -1                                                                                          
        len = -1                                                                                                         
        endptr = 0xb804d190 " \3z\t\320\373y\t\320\373y\t\320\373y\t\270\375y\t`\261y\t\240\321\4\270\240\321\4\270\250\321\4\270\250\321\4\270\260\321\4\270\260\321\4\270\270\321\4\270\270\321\4\270\300\321\4\270\300\321\4\270\310\321\4\270\310\321\4\270\320\321\4\270\320\321\4\270\330\321\4\270\330\321\4\270\340\321\4\270\340\321\4\270\350\321\4\270\350\321\4\270\360\321\4\270\360\321\4\270\370\321\4\270\370\321\4\270"                                                            
        te = 0                                                                                                           
        age = -1                                                                                                         
        etag = 0x0                                                                                                       
        ifrange = 0x0                                                                                                    
        persistent = 1                                                                                                   
        location = 0x0                                                                                                   
        via = 0x0                                                                                                        
        auth = 0x0                                                                                                       
        expect = 0x0                                                                                                     
        condition = <value optimized out>                                                                                
        ims = -1                                                                                                         
        inms = -1                                                                                                        
        im = 0x0                                                                                                         
        inm = 0x0                                                                                                        
        hopToHop = 0x0                                                                                                   
        haveCacheControl = 1                                                                                             
        __PRETTY_FUNCTION__ = "httpParseHeaders"                                                                         
#4  0x0805dd54 in httpServerHandlerHeaders (eof=0, event=0x979fdd0, srequest=0x979fde0, connection=0x979fb60)            
    at server.c:1920                                                                                                     
        request = 0x979faf8                                                                                              
        object = 0x979f9a8                                                                                               
        rc = <value optimized out>                                                                                       
        code = <value optimized out>                                                                                     
        version = 1                                                                                                      
        full_len = <value optimized out>                                                                                 
        headers = <value optimized out>                                                                                  
        len = <value optimized out>                                                                                      
        te = <value optimized out>                                                                                       
        cache_control = {flags = 134600709, max_age = 256, s_maxage = 4, min_fresh = 0, max_stale = 158989160}           
        age = -1                                                                                                         
        date = <value optimized out>                                                                                     
        last_modified = <value optimized out>                                                                            
        expires = <value optimized out>                                                                                  
        init_time = <value optimized out>                                                                                
        etag = <value optimized out>                                                                                     
        via = <value optimized out>                                                                                      
        new_via = <value optimized out>                                                                                  
        expect_body = <value optimized out>                                                                              
        content_range = {from = 4096, to = 134605195, full_length = 158989152}                                           
        new_object = <value optimized out>                                                                               
        supersede = <value optimized out>                                                                                
        message = 0x979fe10
        url = 0x979fe28
        __PRETTY_FUNCTION__ = "httpServerHandlerHeaders"
#5  0x0805ea6d in httpServerReplyHandler (status=0, event=0x979fdd0, srequest=0x979fde0) at server.c:1807
        connection = 0x979fb60
        request = 0x979faf8
        i = <value optimized out>
        body = 620
        bufsize = 4096
        __PRETTY_FUNCTION__ = "httpServerReplyHandler"
#6  0x0804cdef in do_scheduled_stream (status=0, event=0x979fdd0) at io.c:368
        request = 0x979fde0
        rc = <value optimized out>
        done = <value optimized out>
        i = 1
        iov = {{iov_base = 0xb7dcf000, iov_len = 4096}, {iov_base = 0x979fd30, iov_len = 3}, {iov_base = 0xc,
            iov_len = 24}, {iov_base = 0xbff52dd8, iov_len = 134525095}, {iov_base = 0x979fd38, iov_len = 3220516312}, {
            iov_base = 0x4e20, iov_len = 4}}
        chunk_header_len = 158989160
        chunk_header = "\374\267\0\0\0\0\1\0\0"
        len12 = 4096
        len123 = 4096
        __PRETTY_FUNCTION__ = "do_scheduled_stream"
#7  0x0804b3ef in eventLoop () at event.c:713
        rc = <value optimized out>
        i = 2
        done = <value optimized out>
        n = 0
        event = 0x979fdd0
#8  0x08053f2d in main (argc=8, argv=0xbff52ed4) at main.c:165
        listener = 0xb804c380
        i = 8
        rc = <value optimized out>
        expire = 0
        printConfig = 0

--- End Message ---
--- Begin Message ---
Source: polipo
Source-Version: 1.0.4-1+lenny1

We believe that the bug you reported is fixed in the latest version of
polipo, which is due to be installed in the Debian FTP archive:

polipo_1.0.4-1+lenny1.diff.gz
  to main/p/polipo/polipo_1.0.4-1+lenny1.diff.gz
polipo_1.0.4-1+lenny1.dsc
  to main/p/polipo/polipo_1.0.4-1+lenny1.dsc
polipo_1.0.4-1+lenny1_i386.deb
  to main/p/polipo/polipo_1.0.4-1+lenny1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 547047@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stefan Fritsch <sf@debian.org> (supplier of updated polipo package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 17 Feb 2010 20:31:37 +0100
Source: polipo
Binary: polipo
Architecture: source i386
Version: 1.0.4-1+lenny1
Distribution: stable-security
Urgency: high
Maintainer: Denis V. Sirotkin <fechiny@gmail.com>
Changed-By: Stefan Fritsch <sf@debian.org>
Description: 
 polipo     - a small, caching web proxy
Closes: 547047 560779
Changes: 
 polipo (1.0.4-1+lenny1) stable-security; urgency=high
 .
   [ Stefan Fritsch ]
   * Non-maintainer upload by the Security Team.
   * Backport various security related bug fixes from upstream git.
   * Fix segfault when server sends Cache-Control: max-age without a value
     (closes: #547047, CVE-2009-3305).
 .
   [ Andreas Kirschbaum ]
   * Apply upstream commit to fix DoS via overly large "Content-Length"
     header; fixes CVE-2009-4413 (closes: #560779)
Checksums-Sha1: 
 485ac6e4844c157bd4e0ebd56302aa82e694dec6 1042 polipo_1.0.4-1+lenny1.dsc
 ba562906d125a6bf72dc36c2d078147d40cf8722 180487 polipo_1.0.4.orig.tar.gz
 1808bdf4f47219863d7de6894af2fbab98f93500 13430 polipo_1.0.4-1+lenny1.diff.gz
 f253afca3c423bd3b0789db7655f9db6c7662f80 191848 polipo_1.0.4-1+lenny1_i386.deb
Checksums-Sha256: 
 90a376437eb8e4ccde04e6cb7dc541037c69cf7fdb7a94b236456e853be96e93 1042 polipo_1.0.4-1+lenny1.dsc
 f6458a3ab2548280d4f5596f8d5ae60c61ddf7147ee0b3bb2d67b96da49c0436 180487 polipo_1.0.4.orig.tar.gz
 b4eaf56b26226f0681df3473271eb5110e4fff6acca549a5160f04e05a9aa8e8 13430 polipo_1.0.4-1+lenny1.diff.gz
 9f8c0507255e42052aee2604ee8aeb7fc475f5bc1a83444046cf427722a5bd24 191848 polipo_1.0.4-1+lenny1_i386.deb
Files: 
 4bb50ed5472fcd6b264cb89816586bbe 1042 web optional polipo_1.0.4-1+lenny1.dsc
 defdce7f8002ca68705b6c2c36c4d096 180487 web optional polipo_1.0.4.orig.tar.gz
 4cc90f3327e4018c56b4e140cbcb2f46 13430 web optional polipo_1.0.4-1+lenny1.diff.gz
 33af29a3f9e091dd6437fc3f3bfccab9 191848 web optional polipo_1.0.4-1+lenny1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD4DBQFLfE0tbxelr8HyTqQRAmmRAJ47Hx4C3QUud/up/BzZhk8sVS4ajgCY46fY
eeuA08NSfFby46IUIzFbbQ==
=6XhM
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: