Bug 972692 - network-servcies should be a hardening build / RELRO / PIE
Summary: network-servcies should be a hardening build / RELRO / PIE
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: samba   
(Show other bugs)
Version: 18
Hardware: Unspecified Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Guenther Deschner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-10 12:17 UTC by Harald Reindl
Modified: 2013-07-25 00:47 UTC (History)
6 users (show)

Fixed In Version: samba-4.0.7-2.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-25 00:42:35 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Harald Reindl 2013-06-10 12:17:31 UTC
[root@srv-rhsoft:~]$ hardening-check.sh /usr/sbin/smbd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      FILE
Partial RELRO   Canary found      NX enabled    No PIE          RPATH      No RUNPATH   /usr/sbin/smbd
/usr/sbin/smbd:
 Position Independent Executable: no, normal executable!
 Stack protected: yes
 Fortify Source functions: yes (some protected functions found)
 Read-only relocations: yes
 Immediate binding: no, not found!

Comment 1 Andreas Schneider 2013-06-10 16:47:41 UTC
This will be fixed soon when Samba 4.0.7 is released.

Comment 2 Harald Reindl 2013-07-03 18:47:02 UTC
4.0.7 is PIE but still *not* full RELO
http://tk-blog.blogspot.co.at/2009/02/relro-not-so-well-known-memory.html

as maintainer of server-packages you should install 
"checksec" and "hardening-check" which are in the
Fedora repos for F18, F19 and F20

[root@srv-rhsoft:~]$ hardening-check /usr/sbin/smbd
/usr/sbin/smbd:
 Position Independent Executable: yes
 Stack protected: yes
 Fortify Source functions: yes (some protected functions found)
 Read-only relocations: yes
 Immediate binding: no, not found!

[root@srv-rhsoft:~]$ checksec --file /usr/sbin/smbd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      FILE
Partial RELRO   Canary found      NX enabled    PIE enabled     RPATH      No RUNPATH   /usr/sbin/smbd

Comment 3 Andreas Schneider 2013-07-04 16:24:39 UTC
Ok, I will propose a patch for 4.0.8 to enable RELRO.

Comment 4 Harald Reindl 2013-07-04 16:29:11 UTC
thx, but this can be fixed in 99% of all cases in the RPM SPEC

export LDFLAGS="-Wl,-z,now -Wl,-z,relro,-z"
before %configure and you are mostly done

i am using this for any local maintained package as well as explicit CFLAGS for hardening with stronger options than Fedora defaults (httpd, php, dovecot, postfix, dbmail, trafficserver....) and i would like to use the fedota-samba apckages instead add it my "private builds"

Comment 5 Harald Reindl 2013-07-04 16:30:49 UTC
argh - errata

export LDFLAGS="-Wl,-z,now -Wl,-z,relro"
_____________________________________

the trailing ",z" came from copy&paste of my dovecot build

%build
export CFLAGS="%{optflags} -fPIC -fPIE -fstack-protector-all"
export CXXFLAGS="%{optflags} -fPIC -fPIE -fstack-protector-all"
export FFLAGS="%{optflags} -fPIC -fPIE -fstack-protector-all"
export CPPFLAGS="%{optflags} -fPIC -fPIE -fstack-protector-all"
export LDFLAGS="-Wl,-z,now -Wl,-z,relro,-z,noexecstack -pie"
export SH_LDFLAGS="-Wl,-z,now -Wl,-z,relro,-z,noexecstack -pie"
%configure.................

Comment 6 Fedora Update System 2013-07-16 11:40:50 UTC
samba-4.0.7-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/samba-4.0.7-2.fc19

Comment 7 Harald Reindl 2013-07-16 12:09:42 UTC
that looks much better (samba-4.0.7-2.fc18.x86_64)

[root@rh:~]$ hardening-check /usr/sbin/smbd 
/usr/sbin/smbd:
 Position Independent Executable: yes
 Stack protected: yes
 Fortify Source functions: yes (some protected functions found)
 Read-only relocations: yes
 Immediate binding: yes

Comment 8 Fedora Update System 2013-07-16 12:26:15 UTC
samba-4.0.7-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/samba-4.0.7-2.fc18

Comment 9 Andreas Schneider 2013-07-16 12:44:47 UTC
I've also added a patch upstream which checks if the linker supports it and enables it by default!

Comment 10 Fedora Update System 2013-07-17 03:02:44 UTC
Package samba-4.0.7-2.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing samba-4.0.7-2.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-13060/samba-4.0.7-2.fc19
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2013-07-25 00:42:35 UTC
samba-4.0.7-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2013-07-25 00:47:04 UTC
samba-4.0.7-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


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