Linux NFS development
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH RFC 1/6] NFSD: Fix NFSv4 SETATTR's handling of large file sizes
Date: Thu, 10 Feb 2022 08:55:09 +1100	[thread overview]
Message-ID: <20220209215509.GV59715@dread.disaster.area> (raw)
In-Reply-To: <77B0ABAA-3427-4E4E-AE5A-B6D34FB6E837@oracle.com>

On Fri, Jan 28, 2022 at 01:48:48AM +0000, Chuck Lever III wrote:
> 
> 
> > On Jan 27, 2022, at 7:36 PM, Dave Chinner <david@fromorbit.com> wrote:
> > 
> > On Thu, Jan 27, 2022 at 11:08:31AM -0500, Chuck Lever wrote:
> >> IOW it assumes the caller has already sanity-checked the value.
> > 
> > Every filesystem assumes that the iattr that is passed to ->setattr
> > by notify_change() has been sanity checked and the parameters are
> > within the valid VFS supported ranges, not just XFS. Perhaps this
> > check should be in notify_change, not in the callers?
> 
> My (limited) understanding of the VFS code is that functions at
> the notify_change() level expect that its callers will have
> already sanitized the input -- those callers are largely the
> system call routines. That's why I chose to address this in NFSD.
> 
> Maybe inode_newsize_ok() needs to check for negative size values?

Yeah, that would seem reasonable - the size passed to it is a
loff_t, and it's not checked for overflows/negative values. So if it
checked for offset < 0 if would catch this....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-02-09 22:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 16:08 [PATCH RFC 0/6] NFSD size, offset, and count sanity Chuck Lever
2022-01-27 16:08 ` [PATCH RFC 1/6] NFSD: Fix NFSv4 SETATTR's handling of large file sizes Chuck Lever
2022-01-28  0:36   ` Dave Chinner
2022-01-28  1:48     ` Chuck Lever III
2022-02-09 21:55       ` Dave Chinner [this message]
2022-01-27 16:08 ` [PATCH RFC 2/6] NFSD: Fix NFSv3 " Chuck Lever
2022-01-27 16:08 ` [PATCH RFC 3/6] NFSD: COMMIT operations must not return NFS?ERR_INVAL Chuck Lever
2022-01-27 16:08 ` [PATCH RFC 4/6] NFSD: Replace directory offset placeholder Chuck Lever
2022-01-27 16:08 ` [PATCH RFC 5/6] NFSD: Remove NFS_OFFSET_MAX Chuck Lever
2022-01-27 16:09 ` [PATCH RFC 6/6] NFSD: Clamp WRITE offsets Chuck Lever
2022-01-27 18:13 ` [PATCH RFC 0/6] NFSD size, offset, and count sanity Frank Filz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220209215509.GV59715@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox