Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5476690rwb; Tue, 1 Aug 2023 03:19:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7zzo+1CWurvi2A3Q+TFdEmDx6JmtW1dSFnH1nHkqGdye3yvLZkIjT64U5EqWf2gKV0O3k X-Received: by 2002:a17:90b:4f45:b0:268:3ea0:7160 with SMTP id pj5-20020a17090b4f4500b002683ea07160mr11594375pjb.0.1690885151987; Tue, 01 Aug 2023 03:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690885151; cv=none; d=google.com; s=arc-20160816; b=CZrA0pDFkwRiwsWd5AyPHLtWrNK4RpfeYigMvx3U/ePbduAnewocRcRl5C25Gl8TcE gwsGE0u01npmWxqVuJTumfbhha2+7Qk0ExM/soMozZHsL5wi6PQdh3Lo6YJ4OefUOi+b bgyn5wX/Qhu1xuyI9FSP/Xnp3IuVMry2Mdr3GSB0InfXguCXl2JsNoePLb36lJcqPP2D /URTEQoOrTV5ysxrCITxNqZ/llQx26MWUMdYl0Wzt9vCIqczYNYXdaYMJgP6Emn1BB9I 04EYvFttfDC/xPuYH0qhkqyjl5RtH1yOI7Rvwv/kDaEJNyKM73YExicL37Qz3oMpr9RL 426A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=z9asflM/koq4WLHSa0w5dKshT4TvaEMonbrfo7NtYrE=; fh=naOymOcD7UglpGiV6ZlSRLufuGrFCnH6A5Ra3287drA=; b=eP9pfFTHUGur3fBMR4lKsi7GMXIKXoz5Z8whCakecm0WT19hWXSnXHb9h91R0YA6EM 55gCBchi/9jlcf7PudSlcjucumVUhrZj/h93sIDm/0s+ERI3HAQOtihiiqNyy2Kv1Y/Z hZoP1OGT8cGmWcLt4ebEII7axdTKFjIUS0soDA95B43+LeQILFwvF9MAXE5vOEP7nNmh K05rVIwQt0dsAaoo/+6QKoKcU9EcpOgsoQKMNBAEaoGNJyIKOr4Pbpdp/pqOhND/3pke xrv7fp4YbWOwJWaqxUmz5S9oR8Ffyg0G0cSLIdkPY1cgLLvifPgPYUSr5WOuZaiXw3n6 VDJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a17090a2d8d00b00263c7cadb73si5381627pjd.152.2023.08.01.03.18.59; Tue, 01 Aug 2023 03:19:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233564AbjHAKB2 (ORCPT + 99 others); Tue, 1 Aug 2023 06:01:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231913AbjHAKAr (ORCPT ); Tue, 1 Aug 2023 06:00:47 -0400 Received: from a.mx.secunet.com (a.mx.secunet.com [62.96.220.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F591BD2; Tue, 1 Aug 2023 03:00:35 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 0BD0A2065A; Tue, 1 Aug 2023 12:00:34 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n7Cd7D-Z3Ez1; Tue, 1 Aug 2023 12:00:33 +0200 (CEST) Received: from mailout2.secunet.com (mailout2.secunet.com [62.96.220.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 85C0620561; Tue, 1 Aug 2023 12:00:33 +0200 (CEST) Received: from cas-essen-01.secunet.de (unknown [10.53.40.201]) by mailout2.secunet.com (Postfix) with ESMTP id 7F91A80004A; Tue, 1 Aug 2023 12:00:33 +0200 (CEST) Received: from mbx-essen-01.secunet.de (10.53.40.197) by cas-essen-01.secunet.de (10.53.40.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 1 Aug 2023 12:00:33 +0200 Received: from gauss2.secunet.de (10.182.7.193) by mbx-essen-01.secunet.de (10.53.40.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 1 Aug 2023 12:00:33 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id CD87C3182B3B; Tue, 1 Aug 2023 12:00:32 +0200 (CEST) Date: Tue, 1 Aug 2023 12:00:32 +0200 From: Steffen Klassert To: Lin Ma CC: , , , , , , Subject: Re: [PATCH v1] xfrm: add forgotten nla_policy for XFRMA_MTIMER_THRESH Message-ID: References: <20230723074110.3705047-1-linma@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230723074110.3705047-1-linma@zju.edu.cn> X-ClientProxiedBy: cas-essen-01.secunet.de (10.53.40.201) To mbx-essen-01.secunet.de (10.53.40.197) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 23, 2023 at 03:41:10PM +0800, Lin Ma wrote: > The previous commit 4e484b3e969b ("xfrm: rate limit SA mapping change > message to user space") added one additional attribute named > XFRMA_MTIMER_THRESH and described its type at compat_policy > (net/xfrm/xfrm_compat.c). > > However, the author forgot to also describe the nla_policy at > xfrma_policy (net/xfrm/xfrm_user.c). Hence, this suppose NLA_U32 (4 > bytes) value can be faked as empty (0 bytes) by a malicious user, which > leads to 4 bytes overflow read and heap information leak when parsing > nlattrs. > > To exploit this, one malicious user can spray the SLUB objects and then > leverage this 4 bytes OOB read to leak the heap data into > x->mapping_maxage (see xfrm_update_ae_params(...)), and leak it to > userspace via copy_to_user_state_extra(...). > > The above bug is assigned CVE-2023-3773. To fix it, this commit just > completes the nla_policy description for XFRMA_MTIMER_THRESH, which > enforces the length check and avoids such OOB read. > > Fixes: 4e484b3e969b ("xfrm: rate limit SA mapping change message to user space") > Signed-off-by: Lin Ma Also applied, thanks Lin!