nfs4: fix a typo of NFS_ATTR_FATTR_GROUP_NAME
diff mbox

Message ID dca17f2f-419d-72fb-a570-6e780f1bb7fd@gmail.com
State New
Headers show

Commit Message

Kinglong Mee March 6, 2017, 9:49 a.m. UTC
This typo cause a memory leak, and a bad client's group id.
unreferenced object 0xffff96d8073998d0 (size 8):
  comm "kworker/0:3", pid 34224, jiffies 4295361338 (age 761.752s)
  hex dump (first 8 bytes):
    30 00 39 07 d8 96 ff ff                          0.9.....
  backtrace:
    [<ffffffffb883212a>] kmemleak_alloc+0x4a/0xa0
    [<ffffffffb8237bc0>] __kmalloc+0x140/0x220
    [<ffffffffc05c921c>] xdr_stream_decode_string_dup+0x7c/0x110 [sunrpc]
    [<ffffffffc08edcf0>] decode_getfattr_attrs+0x940/0x1630 [nfsv4]
    [<ffffffffc08eea7b>] decode_getfattr_generic.constprop.108+0x9b/0x100 [nfsv4]
    [<ffffffffc08eebaf>] nfs4_xdr_dec_open+0xcf/0x100 [nfsv4]
    [<ffffffffc05bf9c7>] rpcauth_unwrap_resp+0xa7/0xe0 [sunrpc]
    [<ffffffffc05afc70>] call_decode+0x1e0/0x810 [sunrpc]
    [<ffffffffc05bc64d>] __rpc_execute+0x8d/0x420 [sunrpc]
    [<ffffffffc05bc9f2>] rpc_async_schedule+0x12/0x20 [sunrpc]
    [<ffffffffb80bb077>] process_one_work+0x197/0x430
    [<ffffffffb80bb35e>] worker_thread+0x4e/0x4a0
    [<ffffffffb80c1d41>] kthread+0x101/0x140
    [<ffffffffb8839a5c>] ret_from_fork+0x2c/0x40
    [<ffffffffffffffff>] 0xffffffffffffffff

Fixes: 686a816ab6 ("NFSv4: Clean up owner/group attribute decode")
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfs/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Trond Myklebust March 7, 2017, 1:13 a.m. UTC | #1
T24gTW9uLCAyMDE3LTAzLTA2IGF0IDE3OjQ5ICswODAwL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KyksIDEgZGVsZXRpb24oLSkNCj4gDQo+IGRpZmYgLS1n
aXQgYS9mcy9uZnMvbmZzNHhkci5jIGIvZnMvbmZzL25mczR4ZHIuYw0KPiBpbmRleCBmMDM2OWUz
Li44MGNlMjg5IDEwMDY0NA0KPiAtLS0gYS9mcy9uZnMvbmZzNHhkci5jDQo+ICsrKyBiL2ZzL25m
cy9uZnM0eGRyLmMNCj4gQEAgLTM5NDIsNyArMzk0Miw3IEBAIHN0YXRpYyBpbnQgZGVjb2RlX2F0
dHJfZ3JvdXAoc3RydWN0IHhkcl9zdHJlYW0NCj4gKnhkciwgdWludDMyX3QgKmJpdG1hcCwNCj4g
wqAJCWlmIChsZW4gPD0gMCkNCj4gwqAJCQlnb3RvIG91dDsNCj4gwqAJCWRwcmludGsoIiVzOiBu
YW1lPSVzXG4iLCBfX2Z1bmNfXywgZ3JvdXBfbmFtZS0NCj4gPmRhdGEpOw0KPiAtCQlyZXR1cm4g
TkZTX0FUVFJfRkFUVFJfT1dORVJfTkFNRTsNCj4gKwkJcmV0dXJuIE5GU19BVFRSX0ZBVFRSX0dS
T1VQX05BTUU7DQo+IMKgCX0gZWxzZSB7DQo+IMKgCQlsZW4gPSB4ZHJfc3RyZWFtX2RlY29kZV9v
cGFxdWVfaW5saW5lKHhkciwgKHZvaWQNCj4gKiopJnAsDQo+IMKgCQkJCVhEUl9NQVhfTkVUT0JK
KTsNCg0KRG9oISBUaGFua3MgZm9yIGZpeGluZyB0aGlzLiBJIHdvbmRlciB3aHkgaXQgZGlkbid0
IHJlZ2lzdGVyIG9uDQp0ZXN0aW5nPw0KDQotLSANClRyb25kIE15a2xlYnVzdA0KTGludXggTkZT
IGNsaWVudCBtYWludGFpbmVyLCBQcmltYXJ5RGF0YQ0KdHJvbmQubXlrbGVidXN0QHByaW1hcnlk
YXRhLmNvbQ0K

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index f0369e3..80ce289 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3942,7 +3942,7 @@  static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap,
 		if (len <= 0)
 			goto out;
 		dprintk("%s: name=%s\n", __func__, group_name->data);
-		return NFS_ATTR_FATTR_OWNER_NAME;
+		return NFS_ATTR_FATTR_GROUP_NAME;
 	} else {
 		len = xdr_stream_decode_opaque_inline(xdr, (void **)&p,
 				XDR_MAX_NETOBJ);