]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - net/9p/protocol.c
9p: do not trust pdu content for stat item size
[thirdparty/kernel/stable.git] / net / 9p / protocol.c
index 9743837aebc60347911f90a3e243ebd808390a9b..766d1ef4640a316022f91bcc3e4e9a495e4a7e56 100644 (file)
@@ -570,9 +570,10 @@ int p9stat_read(struct p9_client *clnt, char *buf, int len, struct p9_wstat *st)
        if (ret) {
                p9_debug(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret);
                trace_9p_protocol_dump(clnt, &fake_pdu);
+               return ret;
        }
 
-       return ret;
+       return fake_pdu.offset;
 }
 EXPORT_SYMBOL(p9stat_read);