mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 04:35:12 +02:00
libxt_fuzzy: need to account for kernel-level modified variables in .userspacesize
When reviewing the code, I found there maybe a bug in libxt_fuzzy.c. If a user wants to delete this match, he will get an error reported, and the command fails. As the fields after maximum_rate in xt_fuzzy_mtinfo will be altered in kernel space, we should assign the userspacesize with the value offsetof(struct xt_fuzzy_mtinfo, packets_total) instead.
This commit is contained in:

committed by
Jan Engelhardt

parent
f96bc08f35
commit
d3ee3a0c3c
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#include <getopt.h>
|
||||
#include <netdb.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -102,7 +103,7 @@ static struct xtables_match fuzzy_mt_reg = {
|
||||
.name = "fuzzy",
|
||||
.version = XTABLES_VERSION,
|
||||
.size = XT_ALIGN(sizeof(struct xt_fuzzy_mtinfo)),
|
||||
.userspacesize = XT_ALIGN(sizeof(struct xt_fuzzy_mtinfo)),
|
||||
.userspacesize = offsetof(struct xt_fuzzy_mtinfo, packets_total),
|
||||
.help = fuzzy_mt_help,
|
||||
.init = fuzzy_mt_init,
|
||||
.parse = fuzzy_mt_parse,
|
||||
|
Reference in New Issue
Block a user