05 Aug, 2020

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "It's been a busy cycle for documentation - hopefully the busiest for a
    while to come. Changes include:

    - Some new Chinese translations

    - Progress on the battle against double words words and non-HTTPS
    URLs

    - Some block-mq documentation

    - More RST conversions from Mauro. At this point, that task is
    essentially complete, so we shouldn't see this kind of churn again
    for a while. Unless we decide to switch to asciidoc or
    something...:)

    - Lots of typo fixes, warning fixes, and more"

    * tag 'docs-5.9' of git://git.lwn.net/linux: (195 commits)
    scripts/kernel-doc: optionally treat warnings as errors
    docs: ia64: correct typo
    mailmap: add entry for
    doc/zh_CN: add cpu-load Chinese version
    Documentation/admin-guide: tainted-kernels: fix spelling mistake
    MAINTAINERS: adjust kprobes.rst entry to new location
    devices.txt: document rfkill allocation
    PCI: correct flag name
    docs: filesystems: vfs: correct flag name
    docs: filesystems: vfs: correct sync_mode flag names
    docs: path-lookup: markup fixes for emphasis
    docs: path-lookup: more markup fixes
    docs: path-lookup: fix HTML entity mojibake
    CREDITS: Replace HTTP links with HTTPS ones
    docs: process: Add an example for creating a fixes tag
    doc/zh_CN: add Chinese translation prefer section
    doc/zh_CN: add clearing-warn-once Chinese version
    doc/zh_CN: add admin-guide index
    doc:it_IT: process: coding-style.rst: Correct __maybe_unused compiler label
    futex: MAINTAINERS: Re-add selftests directory
    ...

    Linus Torvalds
     

24 Jul, 2020

1 commit

  • This reverts commit 9ffad9263b467efd8f8dc7ae1941a0a655a2bab2.

    Upon additional testing with older servers, it was found that
    the original commit introduced a regression when using the old SMB1
    dialect and rsyncing over an existing file.

    The patch will need to be respun to address this, likely including
    a larger refactoring of the SMB1 and SMB3 rename code paths to make
    it less confusing and also to address some additional rename error
    cases that SMB3 may be able to workaround.

    Signed-off-by: Steve French
    Reported-by: Patrick Fernie
    CC: Stable
    Acked-by: Ronnie Sahlberg
    Acked-by: Pavel Shilovsky
    Acked-by: Zhang Xiaoxu

    Steve French
     

09 Jul, 2020

2 commits


08 Jul, 2020

3 commits


06 Jul, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Reviewed-by: Aurelien Aptel
    Link: https://lore.kernel.org/r/20200627103125.71828-1-grandmaster@al2klimov.de
    Signed-off-by: Jonathan Corbet

    Alexander A. Klimov
     

02 Jul, 2020

8 commits


24 Jun, 2020

