2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 06:34:11 +08:00
linux-next/fs/nfs
Trond Myklebust 143f412eb4 [PATCH] NFS: Fix a potential panic in O_DIRECT
Based on an original patch by Mike O'Connor and Greg Banks of SGI.

Mike states:

A normal user can panic an NFS client and cause a local DoS with
'judicious'(?) use of O_DIRECT.  Any O_DIRECT write to an NFS file where the
user buffer starts with a valid mapped page and contains an unmapped page,
will crash in this way.  I haven't followed the code, but O_DIRECT reads with
similar user buffers will probably also crash albeit in different ways.

Details: when nfs_get_user_pages() calls get_user_pages(), it detects and
correctly handles get_user_pages() returning an error, which happens if the
first page covered by the user buffer's address range is unmapped.  However,
if the first page is mapped but some subsequent page isn't, get_user_pages()
will return a positive number which is less than the number of pages requested
(this behaviour is sort of analagous to a short write() call and appears to be
intentional).  nfs_get_user_pages() doesn't detect this and hands off the
array of pages (whose last few elements are random rubbish from the newly
allocated array memory) to it's caller, whence they go to
nfs_direct_write_seg(), which then totally ignores the nr_pages it's given,
and calculates its own idea of how many pages are in the array from the user
buffer length.  Needless to say, when it comes to transmit those uninitialised
page* pointers, we see a crash in the network stack.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-14 07:57:17 -08:00
..
callback_proc.c NFSv4: Ensure change attribute returned by GETATTR callback conforms to spec 2006-01-06 14:58:51 -05:00
callback_xdr.c [PATCH] NFSv4: Fix an Oops in the callback code. 2005-06-22 16:07:29 -04:00
callback.c NFSv4: Allow user to set the port used by the NFSv4 callback channel 2006-01-06 14:58:52 -05:00
callback.h NFSv4: Allow user to set the port used by the NFSv4 callback channel 2006-01-06 14:58:52 -05:00
delegation.c NFSv4: Fix an Oops in nfs_do_expire_all_delegations 2006-01-06 14:58:58 -05:00
delegation.h NFSv4: Ensure change attribute returned by GETATTR callback conforms to spec 2006-01-06 14:58:51 -05:00
dir.c [PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem 2006-01-09 15:59:24 -08:00
direct.c [PATCH] NFS: Fix a potential panic in O_DIRECT 2006-03-14 07:57:17 -08:00
file.c [PATCH] fix posix lock on NFS 2005-12-22 09:24:05 -08:00
idmap.c NFSv4: Allow entries in the idmap cache to expire 2006-01-06 14:58:58 -05:00
inode.c [PATCH] per-mountpoint noatime/nodiratime 2006-01-10 08:01:34 -08:00
Makefile NFSv4: Allow user to set the port used by the NFSv4 callback channel 2006-01-06 14:58:52 -05:00
mount_clnt.c SUNRPC: get rid of cl_chatty 2006-01-06 14:58:56 -05:00
nfs2xdr.c NFS: get rid of some needless code obfuscation in xdr_encode_sattr(). 2006-01-06 14:58:57 -05:00
nfs3acl.c [PATCH] NFS: Introduce the use of inode->i_lock to protect fields in nfsi 2005-08-18 12:53:57 -07:00
nfs3proc.c NFSv3: try get_root user-supplied security_flavor 2006-01-06 14:58:55 -05:00
nfs3xdr.c NFS: Send valid mode bits to the server 2006-01-06 14:58:57 -05:00
nfs4_fs.h NFSv4: Remove requirement for machine creds for the "setclientid" operation 2006-01-06 14:58:47 -05:00
nfs4proc.c NFSv4: Ensure DELEGRETURN returns attributes 2006-01-06 14:58:51 -05:00
nfs4renewd.c NFSv4: Remove requirement for machine creds for the "renew" operation 2006-01-06 14:58:47 -05:00
nfs4state.c NFSv4: Remove requirement for machine creds for the "setclientid" operation 2006-01-06 14:58:47 -05:00
nfs4xdr.c NFS: Send valid mode bits to the server 2006-01-06 14:58:57 -05:00
nfsroot.c [PATCH] nfsroot port= parameter fix [backport of 2.4 fix] 2006-02-07 21:00:42 -05:00
pagelist.c [PATCH] NFS: Replace nfs_page insertion sort with a radix sort 2005-06-22 16:07:39 -04:00
proc.c NFS: Send valid mode bits to the server 2006-01-06 14:58:57 -05:00
read.c NFS: support large reads and writes on the wire 2006-01-06 14:58:49 -05:00
symlink.c Fix nasty ncpfs symlink handling bug. 2005-08-19 18:02:56 -07:00
sysctl.c NFSv4: Allow entries in the idmap cache to expire 2006-01-06 14:58:58 -05:00
unlink.c SUNRPC: Further cleanups 2006-01-06 14:58:40 -05:00
write.c NFS: Make stat() return updated mtimes after a write() 2006-01-06 14:58:50 -05:00