Merge tag '9p-for-5.10-rc1' of git://github.com/martinetd/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Oct 2020 16:33:20 +0000 (09:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Oct 2020 16:33:20 +0000 (09:33 -0700)
Pull 9p updates from Dominique Martinet:
 "A couple of small fixes (loff_t overflow on 32bit, syzbot
  uninitialized variable warning) and code cleanup (xen)"

* tag '9p-for-5.10-rc1' of git://github.com/martinetd/linux:
  net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid
  9p/xen: Fix format argument warning
  9P: Cast to loff_t before multiplying

fs/9p/vfs_file.c
net/9p/trans_fd.c
net/9p/trans_xen.c

index 6ecf863..b177fd3 100644 (file)
@@ -612,9 +612,9 @@ static void v9fs_mmap_vm_close(struct vm_area_struct *vma)
        struct writeback_control wbc = {
                .nr_to_write = LONG_MAX,
                .sync_mode = WB_SYNC_ALL,
-               .range_start = vma->vm_pgoff * PAGE_SIZE,
+               .range_start = (loff_t)vma->vm_pgoff * PAGE_SIZE,
                 /* absolute end, byte at end included */
-               .range_end = vma->vm_pgoff * PAGE_SIZE +
+               .range_end = (loff_t)vma->vm_pgoff * PAGE_SIZE +
                        (vma->vm_end - vma->vm_start - 1),
        };
 
index c0762a3..8f528e7 100644 (file)
@@ -1023,7 +1023,7 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
 
        csocket = NULL;
 
-       if (addr == NULL)
+       if (!addr || !strlen(addr))
                return -EINVAL;
 
        if (strlen(addr) >= UNIX_PATH_MAX) {
index bc8807d..f4fea28 100644 (file)
@@ -451,13 +451,13 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev,
                char str[16];
 
                BUILD_BUG_ON(XEN_9PFS_NUM_RINGS > 9);
-               sprintf(str, "ring-ref%u", i);
+               sprintf(str, "ring-ref%d", i);
                ret = xenbus_printf(xbt, dev->nodename, str, "%d",
                                    priv->rings[i].ref);
                if (ret)
                        goto error_xenbus;
 
-               sprintf(str, "event-channel-%u", i);
+               sprintf(str, "event-channel-%d", i);
                ret = xenbus_printf(xbt, dev->nodename, str, "%u",
                                    priv->rings[i].evtchn);
                if (ret)