1. 25 1月, 2020 29 次提交
  2. 21 1月, 2020 7 次提交
  3. 20 1月, 2020 4 次提交
    • D
      9pfs/9p.c: remove unneeded labels · b858e80a
      Daniel Henrique Barboza 提交于
      'out' label in v9fs_xattr_write() and 'out_nofid' label in
      v9fs_complete_rename() can be replaced by appropriate return
      calls.
      
      CC: Greg Kurz <groug@kaod.org>
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Acked-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      b858e80a
    • D
      virtfs-proxy-helper.c: remove 'err_out' label in setugid() · ff59c5ee
      Daniel Henrique Barboza 提交于
      'err_out' can be removed and be replaced by 'return -errno'
      in its only instance in the function.
      
      CC: Greg Kurz <groug@kaod.org>
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Acked-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      ff59c5ee
    • G
      9p: init_in_iov_from_pdu can truncate the size · 16724a17
      Greg Kurz 提交于
      init_in_iov_from_pdu might not be able to allocate the full buffer size
      requested, which comes from the client and could be larger than the
      transport has available at the time of the request. Specifically, this
      can happen with read operations, with the client requesting a read up to
      the max allowed, which might be more than the transport has available at
      the time.
      
      Today the implementation of init_in_iov_from_pdu throws an error, both
      Xen and Virtio.
      
      Instead, change the V9fsTransport interface so that the size becomes a
      pointer and can be limited by the implementation of
      init_in_iov_from_pdu.
      
      Change both the Xen and Virtio implementations to set the size to the
      size of the buffer they managed to allocate, instead of throwing an
      error. However, if the allocated buffer size is less than P9_IOHDRSZ
      (the size of the header) still throw an error as the case is unhandable.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@xilinx.com>
      CC: groug@kaod.org
      CC: anthony.perard@citrix.com
      CC: roman@zededa.com
      CC: qemu_oss@crudebyte.com
      [groug: fix 32-bit build]
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      16724a17
    • D
      9p: local: always return -1 on error in local_unlinkat_common · 846cf408
      Daniel Henrique Barboza 提交于
      local_unlinkat_common() is supposed to always return -1 on error.
      This is being done by jumps to the 'err_out' label, which is
      a 'return ret' call, and 'ret' is initialized with -1.
      
      Unfortunately there is a condition in which the function will
      return 0 on error: in a case where flags == AT_REMOVEDIR, 'ret'
      will be 0 when reaching
      
      map_dirfd = openat_dir(...)
      
      And, if map_dirfd == -1 and errno != ENOENT, the existing 'err_out'
      jump will execute 'return ret', when ret is still set to zero
      at that point.
      
      This patch fixes it by changing all 'err_out' labels by
      'return -1' calls, ensuring that the function will always
      return -1 on error conditions. 'ret' can be left unintialized
      since it's now being used just to store the result of 'unlinkat'
      calls.
      
      CC: Greg Kurz <groug@kaod.org>
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      [groug: changed prefix in title to be "9p: local:"]
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      846cf408