1. 01 10月, 2018 32 次提交
  2. 23 8月, 2018 4 次提交
    • C
      sunrpc: Add comment defining gssd upcall API keywords · 108b833c
      Chuck Lever 提交于
      During review, it was found that the target, service, and srchost
      keywords are easily conflated. Add an explainer.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      108b833c
    • C
      sunrpc: Extract target name into svc_cred · 9abdda5d
      Chuck Lever 提交于
      NFSv4.0 callback needs to know the GSS target name the client used
      when it established its lease. That information is available from
      the GSS context created by gssproxy. Make it available in each
      svc_cred.
      
      Note this will also give us access to the real target service
      principal name (which is typically "nfs", but spec does not require
      that).
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      9abdda5d
    • C
      sunrpc: Enable the kernel to specify the hostname part of service principals · a1a23777
      Chuck Lever 提交于
      A multi-homed NFS server may have more than one "nfs" key in its
      keytab. Enable the kernel to pick the key it wants as a machine
      credential when establishing a GSS context.
      
      This is useful for GSS-protected NFSv4.0 callbacks, which are
      required by RFC 7530 S3.3.3 to use the same principal as the service
      principal the client used when establishing its lease.
      
      A complementary modification to rpc.gssd is required to fully enable
      this feature.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      a1a23777
    • L
      sunrpc: Don't use stack buffer with scatterlist · 44090cc8
      Laura Abbott 提交于
      Fedora got a bug report from NFS:
      
      kernel BUG at include/linux/scatterlist.h:143!
      ...
      RIP: 0010:sg_init_one+0x7d/0x90
      ..
        make_checksum+0x4e7/0x760 [rpcsec_gss_krb5]
        gss_get_mic_kerberos+0x26e/0x310 [rpcsec_gss_krb5]
        gss_marshal+0x126/0x1a0 [auth_rpcgss]
        ? __local_bh_enable_ip+0x80/0xe0
        ? call_transmit_status+0x1d0/0x1d0 [sunrpc]
        call_transmit+0x137/0x230 [sunrpc]
        __rpc_execute+0x9b/0x490 [sunrpc]
        rpc_run_task+0x119/0x150 [sunrpc]
        nfs4_run_exchange_id+0x1bd/0x250 [nfsv4]
        _nfs4_proc_exchange_id+0x2d/0x490 [nfsv4]
        nfs41_discover_server_trunking+0x1c/0xa0 [nfsv4]
        nfs4_discover_server_trunking+0x80/0x270 [nfsv4]
        nfs4_init_client+0x16e/0x240 [nfsv4]
        ? nfs_get_client+0x4c9/0x5d0 [nfs]
        ? _raw_spin_unlock+0x24/0x30
        ? nfs_get_client+0x4c9/0x5d0 [nfs]
        nfs4_set_client+0xb2/0x100 [nfsv4]
        nfs4_create_server+0xff/0x290 [nfsv4]
        nfs4_remote_mount+0x28/0x50 [nfsv4]
        mount_fs+0x3b/0x16a
        vfs_kern_mount.part.35+0x54/0x160
        nfs_do_root_mount+0x7f/0xc0 [nfsv4]
        nfs4_try_mount+0x43/0x70 [nfsv4]
        ? get_nfs_version+0x21/0x80 [nfs]
        nfs_fs_mount+0x789/0xbf0 [nfs]
        ? pcpu_alloc+0x6ca/0x7e0
        ? nfs_clone_super+0x70/0x70 [nfs]
        ? nfs_parse_mount_options+0xb40/0xb40 [nfs]
        mount_fs+0x3b/0x16a
        vfs_kern_mount.part.35+0x54/0x160
        do_mount+0x1fd/0xd50
        ksys_mount+0xba/0xd0
        __x64_sys_mount+0x21/0x30
        do_syscall_64+0x60/0x1f0
        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      This is BUG_ON(!virt_addr_valid(buf)) triggered by using a stack
      allocated buffer with a scatterlist. Convert the buffer for
      rc4salt to be dynamically allocated instead.
      
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1615258Signed-off-by: NLaura Abbott <labbott@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      44090cc8
  3. 10 8月, 2018 4 次提交
    • Z
      rpc: remove unneeded variable 'ret' in rdma_listen_handler · ac5bb5b3
      zhong jiang 提交于
      The ret is not modified after initalization, So just remove the variable
      and return 0.
      Signed-off-by: Nzhong jiang <zhongjiang@huawei.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ac5bb5b3
    • C
      NFSD: Handle full-length symlinks · 11b4d66e
      Chuck Lever 提交于
      I've given up on the idea of zero-copy handling of SYMLINK on the
      server side. This is because the Linux VFS symlink API requires the
      symlink pathname to be in a NUL-terminated kmalloc'd buffer. The
      NUL-termination is going to be problematic (watching out for
      landing on a page boundary and dealing with a 4096-byte pathname).
      
      I don't believe that SYMLINK creation is on a performance path or is
      requested frequently enough that it will cause noticeable CPU cache
      pollution due to data copies.
      
      There will be two places where a transport callout will be necessary
      to fill in the rqstp: one will be in the svc_fill_symlink_pathname()
      helper that is used by NFSv2 and NFSv3, and the other will be in
      nfsd4_decode_create().
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      11b4d66e
    • C
      NFSD: Refactor the generic write vector fill helper · 3fd9557a
      Chuck Lever 提交于
      fill_in_write_vector() is nearly the same logic as
      svc_fill_write_vector(), but there are a few differences so that
      the former can handle multiple WRITE payloads in a single COMPOUND.
      
      svc_fill_write_vector() can be adjusted so that it can be used in
      the NFSv4 WRITE code path too. Instead of assuming the pages are
      coming from rq_args.pages, have the caller pass in the page list.
      
      The immediate benefit is a reduction of code duplication. It also
      prevents the NFSv4 WRITE decoder from passing an empty vector
      element when the transport has provided the payload in the xdr_buf's
      page array.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      3fd9557a
    • C
      svcrdma: Clean up Read chunk path · 07d0ff3b
      Chuck Lever 提交于
      Simplify the error handling at the tail of recv_read_chunk() by
      re-arranging rq_pages[] housekeeping and documenting it properly.
      
      NB: In this path, svc_rdma_recvfrom returns zero. Therefore no
      subsequent reply processing is done on the svc_rqstp, and thus the
      rq_respages field does not need to be updated.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      07d0ff3b