Bug 1795891

Summary: ss crash when called from mariadb as an gelera cluster member
Product: Red Hat Enterprise Linux 7 Reporter: Frank Büttner <bugzilla>
Component: iprouteAssignee: Andrea Claudi <aclaudi>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.7CC: aclaudi, atragler, pvrabec
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iproute-4.11.0-27.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 20:28:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
setenforce 0
none
setenforce 1
none
The core dump file
none
Hopefully the right patch.
none
The used spec file for the test. none

Description Frank Büttner 2020-01-29 07:00:01 UTC
Description of problem:
When mariadb try's to done its SST replication, it will call this tool.
But ss will crash with an core dump.

Version-Release number of selected component (if applicable):
iproute-4.11.0-25.el7_7.2


How reproducible:
Evey time, using mariadb 10.4.11

Steps to Reproduce:
1. call rm -f /var/lib/mysql/* to force an SST sync on start 
2. call systemctl start mariadb

Actual results:
The node will sync it with the rest of the cluster, but the called ss tool will crash.


Expected results:
No crash of ss.

Comment 3 Andrea Claudi 2020-02-13 14:37:54 UTC
Hi Frank, thanks for the report.
From the CentOS report attached to this issue I see that crash happens following the command 'ss -p state listening ( sport = '' 4445 )'. Can you please confirm that? I tried to reproduce the issue using the previous command (and nc to open a socket on port 4445), without success.

I see you manage to reproduce it reliably, can you please attach a coredump so I can examine it? Thanks in advance!

Comment 5 Frank Büttner 2020-02-14 10:30:06 UTC
Hi Andrea,
yes this will be correct. But the command will called by the mysqld.
It looks like selinux will play an role here, because set it to setenforce 0, then no crash will happens.
So I have added the aureport running setenforce 1 and for setenforce 0.

Comment 6 Frank Büttner 2020-02-14 10:30:55 UTC
Created attachment 1663073 [details]
setenforce 0

Comment 7 Frank Büttner 2020-02-14 10:31:35 UTC
Created attachment 1663074 [details]
setenforce 1

Comment 8 Frank Büttner 2020-02-14 10:32:44 UTC
Created attachment 1663075 [details]
The core dump file

Comment 9 Andrea Claudi 2020-04-21 17:03:11 UTC
Hi Frank and thanks for the info.
Upstream commit ebbb219c924cc ("ss: fix NULL pointer access when parsing unix sockets with oldformat") should fix this crash.
Are you able to apply this patch and verify if this is correct?

Comment 10 Frank Büttner 2020-04-22 04:55:42 UTC
Hi Andrea,
yes of course, when you can show me, where I can find the patch.
Than I can build an rpm package and test it in the cluster.
Query old google for it will result in an patch, but I don't know is it the right one.

Comment 11 Frank Büttner 2020-04-22 04:56:40 UTC
Created attachment 1680731 [details]
Hopefully the right patch.

Comment 12 Frank Büttner 2020-04-22 05:46:55 UTC
Hi Andrea,
I have tested the patch and it will do the job.
Now an friendly "Cannot open netlink socket: Permission denied" is reported instant of an crash :)
I think the patch included to the package.

Thanks for the help.

Comment 13 Frank Büttner 2020-04-22 05:47:48 UTC
Created attachment 1680733 [details]
The used spec file for the test.

Comment 14 Andrea Claudi 2020-04-22 08:15:52 UTC
Thank you, Frank. This patch will be included in the next iproute release.

Comment 21 errata-xmlrpc 2020-09-29 20:28:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (iproute bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3999