diff --git a/changes-entries/pr69901.txt b/changes-entries/pr69901.txt new file mode 100644 index 00000000000..4b80e5c9727 --- /dev/null +++ b/changes-entries/pr69901.txt @@ -0,0 +1,3 @@ + *) mod_file_cache: Fix crashes for mmap'ed files under threaded + MPMs. PR 69901. barr.israel + diff --git a/modules/cache/mod_file_cache.c b/modules/cache/mod_file_cache.c index ce1db2d2c93..40781429636 100644 --- a/modules/cache/mod_file_cache.c +++ b/modules/cache/mod_file_cache.c @@ -272,12 +272,10 @@ static int mmap_handler(request_rec *r, a_file *file) #if APR_HAS_MMAP conn_rec *c = r->connection; apr_bucket *b; - apr_mmap_t *mm; apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc); - apr_mmap_dup(&mm, file->mm, r->pool); - b = apr_bucket_mmap_create(mm, 0, (apr_size_t)file->finfo.size, - c->bucket_alloc); + b = apr_bucket_immortal_create((const char *)file->mm->mm, + (apr_size_t)file->finfo.size, c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b); b = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b);