You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/01/31 08:52:05 UTC

DO NOT REPLY [Bug 52564] New: Fail to build with security hardening cflags

https://issues.apache.org/bugzilla/show_bug.cgi?id=52564

             Bug #: 52564
           Summary: Fail to build with security hardening cflags
           Product: Tomcat Connectors
           Version: 1.2.32
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: mod_jk
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: drazzib@drazzib.com
    Classification: Unclassified


Hi,

Apache Mod_Jk fails to build with security hardening cflags [1]. As part as an
ongoing effort in Debian, we are trying to build as much as possible "network"
package with hardening features enabled [2].

Current failure is :
/usr/share/apr-1.0/build/libtool --silent --mode=compile x86_64-linux-gnu-gcc
-I/usr/include/apache2 -g -O2 -fstack-protector --param=ssp-buffer-size=4
-Wformat -Wformat-security -Werror=format-security -DHAVE_CONFIG_H
-DUSE_APACHE_MD5 -I ../common -I /include -I /include/unix  -DLINUX=2
-D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -I/usr/include/apr-1.0
-I/usr/include/openssl -I/usr/include/xmltok -pthread   -DHAVE_APR 
-I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security
-DHAVE_CONFIG_H   -c mod_jk.c -o mod_jk.lo
mod_jk.c: In function 'jk_error_exit':
mod_jk.c:678:5: error: format not a string literal and no format arguments
[-Werror=format-security]
mod_jk.c:684:9: error: format not a string literal and no format arguments
[-Werror=format-security]
cc1: some warnings being treated as errors

[1] "-Wformat -Wformat-security -Werror=format-security"
[2] http://wiki.debian.org/Hardening

Regards,

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52564] Fail to build with security hardening cflags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52564

Rainer Jung <ra...@kippdata.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Rainer Jung <ra...@kippdata.de> 2012-02-06 07:38:30 UTC ---
Thanks for the patch. on't know why I didn't consider that myself.

Applied in r1240904. Will be part of 1.2.33.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52564] Fail to build with security hardening cflags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52564

--- Comment #2 from drazzib <dr...@drazzib.com> 2012-02-05 23:30:52 UTC ---
Created attachment 28273
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28273
Fix FTBFS with -Werror=format-security

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52564] Fail to build with security hardening cflags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52564

--- Comment #1 from Rainer Jung <ra...@kippdata.de> 2012-01-31 10:02:06 UTC ---
First note, that the format string argument used in those two lines was
explicitely sanitized by removing any % character just a few lines above that
precisely because we pass it along without arguments.

How to really fix this? I didn't find a way to tell gcc that this special
argument is save. Starting with gcc 4.6 we could use a pragma to switch of
format-security checking just for those lines.

Which gcc version is Debian using? Any better ideas how to correctly signal
gcc, that there is no problem here?

In fact we do not use the ability to pass along arguments to format in
jk_error_exit in the code for Apache 2.x, but we do use it in the code for 1.3
and I'm not yet ready to simply drop that feature.

Regards,

Rainer

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52564] Fail to build with security hardening cflags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52564

--- Comment #3 from drazzib <dr...@drazzib.com> 2012-02-05 23:33:09 UTC ---
Hi,

FTR, Debian currently use GCC 4.6 (maybe GC 4.7 soon). I've attached a small
patch done by tony mancill <tm...@debian.org> to help fix this.

Could you please consider this for inclusion ?

Regards,

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org