mysqld doesn't dump core after setuid
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.1 |
Won't Fix
|
Medium
|
Unassigned | |||
5.5 |
Triaged
|
Medium
|
Unassigned | |||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
This is related to http://
is classified as a feature request. (which doesn't make sense
since setuid/setguid is usually how people run mysqld).
Basically, unless you do "echo 2 > /proc/sys/
echo “1″ > /proc/sys/
not get core (both require root).
Noticed this during:
/tmp/bld/
[-Wunreachable-
if (test_flags & TEST_CORE_
^~~~~~~~~~
(The code is unreachable because of "unireg_abort(1);" above).
It seems fixed in mariadb codebase:
allow_coredumps(); is called in the tail of
set_user/
static inline void allow_coredumps()
{
#ifdef PR_SET_DUMPABLE
if (test_flags & TEST_CORE_
{
/* inform kernel that process is dumpable */
(void) prctl(PR_
}
#endif
}
(the core_uses_pid is required since without it mysqld won't
overwrite a bare corefile if already exists -
http://
What's more is that core-file can even be made dynamic (but
outside scope of current bug) since all it is does is do a prctl.
tags: | added: upstream |
summary: |
- mysqld doesn't dump core + mysqld doesn't dump core after setuid |
This has not been a problem on jenkins for instance since over there we don't use setuid (jenkins user runs mysqld as same user unlike in centos etc. where init scripts are used).