5 commits

  • Use array_size() instead of the open-coded version in the controlling
    expression of the if statement.

    Also, while there, use the preferred form for passing a size of a struct.
    The alternative form where struct name is spelled out hurts readability
    and introduces an opportunity for a bug when the pointer variable type is
    changed but the corresponding sizeof that is passed as argument is not.

    This issue was found with the help of Coccinelle and, audited and fixed
    manually.

    Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Steve French
    Reviewed-by: Aurelien Aptel
    Reviewed-by: Kees Cook
    Signed-off-by: Steve French

    Gustavo A. R. Silva
     
  • As the man description of the truncate, if the size changed,
    then the st_ctime and st_mtime fields should be updated. But
    in cifs, we doesn't do it.

    It lead the xfstests generic/313 failed.

    So, add the ATTR_MTIME|ATTR_CTIME flags on attrs when change
    the file size

    Reported-by: Hulk Robot
    Signed-off-by: Zhang Xiaoxu
    Signed-off-by: Steve French

    Zhang Xiaoxu
     
  • When punch hole success, we also can read old data from file:
    # strace -e trace=pread64,fallocate xfs_io -f -c "pread 20 40" \
    -c "fpunch 20 40" -c"pread 20 40" file
    pread64(3, " version 5.8.0-rc1+"..., 40, 20) = 40
    fallocate(3, FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE, 20, 40) = 0
    pread64(3, " version 5.8.0-rc1+"..., 40, 20) = 40

    CIFS implements the fallocate(FALLOCATE_FL_PUNCH_HOLE) with send SMB
    ioctl(FSCTL_SET_ZERO_DATA) to server. It just set the range of the
    remote file to zero, but local page caches not updated, then the
    local page caches inconsistent with server.

    Also can be found by xfstests generic/316.

    So, we need to remove the page caches before send the SMB
    ioctl(FSCTL_SET_ZERO_DATA) to server.

    Fixes: 31742c5a33176 ("enable fallocate punch hole ("fallocate -p") for SMB3")
    Suggested-by: Pavel Shilovsky
    Reviewed-by: Pavel Shilovsky
    Signed-off-by: Zhang Xiaoxu
    Cc: stable@vger.kernel.org # v3.17
    Signed-off-by: Steve French

    Zhang Xiaoxu
     
  • CIFS implements the fallocate(FALLOC_FL_ZERO_RANGE) with send SMB
    ioctl(FSCTL_SET_ZERO_DATA) to server. It just set the range of the
    remote file to zero, but local page cache not update, then the data
    inconsistent with server, which leads the xfstest generic/008 failed.

    So we need to remove the local page caches before send SMB
    ioctl(FSCTL_SET_ZERO_DATA) to server. After next read, it will
    re-cache it.

    Fixes: 30175628bf7f5 ("[SMB3] Enable fallocate -z support for SMB3 mounts")
    Reported-by: Hulk Robot
    Signed-off-by: Zhang Xiaoxu
    Reviewed-by: Pavel Shilovsky
    Cc: stable@vger.kernel.org # v3.17
    Signed-off-by: Steve French

    Zhang Xiaoxu
     
  • When xfstests generic/451, there is an BUG at mm/memcontrol.c:
    page:ffffea000560f2c0 refcount:2 mapcount:0 mapping:000000008544e0ea
    index:0xf
    mapping->aops:cifs_addr_ops dentry name:"tst-aio-dio-cycle-write.451"
    flags: 0x2fffff80000001(locked)
    raw: 002fffff80000001 ffffc90002023c50 ffffea0005280088 ffff88815cda0210
    raw: 000000000000000f 0000000000000000 00000002ffffffff ffff88817287d000
    page dumped because: VM_BUG_ON_PAGE(page->mem_cgroup)
    page->mem_cgroup:ffff88817287d000
    ------------[ cut here ]------------
    kernel BUG at mm/memcontrol.c:2659!
    invalid opcode: 0000 [#1] SMP
    CPU: 2 PID: 2038 Comm: xfs_io Not tainted 5.8.0-rc1 #44
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_
    073836-buildvm-ppc64le-16.ppc.4
    RIP: 0010:commit_charge+0x35/0x50
    Code: 0d 48 83 05 54 b2 02 05 01 48 89 77 38 c3 48 c7
    c6 78 4a ea ba 48 83 05 38 b2 02 05 01 e8 63 0d9
    RSP: 0018:ffffc90002023a50 EFLAGS: 00010202
    RAX: 0000000000000000 RBX: ffff88817287d000 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: ffff88817ac97ea0 RDI: ffff88817ac97ea0
    RBP: ffffea000560f2c0 R08: 0000000000000203 R09: 0000000000000005
    R10: 0000000000000030 R11: ffffc900020237a8 R12: 0000000000000000
    R13: 0000000000000001 R14: 0000000000000001 R15: ffff88815a1272c0
    FS: 00007f5071ab0800(0000) GS:ffff88817ac80000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000055efcd5ca000 CR3: 000000015d312000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    mem_cgroup_charge+0x166/0x4f0
    __add_to_page_cache_locked+0x4a9/0x710
    add_to_page_cache_locked+0x15/0x20
    cifs_readpages+0x217/0x1270
    read_pages+0x29a/0x670
    page_cache_readahead_unbounded+0x24f/0x390
    __do_page_cache_readahead+0x3f/0x60
    ondemand_readahead+0x1f1/0x470
    page_cache_async_readahead+0x14c/0x170
    generic_file_buffered_read+0x5df/0x1100
    generic_file_read_iter+0x10c/0x1d0
    cifs_strict_readv+0x139/0x170
    new_sync_read+0x164/0x250
    __vfs_read+0x39/0x60
    vfs_read+0xb5/0x1e0
    ksys_pread64+0x85/0xf0
    __x64_sys_pread64+0x22/0x30
    do_syscall_64+0x69/0x150
    entry_SYSCALL_64_after_hwframe+0x44/0xa9
    RIP: 0033:0x7f5071fcb1af
    Code: Bad RIP value.
    RSP: 002b:00007ffde2cdb8e0 EFLAGS: 00000293 ORIG_RAX: 0000000000000011
    RAX: ffffffffffffffda RBX: 00007ffde2cdb990 RCX: 00007f5071fcb1af
    RDX: 0000000000001000 RSI: 000055efcd5ca000 RDI: 0000000000000003
    RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000001000 R11: 0000000000000293 R12: 0000000000000001
    R13: 000000000009f000 R14: 0000000000000000 R15: 0000000000001000
    Modules linked in:
    ---[ end trace 725fa14a3e1af65c ]---

    Since commit 3fea5a499d57 ("mm: memcontrol: convert page cache to a new
    mem_cgroup_charge() API") not cancel the page charge, the pages maybe
    double add to pagecache:
    thread1 | thread2
    cifs_readpages
    readpages_get_pages
    add_to_page_cache_locked(head,index=n)=0
    | readpages_get_pages
    | add_to_page_cache_locked(head,index=n+1)=0
    add_to_page_cache_locked(head, index=n+1)=-EEXIST
    then, will next loop with list head page's
    index=n+1 and the page->mapping not NULL
    readpages_get_pages
    add_to_page_cache_locked(head, index=n+1)
    commit_charge
    VM_BUG_ON_PAGE

    So, we should not do the next loop when any page add to page cache
    failed.

    Reported-by: Hulk Robot
    Signed-off-by: Zhang Xiaoxu
    Signed-off-by: Steve French
    Acked-by: Ronnie Sahlberg

    Zhang Xiaoxu
     

22 Jun, 2020

1 commit

  • open_shroot() invokes kref_get(), which increases the refcount of the
    "tcon->crfid" object. When open_shroot() returns not zero, it means the
    open operation failed and close_shroot() will not be called to decrement
    the refcount of the "tcon->crfid".

    The reference counting issue happens in one normal path of
    open_shroot(). When the cached root have been opened successfully in a
    concurrent process, the function increases the refcount and jump to
    "oshr_free" to return. However the current return value "rc" may not
    equal to 0, thus the increased refcount will not be balanced outside the
    function, causing a refcnt leak.

    Fix this issue by setting the value of "rc" to 0 before jumping to
    "oshr_free" label.

    Signed-off-by: Xiyu Yang
    Signed-off-by: Xin Tan
    Signed-off-by: Steve French
    CC: Stable

    Xiyu Yang
     

13 Jun, 2020

3 commits


12 Jun, 2020

6 commits


11 Jun, 2020

1 commit


09 Jun, 2020

1 commit


07 Jun, 2020

1 commit


06 Jun, 2020

2 commits

  • Pull cifs updates from Steve French:
    "22 changesets, 2 for stable.

    Includes big performance improvement for large i/o when using
    multichannel, also includes DFS fixes"

    * tag '5.8-rc-smb3-fixes-part-1' of git://git.samba.org/sfrench/cifs-2.6: (22 commits)
    cifs: update internal module version number
    cifs: multichannel: try to rebind when reconnecting a channel
    cifs: multichannel: use pointer for binding channel
    smb3: remove static checker warning
    cifs: multichannel: move channel selection above transport layer
    cifs: multichannel: always zero struct cifs_io_parms
    cifs: dump Security Type info in DebugData
    smb3: fix incorrect number of credits when ioctl MaxOutputResponse > 64K
    smb3: default to minimum of two channels when multichannel specified
    cifs: multichannel: move channel selection in function
    cifs: fix minor typos in comments and log messages
    smb3: minor update to compression header definitions
    cifs: minor fix to two debug messages
    cifs: Standardize logging output
    smb3: Add new parm "nodelete"
    cifs: move some variables off the stack in smb2_ioctl_query_info
    cifs: reduce stack use in smb2_compound_op
    cifs: get rid of unused parameter in reconn_setup_dfs_targets()
    cifs: handle hostnames that resolve to same ip in failover
    cifs: set up next DFS target before generic_ip_connect()
    ...

    Linus Torvalds
     
  • Pull ext4 updates from Ted Ts'o:
    "A lot of bug fixes and cleanups for ext4, including:

    - Fix performance problems found in dioread_nolock now that it is the
    default, caused by transaction leaks.

    - Clean up fiemap handling in ext4

    - Clean up and refactor multiple block allocator (mballoc) code

    - Fix a problem with mballoc with a smaller file systems running out
    of blocks because they couldn't properly use blocks that had been
    reserved by inode preallocation.

    - Fixed a race in ext4_sync_parent() versus rename()

    - Simplify the error handling in the extent manipulation code

    - Make sure all metadata I/O errors are felected to
    ext4_ext_dirty()'s and ext4_make_inode_dirty()'s callers.

    - Avoid passing an error pointer to brelse in ext4_xattr_set()

    - Fix race which could result to freeing an inode on the dirty last
    in data=journal mode.

    - Fix refcount handling if ext4_iget() fails

    - Fix a crash in generic/019 caused by a corrupted extent node"

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (58 commits)
    ext4: avoid unnecessary transaction starts during writeback
    ext4: don't block for O_DIRECT if IOCB_NOWAIT is set
    ext4: remove the access_ok() check in ext4_ioctl_get_es_cache
    fs: remove the access_ok() check in ioctl_fiemap
    fs: handle FIEMAP_FLAG_SYNC in fiemap_prep
    fs: move fiemap range validation into the file systems instances
    iomap: fix the iomap_fiemap prototype
    fs: move the fiemap definitions out of fs.h
    fs: mark __generic_block_fiemap static
    ext4: remove the call to fiemap_check_flags in ext4_fiemap
    ext4: split _ext4_fiemap
    ext4: fix fiemap size checks for bitmap files
    ext4: fix EXT4_MAX_LOGICAL_BLOCK macro
    add comment for ext4_dir_entry_2 file_type member
    jbd2: avoid leaking transaction credits when unreserving handle
    ext4: drop ext4_journal_free_reserved()
    ext4: mballoc: use lock for checking free blocks while retrying
    ext4: mballoc: refactor ext4_mb_good_group()
    ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling
    ext4: mballoc: refactor ext4_mb_discard_preallocations()
    ...

    Linus Torvalds
     

05 Jun, 2020

4 commits