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)
committerPDO SCM Team <hudsoncm@motorola.com>
Mon, 6 Dec 2021 08:56:26 +0000 (03:56 -0500)
Explicitly set what is visible to userspace

Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-0961

Bug: 196046570
Test: passed netd test suites
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Iacec0ef8ae290e01f1b60508d8abcd40a3653c83
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2123624
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
(cherry picked from commit ecdb616924dfa15dc1bc9948a08801f20680c714)

net/netfilter/xt_quota2.c

index 653408e95e085ad3f2d4f7df08801fcaae1db5dc..d613afd38aee0f3d37071c255c157bf4c52f34c1 100644 (file)
@@ -344,6 +344,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,
        },
        {
@@ -354,6 +355,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,
        },
 };