ANDROID: xt_quota2: set usersize in xt_match registration object
authorTodd Kjos <tkjos@google.com>
Tue, 17 Aug 2021 21:23:28 +0000 (14:23 -0700)
committerTodd Kjos <tkjos@google.com>
Mon, 1 Nov 2021 23:53:48 +0000 (16:53 -0700)
Explicitly set what is visible to userspace

Bug: 196046570
Test: passed netd test suites
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Iacec0ef8ae290e01f1b60508d8abcd40a3653c83

net/netfilter/xt_quota2.c

index c9a06d0652fe4b306690a2ceea4ea71b1d84e27c..ec96906092865346e21191ea01927dc29f77aaeb 100644 (file)
@@ -348,6 +348,7 @@ static struct xt_match quota_mt2_reg[] __read_mostly = {
                .match      = quota_mt2,
                .destroy    = quota_mt2_destroy,
                .matchsize  = sizeof(struct xt_quota_mtinfo2),
+               .usersize   = offsetof(struct xt_quota_mtinfo2, master),
                .me         = THIS_MODULE,
        },
        {
@@ -358,6 +359,7 @@ static struct xt_match quota_mt2_reg[] __read_mostly = {
                .match      = quota_mt2,
                .destroy    = quota_mt2_destroy,
                .matchsize  = sizeof(struct xt_quota_mtinfo2),
+               .usersize   = offsetof(struct xt_quota_mtinfo2, master),
                .me         = THIS_MODULE,
        },
 };