ubus: don't make uhttpd_plugin symbol constant
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Jan 2015 17:13:03 +0000 (18:13 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Jan 2015 17:13:03 +0000 (18:13 +0100)
uhttpd modifies the list_head member of the uhttpd_plugin struct when
loading a plugin, therefore we cannot make it const, otherwise we
trigger a security violation if uhttpd is built with RelRO support.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
ubus.c

diff --git a/ubus.c b/ubus.c
index 269f7cdf85ed7195964399e9449cd97a65a9c595..4fa03192d42075b5dda54a01d7812b9e7b888dc8 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -679,7 +679,7 @@ static void uh_ubus_post_init(void)
        ubus_add_uloop(ctx);
 }
 
-const struct uhttpd_plugin uhttpd_plugin = {
+struct uhttpd_plugin uhttpd_plugin = {
        .init = uh_ubus_plugin_init,
        .post_init = uh_ubus_post_init,
 };