Bug 1002385 - NFS filehandle size change from 3.2 results in stack corruption
Summary: NFS filehandle size change from 3.2 results in stack corruption
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: nfs
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: santosh pradhan
QA Contact:
URL:
Whiteboard:
: 893778 (view as bug list)
Depends On:
Blocks: 902857 998649
TreeView+ depends on / blocked
 
Reported: 2013-08-29 05:19 UTC by Anand Avati
Modified: 2015-09-01 23:06 UTC (History)
5 users (show)

Fixed In Version: glusterfs-3.5.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-17 11:46:28 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Anand Avati 2013-08-29 05:19:34 UTC
An NFS client presenting a large file handle (either fake or generated by 3.2.x NFS server) results in the corruption of stack, because the new smaller file handle structure is declared on the stack and we copy the large object overflowing the buffer.

Comment 1 Anand Avati 2013-08-29 05:22:08 UTC
REVIEW: http://review.gluster.org/5730 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#1) for review on master by Anand Avati (avati)

Comment 2 Anand Avati 2013-08-29 07:04:16 UTC
REVIEW: http://review.gluster.org/5730 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#2) for review on master by Anand Avati (avati)

Comment 3 Anand Avati 2013-08-29 07:17:36 UTC
REVIEW: http://review.gluster.org/5730 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#3) for review on master by Anand Avati (avati)

Comment 4 Anand Avati 2013-08-29 13:06:42 UTC
COMMIT: http://review.gluster.org/5730 committed in master by Vijay Bellur (vbellur) 
------
commit 3a3441ef7665b5f55a9e2de63ea07173bf0f0db0
Author: Anand Avati <avati>
Date:   Mon Aug 26 21:58:26 2013 -0700

    nfs: prevent NFS server crash when upgrading from 3.2.x server
    
    After an upgrade the NFS3 filehandle size changed (became smaller),
    but when doing a live ugprade the client would send the old handle
    (expect ESTALE and do fresh lookup). But when reading the old
    handle we were reading it into a structure which was limited to the
    size of the new handle, while we should have been reading into a
    buffer which is as big as the NFS3 spec permits the handle size to
    be. The actor functions declare the structure on the stack. So the
    overflow is resulting in a stack corruption.
    
    Change-Id: Ie930875ac9db46b43d1cb8ad1e6d89cdaeded7ca
    BUG: 1002385
    Signed-off-by: Anand Avati <avati>
    Reviewed-on: http://review.gluster.org/5730
    Reviewed-by: Rajesh Joseph <rjoseph>
    Reviewed-by: Niels de Vos <ndevos>
    Tested-by: Gluster Build System <jenkins.com>

Comment 5 santosh pradhan 2013-08-29 18:46:52 UTC
*** Bug 893778 has been marked as a duplicate of this bug. ***

Comment 6 Anand Avati 2013-09-05 10:35:58 UTC
REVIEW: http://review.gluster.org/5804 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#1) for review on release-3.4 by Vijay Bellur (vbellur)

Comment 7 Anand Avati 2013-09-05 15:10:05 UTC
REVIEW: http://review.gluster.org/5804 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#2) for review on release-3.4 by Vijay Bellur (vbellur)

Comment 8 Anand Avati 2013-09-06 04:24:15 UTC
REVIEW: http://review.gluster.org/5804 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#3) for review on release-3.4 by Vijay Bellur (vbellur)

Comment 9 Anand Avati 2013-09-06 07:40:15 UTC
REVIEW: http://review.gluster.org/5804 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#4) for review on release-3.4 by Vijay Bellur (vbellur)

Comment 10 Anand Avati 2013-09-07 14:58:20 UTC
REVIEW: http://review.gluster.org/5804 (nfs: prevent NFS server crash when upgrading from 3.2.x server) posted (#5) for review on release-3.4 by Vijay Bellur (vbellur)

Comment 11 Anand Avati 2013-09-10 00:17:24 UTC
COMMIT: http://review.gluster.org/5804 committed in release-3.4 by Anand Avati (avati) 
------
commit 6e9dbdd6e16cca1e32e7c7e00b2618a837f1c18a
Author: Anand Avati <avati>
Date:   Mon Aug 26 21:58:26 2013 -0700

    nfs: prevent NFS server crash when upgrading from 3.2.x server
    
    After an upgrade the NFS3 filehandle size changed (became smaller),
    but when doing a live ugprade the client would send the old handle
    (expect ESTALE and do fresh lookup). But when reading the old
    handle we were reading it into a structure which was limited to the
    size of the new handle, while we should have been reading into a
    buffer which is as big as the NFS3 spec permits the handle size to
    be. The actor functions declare the structure on the stack. So the
    overflow is resulting in a stack corruption.
    
    Change-Id: Ie930875ac9db46b43d1cb8ad1e6d89cdaeded7ca
    BUG: 1002385
    Signed-off-by: Anand Avati <avati>
    Reviewed-on: http://review.gluster.org/5730
    Reviewed-by: Rajesh Joseph <rjoseph>
    Reviewed-by: Niels de Vos <ndevos>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-on: http://review.gluster.org/5804
    Reviewed-by: Kaleb KEITHLEY <kkeithle>

Comment 12 Niels de Vos 2014-04-17 11:46:28 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.5.0, please reopen this bug report.

glusterfs-3.5.0 has been announced on the Gluster Developers mailinglist [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/6137
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


Note You need to log in before you can comment on or make changes to this bug.