29 Jan, 2020

1 commit

  • commit a45ea48e2bcd92c1f678b794f488ca0bda9835b8 upstream.

    The afs filesystem needs to prohibit certain characters from cell names,
    such as '/', as these are used to form filenames in procfs, leading to
    the following warning being generated:

    WARNING: CPU: 0 PID: 3489 at fs/proc/generic.c:178

    Fix afs_alloc_cell() to disallow nonprintable characters, '/', '@' and
    names that begin with a dot.

    Remove the check for "@cell" as that is then redundant.

    This can be tested by running:

    echo add foo/.bar 1.2.3.4 >/proc/fs/afs/cells

    Note that we will also need to deal with:

    - Names ending in ".invalid" shouldn't be passed to the DNS.

    - Names that contain non-valid domainname chars shouldn't be passed to
    the DNS.

    - DNS replies that say "your-dns-needs-immediate-attention." and
    replies containing A records that say 127.0.53.53 should be
    considered invalid.
    [https://www.icann.org/en/system/files/files/name-collision-mitigation-01aug14-en.pdf]

    but these need to be dealt with by the kafs-client DNS program rather
    than the kernel.

    Reported-by: syzbot+b904ba7c947a37b4b291@syzkaller.appspotmail.com
    Cc: stable@kernel.org
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     

26 Jan, 2020

1 commit

  • [ Upstream commit 51590df4f3306cb1f43dca54e3ccdd121ab89594 ]

    Fixes gcc '-Wunused-but-set-variable' warning:

    fs/afs/dir_edit.c: In function afs_set_contig_bits:
    fs/afs/dir_edit.c:75:20: warning: variable after set but not used [-Wunused-but-set-variable]
    fs/afs/dir_edit.c: In function afs_set_contig_bits:
    fs/afs/dir_edit.c:75:12: warning: variable before set but not used [-Wunused-but-set-variable]
    fs/afs/dir_edit.c: In function afs_clear_contig_bits:
    fs/afs/dir_edit.c:100:20: warning: variable after set but not used [-Wunused-but-set-variable]
    fs/afs/dir_edit.c: In function afs_clear_contig_bits:
    fs/afs/dir_edit.c:100:12: warning: variable before set but not used [-Wunused-but-set-variable]

    They are never used since commit 63a4681ff39c.

    Fixes: 63a4681ff39c ("afs: Locally edit directory data for mkdir/create/unlink/...")
    Reported-by: Hulk Robot
    Signed-off-by: zhengbin
    Signed-off-by: David Howells
    Signed-off-by: Sasha Levin

    zhengbin
     

18 Jan, 2020

3 commits

  • commit f52b83b0b1c40ada38df917973ab719a4a753951 upstream.

    Fix afs_lookup() to not clobber the version set on a new dentry by
    afs_do_lookup() - especially as it's using the wrong version of the
    version (we need to use the one given to us by whatever op the dir
    contents correspond to rather than what's in the afs_vnode).

    Fixes: 9dd0b82ef530 ("afs: Fix missing dentry data version updating")
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     
  • commit 40a708bd622b78582ae3d280de29b09b50bd04c0 upstream.

    afs_lookup() has a tracepoint to indicate the outcome of
    d_splice_alias(), passing it the inode to retrieve the fid from.
    However, the function gave up its ref on that inode when it called
    d_splice_alias(), which may have failed and dropped the inode.

    Fix this by caching the fid.

    Fixes: 80548b03991f ("afs: Add more tracepoints")
    Reported-by: Al Viro
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     
  • commit 106bc79843c3c6f4f00753d1f46e54e815f99377 upstream.

    Fix missing cell comparison in afs_test_super(). Without this, any pair
    volumes that have the same volume ID will share a superblock, no matter the
    cell, unless they're in different network namespaces.

    Normally, most users will only deal with a single cell and so they won't
    see this. Even if they do look into a second cell, they won't see a
    problem unless they happen to hit a volume with the same ID as one they've
    already got mounted.

    Before the patch:

    # ls /afs/grand.central.org/archive
    linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
    # ls /afs/kth.se/
    linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
    # cat /proc/mounts | grep afs
    none /afs afs rw,relatime,dyn,autocell 0 0
    #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
    #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
    #grand.central.org:root.archive /afs/kth.se afs ro,relatime 0 0

    After the patch:

    # ls /afs/grand.central.org/archive
    linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
    # ls /afs/kth.se/
    admin/ common/ install/ OldFiles/ service/ system/
    bakrestores/ home/ misc/ pkg/ src/ wsadmin/
    # cat /proc/mounts | grep afs
    none /afs afs rw,relatime,dyn,autocell 0 0
    #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
    #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
    #kth.se:root.cell /afs/kth.se afs ro,relatime 0 0

    Fixes: ^1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: Carsten Jacobi
    Signed-off-by: David Howells
    Reviewed-by: Marc Dionne
    Tested-by: Jonathan Billings
    cc: Todd DeSantis
    Signed-off-by: Greg Kroah-Hartman

    David Howells
     

09 Jan, 2020

4 commits

  • [ Upstream commit 1da4bd9f9d187f53618890d7b66b9628bbec3c70 ]

    Fix the lookup method on the dynamic root directory such that creation
    calls, such as mkdir, open(O_CREAT), symlink, etc. fail with EOPNOTSUPP
    rather than failing with some odd error (such as EEXIST).

    lookup() itself tries to create automount directories when it is invoked.
    These are cached locally in RAM and not committed to storage.

    Signed-off-by: David Howells
    Reviewed-by: Marc Dionne
    Tested-by: Jonathan Billings
    Signed-off-by: Sasha Levin

    David Howells
     
  • [ Upstream commit 158d58335393af3956a9c06f0816ee75ed1f1447 ]

    Each AFS mountpoint has strings that define the target to be mounted. This
    is required to end in a dot that is supposed to be stripped off. The
    string can include suffixes of ".readonly" or ".backup" - which are
    supposed to come before the terminal dot. To add to the confusion, the "fs
    lsmount" afs utility does not show the terminal dot when displaying the
    string.

    The kernel mount source string parser, however, assumes that the terminal
    dot marks the suffix and that the suffix is always "" and is thus ignored.
    In most cases, there is no suffix and this is not a problem - but if there
    is a suffix, it is lost and this affects the ability to mount the correct
    volume.

    The command line mount command, on the other hand, is expected not to
    include a terminal dot - so the problem doesn't arise there.

    Fix this by making sure that the dot exists and then stripping it when
    passing the string to the mount configuration.

    Fixes: bec5eb614130 ("AFS: Implement an autocell mount capability [ver #2]")
    Reported-by: Jonathan Billings
    Signed-off-by: David Howells
    Reviewed-by: Marc Dionne
    Tested-by: Jonathan Billings
    Signed-off-by: Sasha Levin

    David Howells
     
  • [ Upstream commit bcbccaf2edcf1b76f73f890e968babef446151a4 ]

    Make the AFS dynamic root superblock R/W so that SELinux can set the
    security label on it. Without this, upgrades to, say, the Fedora
    filesystem-afs RPM fail if afs is mounted on it because the SELinux label
    can't be (re-)applied.

    It might be better to make it possible to bypass the R/O check for LSM
    label application through setxattr.

    Fixes: 4d673da14533 ("afs: Support the AFS dynamic root")
    Signed-off-by: David Howells
    Reviewed-by: Marc Dionne
    cc: selinux@vger.kernel.org
    cc: linux-security-module@vger.kernel.org
    Signed-off-by: Sasha Levin

    David Howells
     
  • [ Upstream commit 9bd0160d12370a076e44f8d1320cde9c83f2c647 ]

    afs_find_server tries to find a server that has an address that
    matches the transport address of an rxrpc peer. The code assumes
    that the transport address is always ipv6, with ipv4 represented
    as ipv4 mapped addresses, but that's not the case. If the transport
    family is AF_INET, srx->transport.sin6.sin6_addr.s6_addr32[] will
    be beyond the actual ipv4 address and will always be 0, and all
    ipv4 addresses will be seen as matching.

    As a result, the first ipv4 address seen on any server will be
    considered a match, and the server returned may be the wrong one.

    One of the consequences is that callbacks received over ipv4 will
    only be correctly applied for the server that happens to have the
    first ipv4 address on the fs_addresses4 list. Callbacks over ipv4
    from all other servers are dropped, causing the client to serve stale
    data.

    This is fixed by looking at the transport family, and comparing ipv4
    addresses based on a sockaddr_in structure rather than a sockaddr_in6.

    Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
    Signed-off-by: Marc Dionne
    Signed-off-by: David Howells
    Signed-off-by: Sasha Levin

    Marc Dionne
     

23 Nov, 2019

2 commits

  • By default s_maxbytes is set to MAX_NON_LFS, which limits the usable
    file size to 2GB, enforced by the vfs.

    Commit b9b1f8d5930a ("AFS: write support fixes") added support for the
    64-bit fetch and store server operations, but did not change this value.
    As a result, attempts to write past the 2G mark result in EFBIG errors:

    $ dd if=/dev/zero of=foo bs=1M count=1 seek=2048
    dd: error writing 'foo': File too large

    Set s_maxbytes to MAX_LFS_FILESIZE.

    Fixes: b9b1f8d5930a ("AFS: write support fixes")
    Signed-off-by: Marc Dionne
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Marc Dionne
     
  • Servers sending callback breaks to the YFS_CM_SERVICE service may
    send up to YFSCBMAX (1024) fids in a single RPC. Anything over
    AFSCBMAX (50) will cause the assert in afs_break_callbacks to trigger.

    Remove the assert, as the count has already been checked against
    the appropriate max values in afs_deliver_cb_callback and
    afs_deliver_yfs_cb_callback.

    Fixes: 35dbfba3111a ("afs: Implement the YFS cache manager service")
    Signed-off-by: Marc Dionne
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Marc Dionne
     

20 Nov, 2019

1 commit

  • In afs_wait_for_call_to_complete(), rather than immediately aborting an
    operation if a signal occurs, the code attempts to wait for it to
    complete, using a schedule timeout of 2*RTT (or min 2 jiffies) and a
    check that we're still receiving relevant packets from the server before
    we consider aborting the call. We may even ping the server to check on
    the status of the call.

    However, there's a missing timeout reset in the event that we do
    actually get a packet to process, such that if we then get a couple of
    short stalls, we then time out when progress is actually being made.

    Fix this by resetting the timeout any time we get something to process.
    If it's the failure of the call then the call state will get changed and
    we'll exit the loop shortly thereafter.

    A symptom of this is data fetches and stores failing with EINTR when
    they really shouldn't.

    Fixes: bc5e3a546d55 ("rxrpc: Use MSG_WAITALL to tell sendmsg() to temporarily ignore signals")
    Signed-off-by: David Howells
    Reviewed-by: Marc Dionne
    Signed-off-by: Linus Torvalds

    David Howells
     

16 Nov, 2019

1 commit

  • When a lookup is done, the afs filesystem will perform a bulk status-fetch
    operation on the requested vnode (file) plus the next 49 other vnodes from
    the directory list (in AFS, directory contents are downloaded as blobs and
    parsed locally). When the results are received, it will speculatively
    populate the inode cache from the extra data.

    However, if the lookup races with another lookup on the same directory, but
    for a different file - one that's in the 49 extra fetches, then if the bulk
    status-fetch operation finishes first, it will try and update the inode
    from the other lookup.

    If this other inode is still in the throes of being created, however, this
    will cause an assertion failure in afs_apply_status():

    BUG_ON(test_bit(AFS_VNODE_UNSET, &vnode->flags));

    on or about fs/afs/inode.c:175 because it expects data to be there already
    that it can compare to.

    Fix this by skipping the update if the inode is being created as the
    creator will presumably set up the inode with the same information.

    Fixes: 39db9815da48 ("afs: Fix application of the results of a inline bulk status fetch")
    Signed-off-by: David Howells
    Reviewed-by: Marc Dionne
    Signed-off-by: Linus Torvalds

    David Howells
     

30 Sep, 2019

1 commit


16 Sep, 2019

1 commit


02 Sep, 2019

5 commits

  • Make afs_permission() and afs_d_revalidate() do initial checks in RCU-mode
    pathwalk to reduce latency in pathwalk elements that get done multiple
    times. We don't need to query the server unless we've received a
    notification from it that something has changed or the callback has
    expired.

    This requires that we can request a key and check permits under RCU
    conditions if we need to.

    Signed-off-by: David Howells

    David Howells
     
  • Provide an RCU-capable key lookup function. We don't want to call
    afs_request_key() in RCU-mode pathwalk as request_key() might sleep, even if
    we don't ask it to construct anything as it might find a key that is currently
    undergoing construction.

    Signed-off-by: David Howells

    David Howells
     
  • Use afs_extract_discard() rather than iov_iter_discard() as the former is a
    wrapper for the latter, providing a place to put tracepoints.

    Signed-off-by: David Howells

    David Howells
     
  • fs/afs/fsclient.c:18:29: warning:
    afs_zero_fid defined but not used [-Wunused-const-variable=]

    It is never used since commit 025db80c9e42 ("afs: Trace
    the initiation and completion of client calls")

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Signed-off-by: David Howells

    YueHaibing
     
  • fs/afs/volume.c:15:26: warning:
    afs_voltypes defined but not used [-Wunused-const-variable=]

    It is not used since commit d2ddc776a458 ("afs: Overhaul
    volume and server record caching and fileserver rotation")

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Signed-off-by: David Howells

    YueHaibing
     

22 Aug, 2019

3 commits

  • It seems that 'yfs_RXYFSStoreOpaqueACL2' should be use in
    yfs_fs_store_opaque_acl2().

    Fixes: f5e4546347bc ("afs: Implement YFS ACL setting")
    Signed-off-by: YueHaibing
    Signed-off-by: David Howells

    YueHaibing
     
  • The afs_lookup trace event can cause the following:

    [ 216.576777] BUG: kernel NULL pointer dereference, address: 000000000000023b
    [ 216.576803] #PF: supervisor read access in kernel mode
    [ 216.576813] #PF: error_code(0x0000) - not-present page
    ...
    [ 216.576913] RIP: 0010:trace_event_raw_event_afs_lookup+0x9e/0x1c0 [kafs]

    If the inode from afs_do_lookup() is an error other than ENOENT, or if it
    is ENOENT and afs_try_auto_mntpt() returns an error, the trace event will
    try to dereference the error pointer as a valid pointer.

    Use IS_ERR_OR_NULL to only pass a valid pointer for the trace, or NULL.

    Ideally the trace would include the error value, but for now just avoid
    the oops.

    Fixes: 80548b03991f ("afs: Add more tracepoints")
    Signed-off-by: Marc Dionne
    Signed-off-by: David Howells

    Marc Dionne
     
  • Fix a leak on the cell refcount in afs_lookup_cell_rcu() due to
    non-clearance of the default error in the case a NULL cell name is passed
    and the workstation default cell is used.

    Also put a bit at the end to make sure we don't leak a cell ref if we're
    going to be returning an error.

    This leak results in an assertion like the following when the kafs module is
    unloaded:

    AFS: Assertion failed
    2 == 1 is false
    0x2 == 0x1 is false
    ------------[ cut here ]------------
    kernel BUG at fs/afs/cell.c:770!
    ...
    RIP: 0010:afs_manage_cells+0x220/0x42f [kafs]
    ...
    process_one_work+0x4c2/0x82c
    ? pool_mayday_timeout+0x1e1/0x1e1
    ? do_raw_spin_lock+0x134/0x175
    worker_thread+0x336/0x4a6
    ? rescuer_thread+0x4af/0x4af
    kthread+0x1de/0x1ee
    ? kthread_park+0xd4/0xd4
    ret_from_fork+0x24/0x30

    Fixes: 989782dcdc91 ("afs: Overhaul cell database management")
    Signed-off-by: David Howells

    David Howells
     

30 Jul, 2019

6 commits

  • In the in-kernel afs filesystem, the d_fsdata dentry field is used to hold
    the data version of the parent directory when it was created or when
    d_revalidate() last caused it to be updated. This is compared to the
    ->invalid_before field in the directory inode, rather than the actual data
    version number, thereby allowing changes due to local edits to be ignored.
    Only if the server data version gets bumped unexpectedly (eg. by a
    competing client), do we need to revalidate stuff.

    However, the d_fsdata field should also be updated if an rpc op is
    performed that modifies that particular dentry. Such ops return the
    revised data version of the directory(ies) involved, so we should use that.

    This is particularly problematic for rename, since a dentry from one
    directory may be moved directly into another directory (ie. mv a/x b/x).
    It would then be sporting the wrong data version - and if this is in the
    future, for the destination directory, revalidations would be missed,
    leading to foreign renames and hard-link deletion being missed.

    Fix this by the following means:

    (1) Return the data version number from operations that read the directory
    contents - if they issue the read. This starts in afs_dir_iterate()
    and is used, ignored or passed back by its callers.

    (2) In afs_lookup*(), set the dentry version to the version returned by
    (1) before d_splice_alias() is called and the dentry published.

    (3) In afs_d_revalidate(), set the dentry version to that returned from
    (1) if an rpc call was issued. This means that if a parallel
    procedure, such as mkdir(), modifies the directory, we won't
    accidentally use the data version from that.

    (4) In afs_{mkdir,create,link,symlink}(), set the new dentry's version to
    the directory data version before d_instantiate() is called.

    (5) In afs_{rmdir,unlink}, update the target dentry's version to the
    directory data version as soon as we've updated the directory inode.

    (6) In afs_rename(), we need to unhash the old dentry before we start so
    that we don't get afs_d_revalidate() reverting the version change in
    cross-directory renames.

    We then need to set both the old and the new dentry versions the data
    version of the new directory before we call d_move() as d_move() will
    rehash them.

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: David Howells

    David Howells
     
  • In the in-kernel afs filesystem, d_fsdata is set with the data version of
    the parent directory. afs_d_revalidate() will update this to the current
    directory version, but it shouldn't do this if it the value it read from
    d_fsdata is the same as no lock is held and cmpxchg() is not used.

    Fix the code to only change the value if it is different from the current
    directory version.

    Fixes: 260a980317da ("[AFS]: Add "directory write" support.")
    Signed-off-by: David Howells

    David Howells
     
  • When afs_rename() calculates the expected data version of the target
    directory in a cross-directory rename, it doesn't increment it as it
    should, so it always thinks that the target inode is unexpectedly modified
    on the server.

    Fixes: a58823ac4589 ("afs: Fix application of status and callback to be under same lock")
    Signed-off-by: David Howells

    David Howells
     
  • In afs_read_dir(), there is an if statement on line 255 to check whether
    req->pages is NULL:
    if (!req->pages)
    goto error;

    If req->pages is NULL, afs_put_read() on line 337 is executed.
    In afs_put_read(), req->pages[i] is used on line 195.
    Thus, a possible null-pointer dereference may occur in this case.

    To fix this possible bug, an if statement is added in afs_put_read() to
    check req->pages.

    This bug is found by a static analysis tool STCheck written by us.

    Fixes: f3ddee8dc4e2 ("afs: Fix directory handling")
    Signed-off-by: Jia-Ju Bai
    Signed-off-by: David Howells

    Jia-Ju Bai
     
  • afs_deliver_vl_get_entry_by_name_u() scans through the vl entry
    received from the volume location server and builds a return list
    containing the sites that are currently valid. When assigning
    values for the return list, the index into the vl entry (i) is used
    rather than the one for the new list (entry->nr_server). If all
    sites are usable, this works out fine as the indices will match.
    If some sites are not valid, for example if AFS_VLSF_DONTUSE is
    set, fs_mask and the uuid will be set for the wrong return site.

    Fix this by using entry->nr_server as the index into the arrays
    being filled in rather than i.

    This can lead to EDESTADDRREQ errors if none of the returned sites
    have a valid fs_mask.

    Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
    Signed-off-by: Marc Dionne
    Signed-off-by: David Howells
    Reviewed-by: Jeffrey Altman

    Marc Dionne
     
  • Fix the service handler function for the CB.ProbeUuid RPC call so that it
    replies in the correct manner - that is an empty reply for success and an
    abort of 1 for failure.

    Putting 0 or 1 in an integer in the body of the reply should result in the
    fileserver throwing an RX_PROTOCOL_ERROR abort and discarding its record of
    the client; older servers, however, don't necessarily check that all the
    data got consumed, and so might incorrectly think that they got a positive
    response and associate the client with the wrong host record.

    If the client is incorrectly associated, this will result in callbacks
    intended for a different client being delivered to this one and then, when
    the other client connects and responds positively, all of the callback
    promises meant for the client that issued the improper response will be
    lost and it won't receive any further change notifications.

    Fixes: 9396d496d745 ("afs: support the CB.ProbeUuid RPC op")
    Signed-off-by: David Howells
    Reviewed-by: Jeffrey Altman

    David Howells
     

26 Jul, 2019

2 commits

  • In preparation to enabling -Wimplicit-fallthrough, mark switch
    cases where we are expecting to fall through.

    This patch fixes the following warnings:

    Warning level 3 was used: -Wimplicit-fallthrough=3

    fs/afs/fsclient.c: In function ‘afs_deliver_fs_fetch_acl’:
    fs/afs/fsclient.c:2199:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/fsclient.c:2202:2: note: here
    case 1:
    ^~~~
    fs/afs/fsclient.c:2216:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/fsclient.c:2219:2: note: here
    case 2:
    ^~~~
    fs/afs/fsclient.c:2225:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/fsclient.c:2228:2: note: here
    case 3:
    ^~~~

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • In preparation to enabling -Wimplicit-fallthrough, mark switch
    cases where we are expecting to fall through.

    This patch fixes the following warnings:

    fs/afs/yfsclient.c: In function ‘yfs_deliver_fs_fetch_opaque_acl’:
    fs/afs/yfsclient.c:1984:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/yfsclient.c:1987:2: note: here
    case 1:
    ^~~~
    fs/afs/yfsclient.c:2005:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/yfsclient.c:2008:2: note: here
    case 2:
    ^~~~
    fs/afs/yfsclient.c:2014:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/yfsclient.c:2017:2: note: here
    case 3:
    ^~~~
    fs/afs/yfsclient.c:2035:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/yfsclient.c:2038:2: note: here
    case 4:
    ^~~~
    fs/afs/yfsclient.c:2047:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
    call->unmarshall++;
    ~~~~~~~~~~~~~~~~^~
    fs/afs/yfsclient.c:2050:2: note: here
    case 5:
    ^~~~

    Warning level 3 was used: -Wimplicit-fallthrough=3

    Also, fix some commenting style issues.

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

12 Jul, 2019

1 commit

  • Pull networking updates from David Miller:
    "Some highlights from this development cycle:

    1) Big refactoring of ipv6 route and neigh handling to support
    nexthop objects configurable as units from userspace. From David
    Ahern.

    2) Convert explored_states in BPF verifier into a hash table,
    significantly decreased state held for programs with bpf2bpf
    calls, from Alexei Starovoitov.

    3) Implement bpf_send_signal() helper, from Yonghong Song.

    4) Various classifier enhancements to mvpp2 driver, from Maxime
    Chevallier.

    5) Add aRFS support to hns3 driver, from Jian Shen.

    6) Fix use after free in inet frags by allocating fqdirs dynamically
    and reworking how rhashtable dismantle occurs, from Eric Dumazet.

    7) Add act_ctinfo packet classifier action, from Kevin
    Darbyshire-Bryant.

    8) Add TFO key backup infrastructure, from Jason Baron.

    9) Remove several old and unused ISDN drivers, from Arnd Bergmann.

    10) Add devlink notifications for flash update status to mlxsw driver,
    from Jiri Pirko.

    11) Lots of kTLS offload infrastructure fixes, from Jakub Kicinski.

    12) Add support for mv88e6250 DSA chips, from Rasmus Villemoes.

    13) Various enhancements to ipv6 flow label handling, from Eric
    Dumazet and Willem de Bruijn.

    14) Support TLS offload in nfp driver, from Jakub Kicinski, Dirk van
    der Merwe, and others.

    15) Various improvements to axienet driver including converting it to
    phylink, from Robert Hancock.

    16) Add PTP support to sja1105 DSA driver, from Vladimir Oltean.

    17) Add mqprio qdisc offload support to dpaa2-eth, from Ioana
    Radulescu.

    18) Add devlink health reporting to mlx5, from Moshe Shemesh.

    19) Convert stmmac over to phylink, from Jose Abreu.

    20) Add PTP PHC (Physical Hardware Clock) support to mlxsw, from
    Shalom Toledo.

    21) Add nftables SYNPROXY support, from Fernando Fernandez Mancera.

    22) Convert tcp_fastopen over to use SipHash, from Ard Biesheuvel.

    23) Track spill/fill of constants in BPF verifier, from Alexei
    Starovoitov.

    24) Support bounded loops in BPF, from Alexei Starovoitov.

    25) Various page_pool API fixes and improvements, from Jesper Dangaard
    Brouer.

    26) Just like ipv4, support ref-countless ipv6 route handling. From
    Wei Wang.

    27) Support VLAN offloading in aquantia driver, from Igor Russkikh.

    28) Add AF_XDP zero-copy support to mlx5, from Maxim Mikityanskiy.

    29) Add flower GRE encap/decap support to nfp driver, from Pieter
    Jansen van Vuuren.

    30) Protect against stack overflow when using act_mirred, from John
    Hurley.

    31) Allow devmap map lookups from eBPF, from Toke Høiland-Jørgensen.

    32) Use page_pool API in netsec driver, Ilias Apalodimas.

    33) Add Google gve network driver, from Catherine Sullivan.

    34) More indirect call avoidance, from Paolo Abeni.

    35) Add kTLS TX HW offload support to mlx5, from Tariq Toukan.

    36) Add XDP_REDIRECT support to bnxt_en, from Andy Gospodarek.

    37) Add MPLS manipulation actions to TC, from John Hurley.

    38) Add sending a packet to connection tracking from TC actions, and
    then allow flower classifier matching on conntrack state. From
    Paul Blakey.

    39) Netfilter hw offload support, from Pablo Neira Ayuso"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2080 commits)
    net/mlx5e: Return in default case statement in tx_post_resync_params
    mlx5: Return -EINVAL when WARN_ON_ONCE triggers in mlx5e_tls_resync().
    net: dsa: add support for BRIDGE_MROUTER attribute
    pkt_sched: Include const.h
    net: netsec: remove static declaration for netsec_set_tx_de()
    net: netsec: remove superfluous if statement
    netfilter: nf_tables: add hardware offload support
    net: flow_offload: rename tc_cls_flower_offload to flow_cls_offload
    net: flow_offload: add flow_block_cb_is_busy() and use it
    net: sched: remove tcf block API
    drivers: net: use flow block API
    net: sched: use flow block API
    net: flow_offload: add flow_block_cb_{priv, incref, decref}()
    net: flow_offload: add list handling functions
    net: flow_offload: add flow_block_cb_alloc() and flow_block_cb_free()
    net: flow_offload: rename TCF_BLOCK_BINDER_TYPE_* to FLOW_BLOCK_BINDER_TYPE_*
    net: flow_offload: rename TC_BLOCK_{UN}BIND to FLOW_BLOCK_{UN}BIND
    net: flow_offload: add flow_block_cb_setup_simple()
    net: hisilicon: Add an tx_desc to adapt HI13X1_GMAC
    net: hisilicon: Add an rx_desc to adapt HI13X1_GMAC
    ...

    Linus Torvalds
     

