Bug #13619 | SIG11: encrypt(): salt beginning with "_" followed by any char out ascii64 | ||
---|---|---|---|
Submitted: | 29 Sep 2005 19:02 | Modified: | 20 Oct 2005 1:10 |
Reporter: | Raphael Becker | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.0.12beta (any before!), 4.1.14 | OS: | FreeBSD (FreeBSD, OpenBSD) |
Assigned to: | Jim Winstead | CPU Architecture: | Any |
[29 Sep 2005 19:02]
Raphael Becker
[29 Sep 2005 19:09]
Hartmut Holzgraefe
not a problem on linux: (SuSE 9.0, mysql 5.0bk) select encrypt('1234','_!'); +----------------------+ | encrypt('1234','_!') | +----------------------+ | *0 | +----------------------+ 1 row in set (0.36 sec)
[30 Sep 2005 14:14]
Valeriy Kravchuk
I was able to repeat this behaviour on our buildb FreeBSD 5.4 machine with 4.1.14: -bash-2.05b$ bin/mysql -uroot -S/users/vkravchuk/mysql4.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.1.14 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select encrypt('1234','_!'); mysqld got signal 11; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=8388600 read_buffer_size=131072 max_used_connections=1 max_connections=100 threads_connected=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Server crashed. On other platforms everything work much better. Windows (4.1.14 and 5.0.13-rc): mysql> select encrypt('1234','_!'); +----------------------+ | encrypt('1234','_!') | +----------------------+ | NULL | +----------------------+ 1 row in set (0.01 sec) mysql> select encrypt('1234','_'); +---------------------+ | encrypt('1234','_') | +---------------------+ | NULL | +---------------------+ 1 row in set (0.00 sec) mysql> select encrypt('1234','__'); +----------------------+ | encrypt('1234','__') | +----------------------+ | NULL | +----------------------+ 1 row in set (0.00 sec) mysql> select encrypt('1234','_.'); +----------------------+ | encrypt('1234','_.') | +----------------------+ | NULL | +----------------------+ 1 row in set (0.00 sec) Linux (4.1.15-BK): mysql> select encrypt('1234','_!'); +----------------------+ | encrypt('1234','_!') | +----------------------+ | _!jz9NkNiFXAs | +----------------------+ 1 row in set (0,00 sec) mysql> select encrypt('1234','__'); +----------------------+ | encrypt('1234','__') | +----------------------+ | __f0/W3dRvHoA | +----------------------+ 1 row in set (0,01 sec) mysql> select encrypt('1234','_.'); +----------------------+ | encrypt('1234','_.') | +----------------------+ | _.VVq0RdNc8.w | +----------------------+ 1 row in set (0,00 sec) mysql> select version(); +--------------+ | version() | +--------------+ | 4.1.15-debug | +--------------+ 1 row in set (0,00 sec) So, it is yet another BSD-specific bug.
[3 Oct 2005 0:33]
pineau benjamin
Posix define formely the salt to be in the 'a-zA-Z0-9./' range : http://www.opengroup.org/onlinepubs/009695399/functions/crypt.html So returning '_!jz9NkNiFXAs' for a "select encrypt('1234','_!');" on linux isn't very smart either (at least, an undefined behaviour from a posix viewpoint). The specific *BSD behaviours on '_*' and '$*' salts is described on: http://www.openbsd.org/cgi-bin/man.cgi?query=crypt http://www.freebsd.org/cgi/man.cgi?query=crypt&sektion=3 And the specifics of '$*' on Linux/glibc2, here for instance: http://linux.about.com/od/commands/l/blcmdl3_crypt.htm Things like "select encrypt('1234', '$1$abc$');" (for instance) will probably return differents results on windows and linux. Appart from the suggested fixes on the parent bug report, the doc may need to be corrected: the salt format (and restrictions) isn't described, and the doc don't tell how system dependent the result may be depending on the salt: http://dev.mysql.com/doc/mysql/en/encryption-functions.html
[6 Oct 2005 16:46]
Sergei Golubchik
Thanks for the exhaustive analysys!
[6 Oct 2005 23:15]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/30787
[13 Oct 2005 15:12]
Jim Winstead
Fixed in 4.1.16 and 5.0.15.
[20 Oct 2005 1:10]
Paul DuBois
Noted in 4.1.16, 5.0.15 changelogs.