Bug 1120019 - AliasMatch directive does not accept long URI
Summary: AliasMatch directive does not accept long URI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-16 05:15 UTC by Takayuki Ogawa
Modified: 2014-07-26 18:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-26 18:23:46 UTC


Attachments (Terms of Use)

Description Takayuki Ogawa 2014-07-16 05:15:41 UTC
Description of problem:
When accessed long URI location that configured by AliasMatch directive,
Apache failed to allocate memory and process aborted.

Version-Release number of selected component (if applicable):
httpd-2.4.9-2.fc20.x86_64
httpd-devel-2.4.9-2.fc20.x86_64
httpd-tools-2.4.9-2.fc20.x86_64

How reproducible:
Everytime.

Steps to Reproduce:
# prepare test file.
echo "<html>hello</html>" > /var/www/html/index.html
# add config to apache
echo "AliasMatch ^/alias-test/ /var/www/html/index.html" > /etc/httpd/conf.modules.d/02-alias-test.conf
# (re)start httpd
systemctl restart httpd.service

Actual results:
# When I request short URI, the response is good as follow:
[takayuki@localhost ~]$ wget -t1 -O - -S -v http://127.0.0.1/alias-test/short_uri
--2014-07-16 14:04:38--  http://127.0.0.1/alias-test/short_uri
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Wed, 16 Jul 2014 05:04:38 GMT
  Server: Apache/2.4.9 (Fedora)
  Last-Modified: Wed, 16 Jul 2014 04:49:10 GMT
  ETag: "13-4fe483eb8a9d6"
  Accept-Ranges: bytes
  Content-Length: 19
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: text/html; charset=UTF-8
Length: 19 [text/html]
Saving to: 'STDOUT'

 0% [                                                                                          ] 0           --.-K/s              <html>hello</html>
100%[=========================================================================================>] 19          --.-K/s   in 0s      

2014-07-16 14:04:38 (2.03 MB/s) - written to stdout [19/19]

# When I request log URI, the connection is closed and Apache logged error as follow:
[takayuki@localhost ~]$ wget -t1 -O - -S -v http://127.0.0.1/alias-test/very_looooooooooooooooooooooong_uri
--2014-07-16 14:07:40--  http://127.0.0.1/alias-test/very_looooooooooooooooooooooong_uri
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... No data received.
Giving up.

[root@localhost takayuki]# tail /var/log/httpd/error_log
[crit] Memory allocation failed, aborting process.
[Wed Jul 16 14:03:17.231921 2014] [core:notice] [pid 21808] AH00052: child pid 21809 exit signal Aborted (6)
[crit] Memory allocation failed, aborting process.
[Wed Jul 16 14:03:23.239149 2014] [core:notice] [pid 21808] AH00052: child pid 21812 exit signal Aborted (6)
[crit] Memory allocation failed, aborting process.
[Wed Jul 16 14:07:40.487959 2014] [core:notice] [pid 21808] AH00052: child pid 21945 exit signal Aborted (6)

Additional info:
[root@localhost conf]# diff /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf 
104c104,105
<     Require all denied
---
> #    Require all denied
>     Require all granted

[root@localhost takayuki]# httpd -l
Compiled in modules:
  core.c
  mod_so.c
  http_core.c

[root@localhost takayuki]# httpd -M
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 allowmethods_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_anon_module (shared)
 authn_core_module (shared)
 authn_dbd_module (shared)
 authn_dbm_module (shared)
 authn_file_module (shared)
 authn_socache_module (shared)
 authz_core_module (shared)
 authz_dbd_module (shared)
 authz_dbm_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_owner_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cache_module (shared)
 cache_disk_module (shared)
 data_module (shared)
 dbd_module (shared)
 deflate_module (shared)
 dir_module (shared)
 dumpio_module (shared)
 echo_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 info_module (shared)
 log_config_module (shared)
 logio_module (shared)
 macro_module (shared)
 mime_magic_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 remoteip_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_plain_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_memcache_module (shared)
 socache_shmcb_module (shared)
 status_module (shared)
 substitute_module (shared)
 suexec_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 userdir_module (shared)
 version_module (shared)
 vhost_alias_module (shared)
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)
 lua_module (shared)
 mpm_prefork_module (shared)
 proxy_module (shared)
 lbmethod_bybusyness_module (shared)
 lbmethod_byrequests_module (shared)
 lbmethod_bytraffic_module (shared)
 lbmethod_heartbeat_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 proxy_connect_module (shared)
 proxy_express_module (shared)
 proxy_fcgi_module (shared)
 proxy_fdpass_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_scgi_module (shared)
 systemd_module (shared)
 cgi_module (shared)

Comment 1 Jan Kaluža 2014-07-16 06:17:57 UTC
Thanks for the report, I'm able to reproduce it. I will try to fix it and propose the fix upstream.

Comment 2 Jan Kaluža 2014-07-16 06:24:12 UTC
It's fixed upstream in http://svn.apache.org/viewvc?view=revision&revision=1583175

Comment 3 Takayuki Ogawa 2014-07-26 18:23:46 UTC
This bug is fixed in httpd-2.4.10-1.fc20.x86_64.
Thank you.


Note You need to log in before you can comment on or make changes to this bug.