22 Jun, 2018

2 commits

  • Pull udf, quota, ext2 fixes from Jan Kara:
    "UDF:
    - fix an oops due to corrupted disk image
    - two small cleanups

    quota:
    - a fixfor lru handling
    - cleanup

    ext2:
    - a warning about a deprecated mount option"

    * tag 'for_v4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: Drop unused arguments of udf_delete_aext()
    udf: Provide function for calculating dir entry length
    udf: Detect incorrect directory size
    ext2: add warning when specifying nocheck option
    quota: Cleanup list iteration in dqcache_shrink_scan()
    quota: reclaim least recently used dquots

    Linus Torvalds
     
  • Pull NFS client bugfixes from Trond Myklebust:
    "Hightlights include:

    - fix an rcu deadlock in nfs_delegation_find_inode()

    - fix NFSv4 deadlocks due to not freeing the session slot in
    layoutget

    - don't send layoutreturn if the layout is already invalid

    - prevent duplicate XID allocation

    - flexfiles: Don't tie up all the rpciod threads in resends"

    * tag 'nfs-for-4.18-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    pNFS/flexfiles: Process writeback resends from nfsiod context as well
    pNFS/flexfiles: Don't tie up all the rpciod threads in resends
    sunrpc: Prevent duplicate XID allocation
    pNFS: Don't send layoutreturn if the layout is already invalid
    pNFS: Always free the session slot on error in nfs4_layoutget_handle_exception
    NFS: Fix an rcu deadlock in nfs_delegation_find_inode()

    Linus Torvalds
     

20 Jun, 2018

7 commits

  • udf_delete_aext() uses its last two arguments only as local variables.
    Drop them.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Provide function for calculating directory entry length and use to
    reduce code duplication.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Detect when a directory entry is (possibly partially) beyond directory
    size and return EIO in that case since it means the filesystem is
    corrupted. Otherwise directory operations can further corrupt the
    directory and possibly also oops the kernel.

    CC: Anatoly Trosinenko
    CC: stable@vger.kernel.org
    Reported-and-tested-by: Anatoly Trosinenko
    Signed-off-by: Jan Kara

    Jan Kara
     
  • The option nocheck(nocheck/check=none) is useless but considering
    backwards compatibility it's better to print warning for a while
    before completely remove from the code.

    This patch add proper warning message for option 'nocheck' and
    remove unnecessary comment/function declaration which is used for
    removed option 'check'.

    Signed-off-by: Chengguang Xu
    Signed-off-by: Jan Kara

    Chengguang Xu
     
  • Use list_first_entry() and list_empty() instead of opencoded variants.

    Reviewed-by: Matthew Wilcox
    Signed-off-by: Jan Kara

    Jan Kara
     
  • The dquots in the free_dquots list are not reclaimed in LRU way.
    put_dquot_last() puts entries to the tail and dqcache_shrink_scan()
    frees from the tail. Free unreferenced dquots in LRU order because it
    seems more reasonable than freeing most recently used.

    Signed-off-by: Greg Thelen
    Signed-off-by: Shakeel Butt
    Signed-off-by: Jan Kara

    Greg Thelen
     
  • The rewrite of the cmdline fetching missed the fact that we used to also
    return the final terminating NUL character of the last argument. I
    hadn't noticed, and none of the tools I tested cared, but something
    obviously must care, because Michal Kubecek noticed the change in
    behavior.

    Tweak the "find the end" logic to actually include the NUL character,
    and once past the eend of argv, always start the strnlen() at the
    expected (original) argument end.

    This whole "allow people to rewrite their arguments in place" is a nasty
    hack and requires that odd slop handling at the end of the argv array,
    but it's our traditional model, so we continue to support it.

    Repored-and-bisected-by: Michal Kubecek
    Reviewed-and-tested-by: Michal Kubecek
    Cc: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

19 Jun, 2018

5 commits


18 Jun, 2018

