lkml.org 
[lkml]   [2002]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectpatch 30/38: SERVER: overflow check in nfsd_commit()

Sanity check COMMIT arguments by ensuring that (start)+(length) < 2^64.
The check is done in a way which is free of signedness pathologies in
all cases.

This change was inspired by pynfs, Peter Astrand's regression testsuite
for NFSv4 servers. The change is necessary for all of the COMMIT tests
to pass. However, it's a little open to debate whether the change is
really needed. I'm curious to hear the opinions of other developers.


--- old/fs/nfsd/vfs.c Tue Jul 30 23:24:21 2002
+++ new/fs/nfsd/vfs.c Mon Jul 29 11:50:09 2002
@@ -756,6 +756,9 @@ nfsd_commit(struct svc_rqst *rqstp, stru
struct file file;
int err;

+ if ((u64)count > ~(u64)offset)
+ return nfserr_inval;
+
if ((err = nfsd_open(rqstp, fhp, S_IFREG, MAY_WRITE, &file)) != 0)
return err;
if (EX_ISSYNC(fhp->fh_export)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.024 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site