lua: don't make uhttpd_plugin symbol constant
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Jan 2015 20:36:42 +0000 (21:36 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Jan 2015 20:36:42 +0000 (21:36 +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>
lua.c

diff --git a/lua.c b/lua.c
index f4a574350abce2b3fe9c6af5e494c91bdfe656d2..213490483e469f9c929b507db0afc9e0c8b5cf4a 100644 (file)
--- a/lua.c
+++ b/lua.c
@@ -295,6 +295,6 @@ static int lua_plugin_init(const struct uhttpd_ops *o, struct config *c)
        return 0;
 }
 
-const struct uhttpd_plugin uhttpd_plugin = {
+struct uhttpd_plugin uhttpd_plugin = {
        .init = lua_plugin_init,
 };