30 May, 2018

1 commit


02 May, 2018

3 commits

  • commit 9c55ad1c214d9f8c4594ac2c3fa392c1c32431a7 upstream.

    ceph_con_workfn() validates con->state before calling try_read() and
    then try_write(). However, try_read() temporarily releases con->mutex,
    notably in process_message() and ceph_con_in_msg_alloc(), opening the
    window for ceph_con_close() to sneak in, close the connection and
    release con->sock. When try_write() is called on the assumption that
    con->state is still valid (i.e. not STANDBY or CLOSED), a NULL sock
    gets passed to the networking stack:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
    IP: selinux_socket_sendmsg+0x5/0x20

    Make sure con->state is valid at the top of try_write() and add an
    explicit BUG_ON for this, similar to try_read().

    Cc: stable@vger.kernel.org
    Link: https://tracker.ceph.com/issues/23706
    Signed-off-by: Ilya Dryomov
    Reviewed-by: Jason Dillaman
    Signed-off-by: Greg Kroah-Hartman

    Ilya Dryomov
     
  • commit 7b4c443d139f1d2b5570da475f7a9cbcef86740c upstream.

    If we go without an established session for a while, backoff delay will
    climb to 30 seconds. The keepalive timeout is also 30 seconds, so it's
    pretty easily hit after a prolonged hunting for a monitor: we don't get
    a chance to send out a keepalive in time, which means we never get back
    a keepalive ack in time, cutting an established session and attempting
    to connect to a different monitor every 30 seconds:

    [Sun Apr 1 23:37:05 2018] libceph: mon0 10.80.20.99:6789 session established
    [Sun Apr 1 23:37:36 2018] libceph: mon0 10.80.20.99:6789 session lost, hunting for new mon
    [Sun Apr 1 23:37:36 2018] libceph: mon2 10.80.20.103:6789 session established
    [Sun Apr 1 23:38:07 2018] libceph: mon2 10.80.20.103:6789 session lost, hunting for new mon
    [Sun Apr 1 23:38:07 2018] libceph: mon1 10.80.20.100:6789 session established
    [Sun Apr 1 23:38:37 2018] libceph: mon1 10.80.20.100:6789 session lost, hunting for new mon
    [Sun Apr 1 23:38:37 2018] libceph: mon2 10.80.20.103:6789 session established
    [Sun Apr 1 23:39:08 2018] libceph: mon2 10.80.20.103:6789 session lost, hunting for new mon

    The regular keepalive interval is 10 seconds. After ->hunting is
    cleared in finish_hunting(), call __schedule_delayed() to ensure we
    send out a keepalive after 10 seconds.

    Cc: stable@vger.kernel.org # 4.7+
    Link: http://tracker.ceph.com/issues/23537
    Signed-off-by: Ilya Dryomov
    Reviewed-by: Jason Dillaman
    Signed-off-by: Greg Kroah-Hartman

    Ilya Dryomov
     
  • commit facb9f6eba3df4e8027301cc0e514dc582a1b366 upstream.

    This means that if we do some backoff, then authenticate, and are
    healthy for an extended period of time, a subsequent failure won't
    leave us starting our hunting sequence with a large backoff.

    Mirrors ceph.git commit d466bc6e66abba9b464b0b69687cf45c9dccf383.

    Cc: stable@vger.kernel.org # 4.7+
    Signed-off-by: Ilya Dryomov
    Reviewed-by: Jason Dillaman
    Signed-off-by: Greg Kroah-Hartman

    Ilya Dryomov
     

30 Nov, 2017

1 commit

  • commit b11270853fa3654f08d4a6a03b23ddb220512d8d upstream.

    The WARN_ON(!key->len) in set_secret() in net/ceph/crypto.c is hit if a
    user tries to add a key of type "ceph" with an invalid payload as
    follows (assuming CONFIG_CEPH_LIB=y):

    echo -e -n '\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' \
    | keyctl padd ceph desc @s

    This can be hit by fuzzers. As this is merely bad input and not a
    kernel bug, replace the WARN_ON() with return -EINVAL.

    Fixes: 7af3ea189a9a ("libceph: stop allocating a new cipher on every crypto request")
    Signed-off-by: Eric Biggers
    Reviewed-by: Ilya Dryomov
    Signed-off-by: Ilya Dryomov
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Sep, 2017

1 commit

  • This reverts most of commit f53b7665c8ce ("libceph: upmap semantic
    changes").

    We need to prevent duplicates in the final result. For example, we
    can currently take

    [1,2,3] and apply [(1,2)] and get [2,2,3]

    or

    [1,2,3] and apply [(3,2)] and get [1,2,2]

    The rest of the system is not prepared to handle duplicates in the
    result set like this.

    The reverted piece was intended to allow

    [1,2,3] and [(1,2),(2,1)] to get [2,1,3]

    to reorder primaries. First, this bidirectional swap is hard to
    implement in a way that also prevents dups. For example, [1,2,3] and
    [(1,4),(2,3),(3,4)] would give [4,3,4] but would we just drop the last
    step we'd have [4,3,3] which is also invalid, etc. Simpler to just not
    handle bidirectional swaps. In practice, they are not needed: if you
    just want to choose a different primary then use primary_affinity, or
    pg_upmap (not pg_upmap_items).

    Cc: stable@vger.kernel.org # 4.13
    Link: http://tracker.ceph.com/issues/21410
    Signed-off-by: Ilya Dryomov
    Reviewed-by: Sage Weil

    Ilya Dryomov
     

07 Sep, 2017

2 commits

  • Improve accuracy of statfs reporting for Ceph filesystems comprising
    exactly one data pool. In this case, the Ceph monitor can now report
    the space usage for the single data pool instead of the global data
    for the entire Ceph cluster. Include support for this message in
    mon_client and leverage it in ceph/super.

    Signed-off-by: Douglas Fuller
    Reviewed-by: Yan, Zheng
    Reviewed-by: Ilya Dryomov
    Signed-off-by: Ilya Dryomov

    Douglas Fuller
     
  • startsync is a no-op, has been for years. Remove it.

    Link: http://tracker.ceph.com/issues/20604
    Signed-off-by: Yanhu Cao
    Reviewed-by: "Yan, Zheng"
    Signed-off-by: Ilya Dryomov

    Yanhu Cao
     

01 Aug, 2017

6 commits


17 Jul, 2017

5 commits


16 Jul, 2017

1 commit

  • Pull random updates from Ted Ts'o:
    "Add wait_for_random_bytes() and get_random_*_wait() functions so that
    callers can more safely get random bytes if they can block until the
    CRNG is initialized.

    Also print a warning if get_random_*() is called before the CRNG is
    initialized. By default, only one single-line warning will be printed
    per boot. If CONFIG_WARN_ALL_UNSEEDED_RANDOM is defined, then a
    warning will be printed for each function which tries to get random
    bytes before the CRNG is initialized. This can get spammy for certain
    architecture types, so it is not enabled by default"

    * tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random:
    random: reorder READ_ONCE() in get_random_uXX
    random: suppress spammy warnings about unseeded randomness
    random: warn when kernel uses unseeded randomness
    net/route: use get_random_int for random counter
    net/neighbor: use get_random_u32 for 32-bit hash random
    rhashtable: use get_random_u32 for hash_rnd
    ceph: ensure RNG is seeded before using
    iscsi: ensure RNG is seeded before use
    cifs: use get_random_u32 for 32-bit lock random
    random: add get_random_{bytes,u32,u64,int,long,once}_wait family
    random: add wait_for_random_bytes() API

    Linus Torvalds
     

07 Jul, 2017

19 commits