kernel-hacking-2024-linux-s.../fs/nfs
NeilBrown 62d98c9354 NFS4: avoid underflow when converting error to pointer.
In nfs4_create_sec_client, 'flavor' can hold a negative error
code (returned from nfs4_negotiate_security), even though it
is an 'enum' and hence unsigned.

The code is careful to cast it to an (int) before testing if it
is negative, however it doesn't cast to an (int) before calling
ERR_PTR.

On a machine where "void*" is larger than "int", this results in
the unsigned equivalent of -1 (e.g. 0xffffffff) being converted
to a pointer.  Subsequent code determines that this is not
negative, and so  dereferences it with predictable results.

So: cast 'flavor' to a (signed) int before passing to ERR_PTR.

cc: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-09-25 10:38:54 -04:00
..
blocklayout pnfsblock: bail out partial page IO 2012-07-30 18:52:06 -04:00
objlayout pnfs-obj: Better IO pattern in case of unaligned offset 2012-08-02 17:42:51 -04:00
cache_lib.c
cache_lib.h
callback.c nfs: increase number of permitted callback connections. 2012-07-31 12:33:29 -04:00
callback.h NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
callback_proc.c
callback_xdr.c SUNRPC: service request network namespace helper introduced 2012-07-27 16:49:21 -04:00
client.c NFS: Fix a regression when loading the NFS v4 module 2012-08-16 16:15:49 -04:00
delegation.c
delegation.h NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
dir.c NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
direct.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-07-31 19:25:39 -07:00
dns_resolve.c NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
dns_resolve.h
file.c NFS: fsync() must exit with an error if page writeback failed 2012-09-11 15:38:32 -04:00
fscache-index.c
fscache.c
fscache.h
getroot.c NFS: Move the v4 getroot code to nfs4getroot.c 2012-07-17 13:33:51 -04:00
idmap.c NFS: return -ENOKEY when the upcall fails to map the name 2012-08-16 17:20:06 -04:00
inode.c NFS: Fix the initialisation of the readdir 'cookieverf' array 2012-09-04 14:52:42 -04:00
internal.h Merge branch 'akpm' (Andrew's patch-bomb) 2012-07-31 19:25:39 -07:00
iostat.h
Kconfig Merge branch 'akpm' (Andrew's patch-bomb) 2012-07-31 19:25:39 -07:00
Makefile NFS: Fix a regression when loading the NFS v4 module 2012-08-16 16:15:49 -04:00
mount_clnt.c
namespace.c NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
netns.h NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
nfs.h NFS: Convert v4 into a module 2012-07-30 19:06:52 -04:00
nfs2super.c NFS: Convert v2 into a module 2012-07-30 19:06:41 -04:00
nfs2xdr.c
nfs3acl.c
nfs3client.c NFS: Only initialize the ACL client in the v3 case 2012-07-30 19:05:54 -04:00
nfs3proc.c NFS: Fix the initialisation of the readdir 'cookieverf' array 2012-09-04 14:52:42 -04:00
nfs3super.c NFS: Convert v3 into a module 2012-07-30 19:06:46 -04:00
nfs3xdr.c
nfs4_fs.h NFS: Fix a regression when loading the NFS v4 module 2012-08-16 16:15:49 -04:00
nfs4client.c NFSv4: Ensure that nfs4_alloc_client cleans up on error. 2012-08-20 12:12:29 -04:00
nfs4file.c NFS: fsync() must exit with an error if page writeback failed 2012-09-11 15:38:32 -04:00
nfs4filelayout.c NFSv4.1 don't send LAYOUTCOMMIT if data resent through MDS 2012-07-16 14:37:00 -04:00
nfs4filelayout.h
nfs4filelayoutdev.c
nfs4getroot.c NFS: Move the v4 getroot code to nfs4getroot.c 2012-07-17 13:33:51 -04:00
nfs4namespace.c NFS4: avoid underflow when converting error to pointer. 2012-09-25 10:38:54 -04:00
nfs4proc.c NFS: fix the return value check by using IS_ERR 2012-09-25 10:36:37 -04:00
nfs4renewd.c
nfs4state.c NFS: Clean up nfs4_proc_setclientid() and friends 2012-07-16 15:12:16 -04:00
nfs4super.c NFS: Fix a regression when loading the NFS v4 module 2012-08-16 16:15:49 -04:00
nfs4sysctl.c NFS: Initialize v4 sysctls from nfs_init_v4() 2012-07-17 13:33:18 -04:00
nfs4xdr.c NFS: return error from decode_getfh in decode open 2012-09-06 16:01:33 -04:00
nfsroot.c
pagelist.c NFS41: add pg_layout_private to nfs_pageio_descriptor 2012-08-02 17:41:18 -04:00
pnfs.c pnfs: defer release of pages in layoutget 2012-08-02 17:38:54 -04:00
pnfs.h pnfs: nfs4_proc_layoutget returns void 2012-08-02 17:39:06 -04:00
pnfs_dev.c
proc.c NFS: Only initialize the ACL client in the v3 case 2012-07-30 19:05:54 -04:00
read.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-07-31 19:25:39 -07:00
super.c NFS: Fix a problem with the legacy binary mount code 2012-09-04 14:52:43 -04:00
symlink.c
sysctl.c NFS: Initialize v4 sysctls from nfs_init_v4() 2012-07-17 13:33:18 -04:00
unlink.c
write.c nfs: tear down caches in nfs_init_writepagecache when allocation fails 2012-08-02 17:36:07 -04:00