[MXS-68] Wrong rule name in dbfwfilter leads to MaxScale crash Created: 2015-03-27  Updated: 2015-04-27  Resolved: 2015-03-28

Status: Closed
Project: MariaDB MaxScale
Component/s: dbfwfilter
Affects Version/s: 1.1.0
Fix Version/s: 1.1.0

Type: Bug Priority: Blocker
Reporter: Kolbe Kegel (Inactive) Assignee: Timofey Turenko
Resolution: Fixed Votes: 0
Labels: None


 Description   

[Database Firewall]
type=filter
module=dbfwfilter
rules=/home/skysql/dbfwfilter_rules.txt

rule testrule deny no_where_clause
users kolbe@% testuser@% match strict_all rules notarule

[root@max1 ~]# mysql -h 192.168.30.38 -P4006 -u kolbe -ppass  -e 'select t1.* from test.t1'
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0 "Internal error/check (Not system error)"

2015-03-21 08:56:08   Error : Rule not found: notarule
2015-03-21 08:56:08   Fatal: MaxScale received fatal signal 11. Attempting backtrace.
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/bin/maxscale() [0x52248c]
2015-03-21 08:56:08     /lib64/libpthread.so.0(+0xf710) [0x7f2838a59710]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/modules/libdbfwfilter.so(link_rules+0x41e) [0x7f281c44a84a]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/modules/libdbfwfilter.so(+0x5536) [0x7f281c44b536]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/bin/maxscale(filterApply+0x9c) [0x5431eb]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/bin/maxscale() [0x52dcba]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/bin/maxscale(session_alloc+0x32b) [0x52c78f]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/modules/libMySQLClient.so(+0x5144) [0x7f281d058144]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/bin/maxscale() [0x534515]
2015-03-21 08:56:08     /usr/local/mariadb-maxscale/bin/maxscale(poll_waitevents+0x634) [0x533dd4]
2015-03-21 08:56:08     /lib64/libpthread.so.0(+0x79d1) [0x7f2838a519d1]
2015-03-21 08:56:08     /lib64/libc.so.6(clone+0x6d) [0x7f28373c28fd]



 Comments   
Comment by Kolbe Kegel (Inactive) [ 2015-03-27 ]

This crash also happens if you omit a rule name but include some extra spaces at the end of the "users" directive, like {{users kolbe@% testuser@% match strict_all rules }}

Comment by markus makela [ 2015-03-28 ]

All rule syntax error now cause a failure to load the service.

Comment by Dipti Joshi (Inactive) [ 2015-03-30 ]

~markus
Does the failure message in log explain that it is due to rule syntax error ? If not please do so.

Comment by markus makela [ 2015-03-30 ]

The failure and the reason for the failure is logged into the error log. Syntax errors tell which rules were wrong and what was expected.

Comment by Dipti Joshi (Inactive) [ 2015-03-30 ]

Can this be added in troubleshooting guide ?

Generated at Thu Feb 08 03:56:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.