1
0
Fork 0
remarkable-linux/net/9p
Vincent Bernat e18d264c4e 9p: ensure err is initialized to 0 in p9_client_read/write
commit 999b8b88c6 upstream.

Some use of those functions were providing unitialized values to those
functions. Notably, when reading 0 bytes from an empty file on a 9P
filesystem, the return code of read() was not 0.

Tested with this simple program:

    #include <assert.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <unistd.h>

    int main(int argc, const char **argv)
    {
        assert(argc == 2);
        char buffer[256];
        int fd = open(argv[1], O_RDONLY|O_NOCTTY);
        assert(fd >= 0);
        assert(read(fd, buffer, 0) == 0);
        return 0;
    }

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13 09:07:50 -07:00
..
Kconfig net/9p: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:39:33 -08:00
Makefile [net/9p] Preparation and helper functions for zero copy 2011-03-15 09:57:34 -05:00
client.c 9p: ensure err is initialized to 0 in p9_client_read/write 2015-09-13 09:07:50 -07:00
error.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
mod.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
protocol.c 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
protocol.h net/9p: Convert net/9p protocol dumps to tracepoints 2011-10-24 11:13:12 -05:00
trans_common.c net/9p: remove (now-)unused helpers 2015-04-11 22:28:29 -04:00
trans_common.h net/9p: remove (now-)unused helpers 2015-04-11 22:28:29 -04:00
trans_fd.c 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
trans_rdma.c net/9p: add a privport option for RDMA transport. 2015-03-21 19:32:33 -07:00
trans_virtio.c 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
util.c net/9p: convert to idr_alloc() 2013-02-27 19:10:20 -08:00