Re: AUSCERT#56168 query about squid caching bug [1.NOVM.22 patch]

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 01 Aug 1998 14:54:03 +0200

I have now been able to reproduce the cache corruption problem, and have
a preleminary patch that addresses it.

The bug is isolated to the 1.NOVM.x versions (or perhaps early versions
of 1.1.X as well), and is only seen if clients are allowed to request
objects from the cache during a fast rebuild.

Workaround 1:
* Always force 1.NOVM Squid to use slow rebuild by removing the
cache/log-last-clean file on restarts.

Workaround 2:
* Don't accept requests while rebuilding the cache by starting squid
1.NOVM.x with the -F option.

Or apply the attached patch that should fix the problem. The patch is a
straight port from the 1.1.22 source tree.

Workaround 1 can also be used to correct a corrupted cache index.

The patch is also available from http://hem.passagen.se/hno/squid/

---
Henrik Nordström
Sparetime Squid Hacker

*** squid-1.NOVM.22/src/store.c.orig Sat Aug 1 13:55:35 1998
--- squid-1.NOVM.22/src/store.c Sat Aug 1 14:13:37 1998
***************
*** 1564,1569 ****
--- 1564,1577 ----
          if ((hentry = (StoreEntry *) hash_lookup(store_table, hkey)))
              storeExpireNow(hentry);
      }
+ /* delay releases while rebuilding swap */
+ if (store_rebuilding == STORE_REBUILDING_FAST) {
+ debug(20, 2, "storeRelease: Delaying release until store is rebuilt: '%s'\n",
+ e->key ? e->key : e->url ? e->url : "NO URL");
+ storeExpireNow(e);
+ storeSetPrivateKey(e);
+ return 0;
+ }
      if (e->key)
          debug(20, 5, "storeRelease: Release object key: %s\n", e->key);
      else
Received on Sat Aug 01 1998 - 05:56:44 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:41:24 MST