mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 05:05: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
@@ -1,5 +1,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
- fuzzy: need to account for kernel-level modified variables in .userspacesize
|
||||||
|
|
||||||
|
|
||||||
Xtables-addons 1.13 (March 23 2009)
|
Xtables-addons 1.13 (March 23 2009)
|
||||||
===================================
|
===================================
|
||||||
- added a reworked ipv4options match
|
- added a reworked ipv4options match
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -102,7 +103,7 @@ static struct xtables_match fuzzy_mt_reg = {
|
|||||||
.name = "fuzzy",
|
.name = "fuzzy",
|
||||||
.version = XTABLES_VERSION,
|
.version = XTABLES_VERSION,
|
||||||
.size = XT_ALIGN(sizeof(struct xt_fuzzy_mtinfo)),
|
.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,
|
.help = fuzzy_mt_help,
|
||||||
.init = fuzzy_mt_init,
|
.init = fuzzy_mt_init,
|
||||||
.parse = fuzzy_mt_parse,
|
.parse = fuzzy_mt_parse,
|
||||||
|
Reference in New Issue
Block a user