Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp900942pxb; Tue, 1 Feb 2022 12:46:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJypLS8SDUzDFZk69IKTEgPGle1kysiSuNi9k82MQEFwJJFk7p0WCWPYwFxHxydjvUxQ81S+ X-Received: by 2002:a63:58d:: with SMTP id 135mr21960458pgf.188.1643748413565; Tue, 01 Feb 2022 12:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748413; cv=none; d=google.com; s=arc-20160816; b=LU3BW0rw6CWDbRTtW/2IcgP74hhmGYBIkiOIjdwWkfg9CNjds9on5IC2n2XaiTjeL1 nMPVghCd30cn98HdYE7fZUTxy2fwfnava+xgcWnw8wBpduFmTAstg4tOPXHjpLsAseZZ z4nzUXkWIL/zsFOLtQ1BDK5xE+WFGJ7mz3ZDI9H7OTk8wZAMtFlxMvIQvcbZE9JD05hd 8MlfoNS8+VtgMp1ZQXoa5+xaYVYhkF6Tlk28zA8GIV5Kb5QBaKJ4FIVMh6QSLQeI5nyS HuKdUnrr6j4oXrndGXfdsIECGGWY0Z+ZIqkhj9b+c3KU/JT2kBlk3d9iUGcVVfwGNrJD xR5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:to:from:subject; bh=JpWYzrps3X9KKWEt+iqV2bisZ+q3ZCocO3BJitq6Tlk=; b=VW6Ghk8q7MyDvhx7EVO894FMffiGofLJPNJEm8Q9EQSDYpVZXk2E1ELlTzgtEWMx19 ajrdptER+kAZ5KtwEUvjcEtY58NPUSHm3zMv24dLE7Vj6VZrfv9ZdLfwMz9hl4A7sC11 ppFe3eJKIjsMH0wDGvosEsDXM+8Tp2nYOubRLL7FXmTIIDiOulAU1eoU5I6JK0i49y6D lUvYElRydDwZwVv7r6frNhGJgTovjmAG7DQgpOCzhCUXaZo0iicCxp27tR13/XfgaXT8 9h3sDBXK7v7+HCUhUtHYNzF7Q0uFEcrryIkKIl2luliTx3m746Y2tcdLyF7BwOEyfI+5 0EHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si17162644pgc.517.2022.02.01.12.46.41; Tue, 01 Feb 2022 12:46:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352535AbiAaSYw (ORCPT + 99 others); Mon, 31 Jan 2022 13:24:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355009AbiAaSYo (ORCPT ); Mon, 31 Jan 2022 13:24:44 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3936CC061401; Mon, 31 Jan 2022 10:24:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EB1F6B82BDD; Mon, 31 Jan 2022 18:24:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83CA9C340ED; Mon, 31 Jan 2022 18:24:41 +0000 (UTC) Subject: [PATCH v2 0/5] NFSD size, offset, and count sanity From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Date: Mon, 31 Jan 2022 13:24:39 -0500 Message-ID: <164365324981.3304.4571955521912946906.stgit@bazille.1015granger.net> User-Agent: StGit/1.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Dan Aloni reported a problem with the way NFSD's READ implementation deals with the very upper end of file sizes, and I got interested in how some of the other operations handled it. I found some issues, and have started a (growing) pile of patches to deal with them. Since at least the SETATTR case appears to cause a crash on some filesystems, I think several of these are 5.17-rc fodder (i.e., priority bug fixes). Dan's still working on the READ issue. Changes since RFC: - Series reordered so priority fixes come first - Setattr size check is now in a common function - Patch descriptions clarified --- Chuck Lever (5): NFSD: Fix ia_size underflow NFSD: Fix NFSv3 SETATTR/CREATE's handling of large file sizes NFSD: Clamp WRITE offsets NFSD: COMMIT operations must not return NFS?ERR_INVAL NFSD: Deprecate NFS_OFFSET_MAX fs/nfsd/nfs3proc.c | 21 ++++++++++++----- fs/nfsd/nfs3xdr.c | 4 ++-- fs/nfsd/nfs4proc.c | 5 ++-- fs/nfsd/nfs4xdr.c | 2 +- fs/nfsd/vfs.c | 57 +++++++++++++++++++++++++++++++-------------- fs/nfsd/vfs.h | 4 ++-- include/linux/nfs.h | 8 ------- 7 files changed, 63 insertions(+), 38 deletions(-) -- Chuck Lever