11 Jul, 2019

3 commits

  • Pull afs updates from David Howells:
    "A set of minor changes for AFS:

    - Remove an unnecessary check in afs_unlink()

    - Add a tracepoint for tracking callback management

    - Add a tracepoint for afs_server object usage

    - Use struct_size()

    - Add mappings for AFS UAE abort codes to Linux error codes, using
    symbolic names rather than hex numbers in the .c file"

    * tag 'afs-next-20190628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    afs: Add support for the UAE error table
    fs/afs: use struct_size() in kzalloc()
    afs: Trace afs_server usage
    afs: Add some callback management tracepoints
    afs: afs_unlink() doesn't need to check dentry->d_inode

    Linus Torvalds
     
  • Pull fsnotify updates from Jan Kara:
    "This contains cleanups of the fsnotify name removal hook and also a
    patch to disable fanotify permission events for 'proc' filesystem"

    * tag 'fsnotify_for_v5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    fsnotify: get rid of fsnotify_nameremove()
    fsnotify: move fsnotify_nameremove() hook out of d_delete()
    configfs: call fsnotify_rmdir() hook
    debugfs: call fsnotify_{unlink,rmdir}() hooks
    debugfs: simplify __debugfs_remove_file()
    devpts: call fsnotify_unlink() hook
    tracefs: call fsnotify_{unlink,rmdir}() hooks
    rpc_pipefs: call fsnotify_{unlink,rmdir}() hooks
    btrfs: call fsnotify_rmdir() hook
    fsnotify: add empty fsnotify_{unlink,rmdir}() hooks
    fanotify: Disallow permission events for proc filesystem

    Linus Torvalds
     
  • …el/git/dhowells/linux-fs"

    This reverts merge 0f75ef6a9cff49ff612f7ce0578bced9d0b38325 (and thus
    effectively commits

    7a1ade847596 ("keys: Provide KEYCTL_GRANT_PERMISSION")
    2e12256b9a76 ("keys: Replace uid/gid/perm permissions checking with an ACL")

    that the merge brought in).

    It turns out that it breaks booting with an encrypted volume, and Eric
    biggers reports that it also breaks the fscrypt tests [1] and loading of
    in-kernel X.509 certificates [2].

    The root cause of all the breakage is likely the same, but David Howells
    is off email so rather than try to work it out it's getting reverted in
    order to not impact the rest of the merge window.

    [1] https://lore.kernel.org/lkml/20190710011559.GA7973@sol.localdomain/
    [2] https://lore.kernel.org/lkml/20190710013225.GB7973@sol.localdomain/

    Link: https://lore.kernel.org/lkml/CAHk-=wjxoeMJfeBahnWH=9zShKp2bsVy527vo3_y8HfOdhwAAw@mail.gmail.com/
    Reported-by: Eric Biggers <ebiggers@kernel.org>
    Cc: David Howells <dhowells@redhat.com>
    Cc: James Morris <jmorris@namei.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Linus Torvalds
     

