You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ryujiro Shibuya <rs...@gmail.com> on 2010/04/14 03:35:13 UTC

Age calculation in mod_cache.

Hello,

A minor issue in the age calculation in mod_cache [ap_cache_current_age() in
cache_util.c] is found.

In some unusual conditions, the age of cached content can be calculated as
negative value.
The negative age value will be casted into a huge unsigned integer later,
and then the inappropriate Age header e.g. "Age: 4294963617" (= more than
135 years) may be returned to the client.

In my opinion, the negative age should be adjusted to zero, at least.
What are your thoughts?

By the way, the condition to trigger this issue is, for example, the system
time is rewound after the creation of cache entry, such that the
request/response time recorded in the cache entry would tell the future
time.
Or this may be more likely to happen if disk cache is deployed with shared
disk storage, and system times are not synchronized well.

Regards,
Shibuya


RE: Age calculation in mod_cache.

Posted by "Plüm, Rüdiger, VF-Group" <ru...@vodafone.com>.
 

> -----Original Message-----
> From: Paul Fee 
> Sent: Donnerstag, 15. April 2010 15:43
> To: dev@httpd.apache.org
> Subject: RE: Age calculation in mod_cache.
> 
> "Plüm, Rüdiger, VF-Group" wrote:
> 
> >  
> > 
> >> -----Original Message-----
> >> From: Ryujiro Shibuya
> >> Sent: Mittwoch, 14. April 2010 03:35
> >> To: dev@httpd.apache.org
> >> Subject: Age calculation in mod_cache.
> >> 
> >> Hello,
> >> 
> >> A minor issue in the age calculation in mod_cache
> >> [ap_cache_current_age() in
> >> cache_util.c] is found.
> >> 
> >> In some unusual conditions, the age of cached content can be
> >> calculated as
> >> negative value.
> >> The negative age value will be casted into a huge unsigned
> >> integer later,
> >> and then the inappropriate Age header e.g. "Age: 4294963617"
> >> (= more than
> >> 135 years) may be returned to the client.
> >> 
> >> In my opinion, the negative age should be adjusted to 
> zero, at least.
> >> What are your thoughts?
> > 
> > Makes sense. Fixed in trunk as r933886.
> > 
> > Regards
> > 
> > Rüdiger
> 
> Hi Rüdiger,
> 
> Can you educate me on how this can be merged onto the 2.2.x 
> branch?  Does a 
> specific request need to be made or do most trunk changes get merged 
> automatically?

It takes one developer to propose it to backport and two more to vote
positively on this proposal and no vetos by other developers.
Feel free to remind us here from time to time if it does not get backported.

Regards

Rüdiger


RE: Age calculation in mod_cache.

Posted by Paul Fee <pf...@talk21.com>.
"Plüm, Rüdiger, VF-Group" wrote:

>  
> 
>> -----Original Message-----
>> From: Ryujiro Shibuya
>> Sent: Mittwoch, 14. April 2010 03:35
>> To: dev@httpd.apache.org
>> Subject: Age calculation in mod_cache.
>> 
>> Hello,
>> 
>> A minor issue in the age calculation in mod_cache
>> [ap_cache_current_age() in
>> cache_util.c] is found.
>> 
>> In some unusual conditions, the age of cached content can be
>> calculated as
>> negative value.
>> The negative age value will be casted into a huge unsigned
>> integer later,
>> and then the inappropriate Age header e.g. "Age: 4294963617"
>> (= more than
>> 135 years) may be returned to the client.
>> 
>> In my opinion, the negative age should be adjusted to zero, at least.
>> What are your thoughts?
> 
> Makes sense. Fixed in trunk as r933886.
> 
> Regards
> 
> Rüdiger

Hi Rüdiger,

Can you educate me on how this can be merged onto the 2.2.x branch?  Does a 
specific request need to be made or do most trunk changes get merged 
automatically?

Thanks,
Paul

RE: Age calculation in mod_cache.

Posted by Ryujiro Shibuya <rs...@gmail.com>.
Hello Rüdiger,

Thank you for quick response and quick fix!

Regards,
Shibuya

-----Original Message-----
From: "Plüm, Rüdiger, VF-Group" [mailto:ruediger.pluem@vodafone.com] 
Sent: Wednesday, April 14, 2010 5:58 PM
To: dev@httpd.apache.org
Subject: RE: Age calculation in mod_cache.

 

> -----Original Message-----
> From: Ryujiro Shibuya 
> Sent: Mittwoch, 14. April 2010 03:35
> To: dev@httpd.apache.org
> Subject: Age calculation in mod_cache.
> 
> Hello,
> 
> A minor issue in the age calculation in mod_cache 
> [ap_cache_current_age() in
> cache_util.c] is found.
> 
> In some unusual conditions, the age of cached content can be 
> calculated as
> negative value.
> The negative age value will be casted into a huge unsigned 
> integer later,
> and then the inappropriate Age header e.g. "Age: 4294963617" 
> (= more than
> 135 years) may be returned to the client.
> 
> In my opinion, the negative age should be adjusted to zero, at least.
> What are your thoughts?

Makes sense. Fixed in trunk as r933886.

Regards

Rüdiger


RE: Age calculation in mod_cache.

Posted by "Plüm, Rüdiger, VF-Group" <ru...@vodafone.com>.
 

> -----Original Message-----
> From: Ryujiro Shibuya 
> Sent: Mittwoch, 14. April 2010 03:35
> To: dev@httpd.apache.org
> Subject: Age calculation in mod_cache.
> 
> Hello,
> 
> A minor issue in the age calculation in mod_cache 
> [ap_cache_current_age() in
> cache_util.c] is found.
> 
> In some unusual conditions, the age of cached content can be 
> calculated as
> negative value.
> The negative age value will be casted into a huge unsigned 
> integer later,
> and then the inappropriate Age header e.g. "Age: 4294963617" 
> (= more than
> 135 years) may be returned to the client.
> 
> In my opinion, the negative age should be adjusted to zero, at least.
> What are your thoughts?

Makes sense. Fixed in trunk as r933886.

Regards

Rüdiger