28 Mar, 2020

1 commit


26 Mar, 2020

4 commits

  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Refactor pnfs_generic_commit_pagelist() to simplify the conversion
    to layout segment based commit lists.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Just allocate the array at the end of the layout segment structure,
    instead of allocating it as a separate array of pointers.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Ever since commit 2c94b8eca1a2 ("SUNRPC: Use au_rslack when computing
    reply buffer size"). It changed how "req->rq_rcvsize" is calculated. It
    used to use au_cslack value which was nice and large and changed it to
    au_rslack value which turns out to be too small.

    Since 5.1, v3 mount with sec=krb5p fails against an Ontap server
    because client's receive buffer it too small.

    For gss krb5p, we need to account for the mic token in the verifier,
    and the wrap token in the wrap token.

    RFC 4121 defines:
    mic token
    Octet no Name Description
    --------------------------------------------------------------
    0..1 TOK_ID Identification field. Tokens emitted by
    GSS_GetMIC() contain the hex value 04 04
    expressed in big-endian order in this
    field.
    2 Flags Attributes field, as described in section
    4.2.2.
    3..7 Filler Contains five octets of hex value FF.
    8..15 SND_SEQ Sequence number field in clear text,
    expressed in big-endian order.
    16..last SGN_CKSUM Checksum of the "to-be-signed" data and
    octet 0..15, as described in section 4.2.4.

    that's 16bytes (GSS_KRB5_TOK_HDR_LEN) + chksum

    wrap token
    Octet no Name Description
    --------------------------------------------------------------
    0..1 TOK_ID Identification field. Tokens emitted by
    GSS_Wrap() contain the hex value 05 04
    expressed in big-endian order in this
    field.
    2 Flags Attributes field, as described in section
    4.2.2.
    3 Filler Contains the hex value FF.
    4..5 EC Contains the "extra count" field, in big-
    endian order as described in section 4.2.3.
    6..7 RRC Contains the "right rotation count" in big-
    endian order, as described in section
    4.2.5.
    8..15 SND_SEQ Sequence number field in clear text,
    expressed in big-endian order.
    16..last Data Encrypted data for Wrap tokens with
    confidentiality, or plaintext data followed
    by the checksum for Wrap tokens without
    confidentiality, as described in section
    4.2.4.

    Also 16bytes of header (GSS_KRB5_TOK_HDR_LEN), encrypted data, and cksum
    (other things like padding)

    RFC 3961 defines known cksum sizes:
    Checksum type sumtype checksum section or
    value size reference
    ---------------------------------------------------------------------
    CRC32 1 4 6.1.3
    rsa-md4 2 16 6.1.2
    rsa-md4-des 3 24 6.2.5
    des-mac 4 16 6.2.7
    des-mac-k 5 8 6.2.8
    rsa-md4-des-k 6 16 6.2.6
    rsa-md5 7 16 6.1.1
    rsa-md5-des 8 24 6.2.4
    rsa-md5-des3 9 24 ??
    sha1 (unkeyed) 10 20 ??
    hmac-sha1-des3-kd 12 20 6.3
    hmac-sha1-des3 13 20 ??
    sha1 (unkeyed) 14 20 ??
    hmac-sha1-96-aes128 15 20 [KRB5-AES]
    hmac-sha1-96-aes256 16 20 [KRB5-AES]
    [reserved] 0x8003 ? [GSS-KRB5]

    Linux kernel now mainly supports type 15,16 so max cksum size is 20bytes.
    (GSS_KRB5_MAX_CKSUM_LEN)

    Re-use already existing define of GSS_KRB5_MAX_SLACK_NEEDED that's used
    for encoding the gss_wrap tokens (same tokens are used in reply).

    Fixes: 2c94b8eca1a2 ("SUNRPC: Use au_rslack when computing reply buffer size")
    Signed-off-by: Olga Kornievskaia
    Reviewed-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Olga Kornievskaia
     

25 Mar, 2020

2 commits

  • UDP was originally disabled in 6da1a034362f for NFSv4. Later in
    b24ee6c64ca7 UDP is by default disabled by NFS_DISABLE_UDP_SUPPORT=y for
    all NFS versions. Therefore remove v4 from error message.

    Fixes: b24ee6c64ca7 ("NFS: allow deprecation of NFS UDP protocol")

    Signed-off-by: Petr Vorel
    Signed-off-by: Trond Myklebust

    Petr Vorel
     
  • UDP is disabled by default in commit b24ee6c64ca7 ("NFS: allow
    deprecation of NFS UDP protocol"), but the default mount options
    is still udp, change it to tcp to avoid the "Unsupported transport
    protocol udp" error if no protocol is specified when mount nfs.

    Fixes: b24ee6c64ca7 ("NFS: allow deprecation of NFS UDP protocol")
    Signed-off-by: Liwei Song
    Signed-off-by: Trond Myklebust

    Liwei Song
     

23 Mar, 2020

1 commit

  • When dreq is allocated by nfs_direct_req_alloc(), dreq->kref is
    initialized to 2. Therefore we need to call nfs_direct_req_release()
    twice to release the allocated dreq. Usually it is called in
    nfs_file_direct_{read, write}() and nfs_direct_complete().

    However, current code only calls nfs_direct_req_relese() once if
    nfs_get_lock_context() fails in nfs_file_direct_{read, write}().
    So, that case would result in memory leak.

    Fix this by adding the missing call.

    Signed-off-by: Misono Tomohiro
    Signed-off-by: Trond Myklebust

    Misono Tomohiro
     

18 Mar, 2020

1 commit


16 Mar, 2020

31 commits