1 commit

  • Pull cifs fixes from Steve French:
    "Misc SMB3 fixes, including particularly important ones for signing,
    some minor documentation and debug improvements and another posix
    smb3.11 fix"

    * tag '4.18-rc1-more-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
    cifs: Fix invalid check in __cifs_calc_signature()
    cifs: Use correct packet length in SMB2_TRANSFORM header
    smb3: fix corrupt path in subdirs on smb311 with posix
    smb3: do not display empty interface list
    smb3: Fix mode on mkdir on smb311 mounts
    cifs: Fix kernel oops when traceSMB is enabled
    CIFS: dump every session iface info
    CIFS: parse and store info on iface queries
    CIFS: add iface info to struct cifs_ses
    CIFS: complete PDU definitions for interface queries
    CIFS: move default port definitions to cifsglob.h
    cifs: Fix encryption/signing
    cifs: update __smb_send_rqst() to take an array of requests
    cifs: remove smb2_send_recv()
    cifs: push rfc1002 generation down the stack
    smb3: increase initial number of credits requested to allow write
    cifs: minor documentation updates
    cifs: add lease tracking to the cached root fid
    smb3: note that smb3.11 posix extensions mount option is experimental

    Linus Torvalds
     

17 Jun, 2018

2 commits

  • Pull documentation fixes from Mauro Carvalho Chehab:
    "This solves a series of broken links for files under Documentation,
    and improves a script meant to detect such broken links (see
    scripts/documentation-file-ref-check).

    The changes on this series are:

    - can.rst: fix a footnote reference;

    - crypto_engine.rst: Fix two parsing warnings;

    - Fix a lot of broken references to Documentation/*;

    - improve the scripts/documentation-file-ref-check script, in order
    to help detecting/fixing broken references, preventing
    false-positives.

    After this patch series, only 33 broken references to doc files are
    detected by scripts/documentation-file-ref-check"

    * tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimental: (26 commits)
    fix a series of Documentation/ broken file name references
    Documentation: rstFlatTable.py: fix a broken reference
    ABI: sysfs-devices-system-cpu: remove a broken reference
    devicetree: fix a series of wrong file references
    devicetree: fix name of pinctrl-bindings.txt
    devicetree: fix some bindings file names
    MAINTAINERS: fix location of DT npcm files
    MAINTAINERS: fix location of some display DT bindings
    kernel-parameters.txt: fix pointers to sound parameters
    bindings: nvmem/zii: Fix location of nvmem.txt
    docs: Fix more broken references
    scripts/documentation-file-ref-check: check tools/*/Documentation
    scripts/documentation-file-ref-check: get rid of false-positives
    scripts/documentation-file-ref-check: hint: dash or underline
    scripts/documentation-file-ref-check: add a fix logic for DT
    scripts/documentation-file-ref-check: accept more wildcards at filenames
    scripts/documentation-file-ref-check: fix help message
    media: max2175: fix location of driver's companion documentation
    media: v4l: fix broken video4linux docs locations
    media: dvb: point to the location of the old README.dvb-usb file
    ...

    Linus Torvalds
     
  • Pull fsnotify updates from Jan Kara:
    "fsnotify cleanups unifying handling of different watch types.

    This is the shortened fsnotify series from Amir with the last five
    patches pulled out. Amir has modified those patches to not change
    struct inode but obviously it's too late for those to go into this
    merge window"

    * tag 'fsnotify_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    fsnotify: add fsnotify_add_inode_mark() wrappers
    fanotify: generalize fanotify_should_send_event()
    fsnotify: generalize send_to_group()
    fsnotify: generalize iteration of marks by object type
    fsnotify: introduce marks iteration helpers
    fsnotify: remove redundant arguments to handle_event()
    fsnotify: use type id to identify connector object type

    Linus Torvalds
     

16 Jun, 2018