09 Jul, 2019

2 commits

  • Pull keyring ACL support from David Howells:
    "This changes the permissions model used by keys and keyrings to be
    based on an internal ACL by the following means:

    - Replace the permissions mask internally with an ACL that contains a
    list of ACEs, each with a specific subject with a permissions mask.
    Potted default ACLs are available for new keys and keyrings.

    ACE subjects can be macroised to indicate the UID and GID specified
    on the key (which remain). Future commits will be able to add
    additional subject types, such as specific UIDs or domain
    tags/namespaces.

    Also split a number of permissions to give finer control. Examples
    include splitting the revocation permit from the change-attributes
    permit, thereby allowing someone to be granted permission to revoke
    a key without allowing them to change the owner; also the ability
    to join a keyring is split from the ability to link to it, thereby
    stopping a process accessing a keyring by joining it and thus
    acquiring use of possessor permits.

    - Provide a keyctl to allow the granting or denial of one or more
    permits to a specific subject. Direct access to the ACL is not
    granted, and the ACL cannot be viewed"

    * tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    keys: Provide KEYCTL_GRANT_PERMISSION
    keys: Replace uid/gid/perm permissions checking with an ACL

    Linus Torvalds
     
  • …/git/dhowells/linux-fs

    Pull keyring namespacing from David Howells:
    "These patches help make keys and keyrings more namespace aware.

    Firstly some miscellaneous patches to make the process easier:

    - Simplify key index_key handling so that the word-sized chunks
    assoc_array requires don't have to be shifted about, making it
    easier to add more bits into the key.

    - Cache the hash value in the key so that we don't have to calculate
    on every key we examine during a search (it involves a bunch of
    multiplications).

    - Allow keying_search() to search non-recursively.

    Then the main patches:

    - Make it so that keyring names are per-user_namespace from the point
    of view of KEYCTL_JOIN_SESSION_KEYRING so that they're not
    accessible cross-user_namespace.

    keyctl_capabilities() shows KEYCTL_CAPS1_NS_KEYRING_NAME for this.

    - Move the user and user-session keyrings to the user_namespace
    rather than the user_struct. This prevents them propagating
    directly across user_namespaces boundaries (ie. the KEY_SPEC_*
    flags will only pick from the current user_namespace).

    - Make it possible to include the target namespace in which the key
    shall operate in the index_key. This will allow the possibility of
    multiple keys with the same description, but different target
    domains to be held in the same keyring.

    keyctl_capabilities() shows KEYCTL_CAPS1_NS_KEY_TAG for this.

    - Make it so that keys are implicitly invalidated by removal of a
    domain tag, causing them to be garbage collected.

    - Institute a network namespace domain tag that allows keys to be
    differentiated by the network namespace in which they operate. New
    keys that are of a type marked 'KEY_TYPE_NET_DOMAIN' are assigned
    the network domain in force when they are created.

    - Make it so that the desired network namespace can be handed down
    into the request_key() mechanism. This allows AFS, NFS, etc. to
    request keys specific to the network namespace of the superblock.

    This also means that the keys in the DNS record cache are
    thenceforth namespaced, provided network filesystems pass the
    appropriate network namespace down into dns_query().

    For DNS, AFS and NFS are good, whilst CIFS and Ceph are not. Other
    cache keyrings, such as idmapper keyrings, also need to set the
    domain tag - for which they need access to the network namespace of
    the superblock"

    * tag 'keys-namespace-20190627' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    keys: Pass the network namespace into request_key mechanism
    keys: Network namespace domain tag
    keys: Garbage collect keys for which the domain has been removed
    keys: Include target namespace in match criteria
    keys: Move the user and user-session keyrings to the user_namespace
    keys: Namespace keyring names
    keys: Add a 'recurse' flag for keyring searches
    keys: Cache the hash value to avoid lots of recalculation
    keys: Simplify key description management

    Linus Torvalds
     

