From patchwork Fri Nov 11 13:48:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1702641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=lDEUOU7w; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N80Rd6K8wz23mY for ; Sat, 12 Nov 2022 00:49:00 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1otUOk-0005Eq-Oy; Fri, 11 Nov 2022 13:48:46 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1otUOj-0005Ei-1I for kernel-team@lists.ubuntu.com; Fri, 11 Nov 2022 13:48:45 +0000 Received: from quatroqueijos.. (unknown [179.93.206.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id D3AE6422AC for ; Fri, 11 Nov 2022 13:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1668174520; bh=UT62boO/AZoMVUc6P+heLVTiZ6WvhfgLLKktQruAdEc=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=lDEUOU7w7GOGamuGOn+j9UQLBqrgu97l71D9OKScPV76RQQvTP0yDb7TSnUZzqUaU lEAkYk1j6Yg7dg93r43+Y1bMdpvBg+AnXdPUK3q9XhvyETl/Ul10USnh7F3NYPrKs0 ismjDnYcetDc1fGtOLS5FtKuxTubyQCEX2SK8TxQtekwxg5FAec++uq6L8qsHoZp7B yW++/ICjkiYGMvqE77ba4dfqe6qBPOel+4CuoxL0Xtx2P62WoI6raIkCSj6qP9NtSO wAtrb0SD4vnhldarukwtL7tAr7oQi0G3cPXygxdVwPdMCrRGLhasEPwoWhJ1uVO1YR Q35gfpYoZedCQ== From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU J/K/HWE-5.17/OEM-5.14 0/8] CVE-2022-43945 - NFSD buffer overflow Date: Fri, 11 Nov 2022 10:48:22 -0300 Message-Id: <20221111134830.879929-1-cascardo@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" [Impact] A malicious client can cause a buffer overflow on the nfsd server by sending a crafted RPC message. [Backport] For 5.14, 5.15, 5.17 and 5.19, these are all clean cherry-picks. Backports for older kernel versions is in progress. [Potential regression] NFSD servers might misbehave. Chuck Lever (8): SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation SUNRPC: Fix svcxdr_init_encode's buflen calculation NFSD: Protect against send buffer overflow in NFSv2 READDIR NFSD: Protect against send buffer overflow in NFSv3 READDIR NFSD: Protect against send buffer overflow in NFSv2 READ NFSD: Protect against send buffer overflow in NFSv3 READ NFSD: Remove "inline" directives on op_rsize_bop helpers NFSD: Cap rsize_bop result based on send buffer size fs/nfsd/nfs3proc.c | 11 +-- fs/nfsd/nfs4proc.c | 169 ++++++++++++++++++++++--------------- fs/nfsd/nfsproc.c | 6 +- fs/nfsd/xdr4.h | 3 +- include/linux/sunrpc/svc.h | 19 ++++- 5 files changed, 125 insertions(+), 83 deletions(-) Acked-by: Stefan Bader Acked-by: Tim Gardner