From: Todd Kjos Date: Tue, 17 Aug 2021 21:23:28 +0000 (-0700) Subject: ANDROID: xt_quota2: set usersize in xt_match registration object X-Git-Tag: MMI-RSBS31.Q1-48-36-26~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b35eef0c8f3516a34a1075c2deb8503bef72237f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ANDROID: xt_quota2: set usersize in xt_match registration object 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 Change-Id: Iacec0ef8ae290e01f1b60508d8abcd40a3653c83 Signed-off-by: Gajjala Chakradhar Reviewed-on: https://gerrit.mot.com/2123624 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key (cherry picked from commit ecdb616924dfa15dc1bc9948a08801f20680c714) --- diff --git a/net/netfilter/xt_quota2.c b/net/netfilter/xt_quota2.c index 653408e95e08..d613afd38aee 100644 --- a/net/netfilter/xt_quota2.c +++ b/net/netfilter/xt_quota2.c @@ -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, }, };