29 Jun, 2019

1 commit


28 Jun, 2019

2 commits

  • The new route handling in ip_mc_finish_output() from 'net' overlapped
    with the new support for returning congestion notifications from BPF
    programs.

    In order to handle this I had to take the dev_loopback_xmit() calls
    out of the switch statement.

    The aquantia driver conflicts were simple overlapping changes.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull AFS fixes from David Howells:
    "The in-kernel AFS client has been undergoing testing on opendev.org on
    one of their mirror machines. They are using AFS to hold data that is
    then served via apache, and Ian Wienand had reported seeing oopses,
    spontaneous machine reboots and updates to volumes going missing. This
    patch series appears to have fixed the problem, very probably due to
    patch (2), but it's not 100% certain.

    (1) Fix the printing of the "vnode modified" warning to exclude checks
    on files for which we don't have a callback promise from the
    server (and so don't expect the server to tell us when it
    changes).

    Without this, for every file or directory for which we still have
    an in-core inode that gets changed on the server, we may get a
    message logged when we next look at it. This can happen in bulk
    if, for instance, someone does "vos release" to update a R/O
    volume from a R/W volume and a whole set of files are all changed
    together.

    We only really want to log a message if the file changed and the
    server didn't tell us about it or we failed to track the state
    internally.

    (2) Fix accidental corruption of either afs_vlserver struct objects or
    the the following memory locations (which could hold anything).
    The issue is caused by a union that points to two different
    structs in struct afs_call (to save space in the struct). The call
    cleanup code assumes that it can simply call the cleanup for one
    of those structs if not NULL - when it might be actually pointing
    to the other struct.

    This means that every Volume Location RPC op is going to corrupt
    something.

    (3) Fix an uninitialised spinlock. This isn't too bad, it just causes
    a one-off warning if lockdep is enabled when "vos release" is
    called, but the spinlock still behaves correctly.

    (4) Fix the setting of i_block in the inode. This causes du, for
    example, to produce incorrect results, but otherwise should not be
    dangerous to the kernel"

    * tag 'afs-fixes-20190620' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    afs: Fix setting of i_blocks
    afs: Fix uninitialised spinlock afs_volume::cb_break_lock
    afs: Fix vlserver record corruption
    afs: Fix over zealous "vnode modified" warnings

    Linus Torvalds