7 commits

  • Pull AFS updates from Al Viro:
    "Assorted AFS stuff - ended up in vfs.git since most of that consists
    of David's AFS-related followups to Christoph's procfs series"

    * 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    afs: Optimise callback breaking by not repeating volume lookup
    afs: Display manually added cells in dynamic root mount
    afs: Enable IPv6 DNS lookups
    afs: Show all of a server's addresses in /proc/fs/afs/servers
    afs: Handle CONFIG_PROC_FS=n
    proc: Make inline name size calculation automatic
    afs: Implement network namespacing
    afs: Mark afs_net::ws_cell as __rcu and set using rcu functions
    afs: Fix a Sparse warning in xdr_decode_AFSFetchStatus()
    proc: Add a way to make network proc files writable
    afs: Rearrange fs/afs/proc.c to remove remaining predeclarations.
    afs: Rearrange fs/afs/proc.c to move the show routines up
    afs: Rearrange fs/afs/proc.c by moving fops and open functions down
    afs: Move /proc management functions to the end of the file

    Linus Torvalds
     
  • Pull compat updates from Al Viro:
    "Some biarch patches - getting rid of assorted (mis)uses of
    compat_alloc_user_space().

    Not much in that area this cycle..."

    * 'work.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    orangefs: simplify compat ioctl handling
    signalfd: lift sigmask copyin and size checks to callers of do_signalfd4()
    vmsplice(): lift importing iovec into vmsplice(2) and compat counterpart

    Linus Torvalds
     
  • Pull aio fixes from Al Viro:
    "Assorted AIO followups and fixes"

    * 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    eventpoll: switch to ->poll_mask
    aio: only return events requested in poll_mask() for IOCB_CMD_POLL
    eventfd: only return events requested in poll_mask()
    aio: mark __aio_sigset::sigmask const

    Linus Torvalds
     
  • The following check would never evaluate to true:
    > if (i == 0 && iov[0].iov_len
    Signed-off-by: Steve French

    Paulo Alcantara
     
  • In smb3_init_transform_rq(), 'orig_len' was only counting the request
    length, but forgot to count any data pages in the request.

    Writing or creating files with the 'seal' mount option was broken.

    In addition, do some code refactoring by exporting smb2_rqst_len() to
    calculate the appropriate packet size and avoid duplicating the same
    calculation all over the code.

    The start of the io vector is either the rfc1002 length (4 bytes) or a
    SMB2 header which is always > 4. Use this fact to check and skip the
    rfc1002 length if requested.

    Signed-off-by: Paulo Alcantara
    Reviewed-by: Aurelien Aptel
    Signed-off-by: Steve French

    Paulo Alcantara
     
  • As files move around, their previous links break. Fix the
    references for them.

    Acked-by: Andy Shevchenko
    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Jonathan Corbet

    Mauro Carvalho Chehab
     
  • As we move stuff around, some doc references are broken. Fix some of
    them via this script:
    ./scripts/documentation-file-ref-check --fix

    Manually checked that produced results are valid.

    Acked-by: Matthias Brugger
    Acked-by: Takashi Iwai
    Acked-by: Jeff Kirsher
    Acked-by: Guenter Roeck
    Acked-by: Miguel Ojeda
    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

15 Jun, 2018

16 commits

  • At the moment, afs_break_callbacks calls afs_break_one_callback() for each
    separate FID it was given, and the latter looks up the volume individually
    for each one.

    However, this is inefficient if two or more FIDs have the same vid as we
    could reuse the volume. This is complicated by cell aliasing whereby we
    may have multiple cells sharing a volume and can therefore have multiple
    callback interests for any particular volume ID.

    At the moment afs_break_one_callback() scans the entire list of volumes
    we're getting from a server and breaks the appropriate callback in every
    matching volume, regardless of cell. This scan is done for every FID.

    Optimise callback breaking by the following means:

    (1) Sort the FID list by vid so that all FIDs belonging to the same volume
    are clumped together.

    This is done through the use of an indirection table as we cannot do
    an insertion sort on the afs_callback_break array as we decode FIDs
    into it as we subsequently also have to decode callback info into it
    that corresponds by array index only.

    We also don't really want to bubblesort afterwards if we can avoid it.

    (2) Sort the server->cb_interests array by vid so that all the matching
    volumes are grouped together. This permits the scan to stop after
    finding a record that has a higher vid.

    (3) When breaking FIDs, we try to keep server->cb_break_lock as long as
    possible, caching the start point in the array for that volume group
    as long as possible.

    It might make sense to add another layer in that list and have a
    refcounted volume ID anchor that has the matching interests attached
    to it rather than being in the list. This would allow the lock to be
    dropped without losing the cursor.

    Signed-off-by: David Howells

    David Howells
     
  • Alter the dynroot mount so that cells created by manipulation of
    /proc/fs/afs/cells and /proc/fs/afs/rootcell and by specification of a root
    cell as a module parameter will cause directories for those cells to be
    created in the dynamic root superblock for the network namespace[*].

    To this end:

    (1) Only one dynamic root superblock is now created per network namespace
    and this is shared between all attempts to mount it. This makes it
    easier to find the superblock to modify.

    (2) When a dynamic root superblock is created, the list of cells is walked
    and directories created for each cell already defined.

    (3) When a new cell is added, if a dynamic root superblock exists, a
    directory is created for it.

    (4) When a cell is destroyed, the directory is removed.

    (5) These directories are created by calling lookup_one_len() on the root
    dir which automatically creates them if they don't exist.

    [*] Inasmuch as network namespaces are currently supported here.

    Signed-off-by: David Howells

    David Howells
     
  • Remove the restriction on DNS lookup upcalls that prevents ipv6 addresses
    from being looked up.

    Signed-off-by: David Howells

    David Howells
     
  • Signed-off-by: Steve French

    Steve French
     
  • If server does not support listing interfaces then do not
    display empty "Server interfaces" line to avoid confusing users.

    Signed-off-by: Steve French
    CC: Aurelien Aptel

    Steve French
     
  • mkdir was not passing the mode on smb3.11 mounts with posix extensions

    Signed-off-by: Steve French

    Steve French
     
  • When traceSMB is enabled through 'echo 1 > /proc/fs/cifs/traceSMB', after a
    mount, the following oops is triggered:

    [ 27.137943] BUG: unable to handle kernel paging request at
    ffff8800f80c268b
    [ 27.143396] PGD 2c6b067 P4D 2c6b067 PUD 0
    [ 27.145386] Oops: 0000 [#1] SMP PTI
    [ 27.146186] CPU: 2 PID: 2655 Comm: mount.cifs Not tainted 4.17.0+ #39
    [ 27.147174] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
    1.0.0-prebuilt.qemu-project.org 04/01/2014
    [ 27.148969] RIP: 0010:hex_dump_to_buffer+0x413/0x4b0
    [ 27.149738] Code: 48 8b 44 24 08 31 db 45 31 d2 48 89 6c 24 18 44 89
    6c 24 24 48 c7 c1 78 b5 23 82 4c 89 64 24 10 44 89 d5 41 89 dc 4c 8d 58
    02 0f b7 00 4d 89 dd eb 1f 83 c5 01 41 01 c4 41 39 ef 0f 84 48 fe
    [ 27.152396] RSP: 0018:ffffc9000058f8c0 EFLAGS: 00010246
    [ 27.153129] RAX: ffff8800f80c268b RBX: 0000000000000000 RCX:
    ffffffff8223b578
    [ 27.153867] RDX: 0000000000000000 RSI: ffffffff81a55496 RDI:
    0000000000000008
    [ 27.154612] RBP: 0000000000000000 R08: 0000000000000020 R09:
    0000000000000083
    [ 27.155355] R10: 0000000000000000 R11: ffff8800f80c268d R12:
    0000000000000000
    [ 27.156101] R13: 0000000000000002 R14: ffffc9000058f94d R15:
    0000000000000008
    [ 27.156838] FS: 00007f1693a6b740(0000) GS:ffff88007fd00000(0000)
    knlGS:0000000000000000
    [ 27.158354] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 27.159093] CR2: ffff8800f80c268b CR3: 00000000798fa001 CR4:
    0000000000360ee0
    [ 27.159892] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
    0000000000000000
    [ 27.160661] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
    0000000000000400
    [ 27.161464] Call Trace:
    [ 27.162123] print_hex_dump+0xd3/0x160
    [ 27.162814] journal-offline (2658) used greatest stack depth: 13144
    bytes left
    [ 27.162824] ? __release_sock+0x60/0xd0
    [ 27.165344] ? tcp_sendmsg+0x31/0x40
    [ 27.166177] dump_smb+0x39/0x40
    [ 27.166972] ? vsnprintf+0x236/0x490
    [ 27.167807] __smb_send_rqst.constprop.12+0x103/0x430
    [ 27.168554] ? apic_timer_interrupt+0xa/0x20
    [ 27.169306] smb_send_rqst+0x48/0xc0
    [ 27.169984] cifs_send_recv+0xda/0x420
    [ 27.170639] SMB2_negotiate+0x23d/0xfa0
    [ 27.171301] ? vsnprintf+0x236/0x490
    [ 27.171961] ? smb2_negotiate+0x19/0x30
    [ 27.172586] smb2_negotiate+0x19/0x30
    [ 27.173257] cifs_negotiate_protocol+0x70/0xd0
    [ 27.173935] ? kstrdup+0x43/0x60
    [ 27.174551] cifs_get_smb_ses+0x295/0xbe0
    [ 27.175260] ? lock_timer_base+0x67/0x80
    [ 27.175936] ? __internal_add_timer+0x1a/0x50
    [ 27.176575] ? add_timer+0x10f/0x230
    [ 27.177267] cifs_mount+0x101/0x1190
    [ 27.177940] ? cifs_smb3_do_mount+0x144/0x5c0
    [ 27.178575] cifs_smb3_do_mount+0x144/0x5c0
    [ 27.179270] mount_fs+0x35/0x150
    [ 27.179930] vfs_kern_mount.part.28+0x54/0xf0
    [ 27.180567] do_mount+0x5ad/0xc40
    [ 27.181234] ? kmem_cache_alloc_trace+0xed/0x1a0
    [ 27.181916] ksys_mount+0x80/0xd0
    [ 27.182535] __x64_sys_mount+0x21/0x30
    [ 27.183220] do_syscall_64+0x4e/0x100
    [ 27.183882] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [ 27.184535] RIP: 0033:0x7f169339055a
    [ 27.185192] Code: 48 8b 0d 41 d9 2b 00 f7 d8 64 89 01 48 83 c8 ff c3
    66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f
    05 3d 01 f0 ff ff 73 01 c3 48 8b 0d 0e d9 2b 00 f7 d8 64 89 01 48
    [ 27.187268] RSP: 002b:00007fff7b44eb58 EFLAGS: 00000202 ORIG_RAX:
    00000000000000a5
    [ 27.188515] RAX: ffffffffffffffda RBX: 00007f1693a7e70e RCX:
    00007f169339055a
    [ 27.189244] RDX: 000055b9f97f64e5 RSI: 000055b9f97f652c RDI:
    00007fff7b45074f
    [ 27.189974] RBP: 000055b9fb8c9260 R08: 000055b9fb8ca8f0 R09:
    0000000000000000
    [ 27.190721] R10: 0000000000000000 R11: 0000000000000202 R12:
    000055b9fb8ca8f0
    [ 27.191429] R13: 0000000000000000 R14: 00007f1693a7c000 R15:
    00007f1693a7e91d
    [ 27.192167] Modules linked in:
    [ 27.192797] CR2: ffff8800f80c268b
    [ 27.193435] ---[ end trace 67404c618badf323 ]---

    The problem was that dump_smb() had been called with an invalid pointer,
    that is, in __smb_send_rqst(), iov[1] doesn't exist (n_vec == 1).

    This patch fixes it by relying on the n_vec value to dump out the smb
    packets.

    Signed-off-by: Paulo Alcantara
    Signed-off-by: Steve French
    Reviewed-by: Ronnie Sahlberg

    Paulo Alcantara
     
  • Signed-off-by: Aurelien Aptel
    Signed-off-by: Steve French

    Aurelien Aptel
     
  • Signed-off-by: Aurelien Aptel
    Signed-off-by: Steve French

    Aurelien Aptel
     
  • Signed-off-by: Aurelien Aptel
    Signed-off-by: Steve French

    Aurelien Aptel
     
  • Signed-off-by: Aurelien Aptel
    Signed-off-by: Steve French

    Aurelien Aptel
     
  • Signed-off-by: Aurelien Aptel
    Signed-off-by: Steve French

    Aurelien Aptel
     
  • Since the rfc1002 generation was moved down to __smb_send_rqst(),
    the transform header is now in rqst->rq_iov[0].

    Correctly assign the transform header pointer in crypt_message().

    Signed-off-by: Paulo Alcantara
    Reviewed-by: Ronnie Sahlberg
    Signed-off-by: Steve French

    Paulo Alcantara
     
  • Signed-off-by: Ronnie Sahlberg
    Signed-off-by: Steve French

    Ronnie Sahlberg
     
  • Now that we have the plumbing to pass request without an rfc1002
    header all the way down to the point we write to the socket we no
    longer need the smb2_send_recv() function.

    Signed-off-by: Ronnie Sahlberg
    Signed-off-by: Steve French

    Ronnie Sahlberg
     
  • Move the generation of the 4 byte length field down the stack and
    generate it immediately before we start writing the data to the socket.

    Signed-off-by: Ronnie Sahlberg
    Signed-off-by: Aurelien Aptel
    Signed-off-by: Steve French

    Ronnie Sahlberg