1. 30 3月, 2019 15 次提交
  2. 28 3月, 2019 6 次提交
    • D
      afs: Fix StoreData op marshalling · 8c7ae38d
      David Howells 提交于
      The marshalling of AFS.StoreData, AFS.StoreData64 and YFS.StoreData64 calls
      generated by ->setattr() ops for the purpose of expanding a file is
      incorrect due to older documentation incorrectly describing the way the RPC
      'FileLength' parameter is meant to work.
      
      The older documentation says that this is the length the file is meant to
      end up at the end of the operation; however, it was never implemented this
      way in any of the servers, but rather the file is truncated down to this
      before the write operation is effected, and never expanded to it (and,
      indeed, it was renamed to 'TruncPos' in 2014).
      
      Fix this by setting the position parameter to the new file length and doing
      a zero-lengh write there.
      
      The bug causes Xwayland to SIGBUS due to unexpected non-expansion of a file
      it then mmaps.  This can be tested by giving the following test program a
      filename in an AFS directory:
      
      	#include <stdio.h>
      	#include <stdlib.h>
      	#include <unistd.h>
      	#include <fcntl.h>
      	#include <sys/mman.h>
      	int main(int argc, char *argv[])
      	{
      		char *p;
      		int fd;
      		if (argc != 2) {
      			fprintf(stderr,
      				"Format: test-trunc-mmap <file>\n");
      			exit(2);
      		}
      		fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC);
      		if (fd < 0) {
      			perror(argv[1]);
      			exit(1);
      		}
      		if (ftruncate(fd, 0x140008) == -1) {
      			perror("ftruncate");
      			exit(1);
      		}
      		p = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
      			 MAP_SHARED, fd, 0);
      		if (p == MAP_FAILED) {
      			perror("mmap");
      			exit(1);
      		}
      		p[0] = 'a';
      		if (munmap(p, 4096) < 0) {
      			perror("munmap");
      			exit(1);
      		}
      		if (close(fd) < 0) {
      			perror("close");
      			exit(1);
      		}
      		exit(0);
      	}
      
      Fixes: 31143d5d ("AFS: implement basic file write support")
      Reported-by: NJonathan Billings <jsbillin@umich.edu>
      Tested-by: NJonathan Billings <jsbillin@umich.edu>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8c7ae38d
    • D
      vfs: Update mount API docs · 7d6ab823
      David Howells 提交于
      Update the mount API docs to reflect recent changes to the code.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7d6ab823
    • L
      Merge tag 's390-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · bfed6d0f
      Linus Torvalds 提交于
      Pull s390 fixes from Martin Schwidefsky:
       "Improvements and bug fixes for 5.1-rc2:
      
         - Fix early free of the channel program in vfio
      
         - On AP device removal make sure that all messages are flushed with
           the driver still attached that queued the message
      
         - Limit brk randomization to 32MB to reduce the chance that the heap
           of ld.so is placed after the main stack
      
         - Add a rolling average for the steal time of a CPU, this will be
           needed for KVM to decide when to do busy waiting
      
         - Fix a warning in the CPU-MF code
      
         - Add a notification handler for AP configuration change to react
           faster to new AP devices"
      
      * tag 's390-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/cpumf: Fix warning from check_processor_id
        zcrypt: handle AP Info notification from CHSC SEI command
        vfio: ccw: only free cp on final interrupt
        s390/vtime: steal time exponential moving average
        s390/zcrypt: revisit ap device remove procedure
        s390: limit brk randomization to 32MB
      bfed6d0f
    • L
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 97c41a6b
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Arnd Bergmann:
       "A couple of minor fixes only for now
      
         - fix for incorrect DMA channels on Renesas R-Car
      
         - Broadcom bcm2835 error handling fixes
      
         - Kconfig dependency fixes for bcm2835 and davinci
      
         - CPU idle wakeup fix for i.MX6
      
         - MMC regression on Tegra186
      
         - fix incorrect phy settings on one imx board"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        arm64: tegra: Disable CQE Support for SDMMC4 on Tegra186
        ARM: dts: nomadik: Fix polarity of SPI CS
        ARM: davinci: fix build failure with allnoconfig
        ARM: imx_v4_v5_defconfig: enable PWM driver
        ARM: imx_v6_v7_defconfig: continue compiling the pwm driver
        ARM: dts: imx6dl-yapp4: Use correct pseudo PHY address for the switch
        ARM: dts: imx6qdl: Fix typo in imx6qdl-icore-rqs.dtsi
        ARM: dts: imx6ull: Use the correct style for SPDX License Identifier
        ARM: dts: pfla02: increase phy reset duration
        ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time
        ARM: imx51: fix a leaked reference by adding missing of_node_put
        ARM: dts: imx6dl-yapp4: Use rgmii-id phy mode on the cpu port
        arm64: bcm2835: Add missing dependency on MFD_CORE.
        ARM: dts: bcm283x: Fix hdmi hpd gpio pull
        soc: bcm: bcm2835-pm: Fix error paths of initialization.
        soc: bcm: bcm2835-pm: Fix PM_IMAGE_PERI power domain support.
        arm64: dts: renesas: r8a774c0: Fix SCIF5 DMA channels
        arm64: dts: renesas: r8a77990: Fix SCIF5 DMA channels
      97c41a6b
    • T
      s390/cpumf: Fix warning from check_processor_id · b6ffdf27
      Thomas Richter 提交于
      Function __hw_perf_event_init() used a CPU variable without
      ensuring CPU preemption has been disabled. This caused the
      following warning in the kernel log:
      
        [ 7.277085] BUG: using smp_processor_id() in preemptible
                       [00000000] code: cf-csdiag/1892
        [ 7.277111] caller is cf_diag_event_init+0x13a/0x338
        [ 7.277122] CPU: 10 PID: 1892 Comm: cf-csdiag Not tainted
                       5.0.0-20190318.rc0.git0.9e1a11e0f602.300.fc29.s390x+debug #1
        [ 7.277131] Hardware name: IBM 2964 NC9 712 (LPAR)
        [ 7.277139] Call Trace:
        [ 7.277150] ([<000000000011385a>] show_stack+0x82/0xd0)
        [ 7.277161]  [<0000000000b7a71a>] dump_stack+0x92/0xd0
        [ 7.277174]  [<00000000007b7e9c>] check_preemption_disabled+0xe4/0x100
        [ 7.277183]  [<00000000001228aa>] cf_diag_event_init+0x13a/0x338
        [ 7.277195]  [<00000000002cf3aa>] perf_try_init_event+0x72/0xf0
        [ 7.277204]  [<00000000002d0bba>] perf_event_alloc+0x6fa/0xce0
        [ 7.277214]  [<00000000002dc4a8>] __s390x_sys_perf_event_open+0x398/0xd50
        [ 7.277224]  [<0000000000b9e8f0>] system_call+0xdc/0x2d8
        [ 7.277233] 2 locks held by cf-csdiag/1892:
        [ 7.277241]  #0: 00000000976f5510 (&sig->cred_guard_mutex){+.+.},
                        at: __s390x_sys_perf_event_open+0xd2e/0xd50
        [ 7.277257]  #1: 00000000363b11bd (&pmus_srcu){....},
                        at: perf_event_alloc+0x52e/0xce0
      
      The variable is now accessed in proper context. Use
      get_cpu_var()/put_cpu_var() pair to disable
      preemption during access.
      As the hardware authorization settings apply to all CPUs, it
      does not matter which CPU is used to check the authorization setting.
      
      Remove the event->count assignment. It is not needed as function
      perf_event_alloc() allocates memory for the event with kzalloc() and
      thus count is already set to zero.
      
      Fixes: fe5908bc ("s390/cpum_cf_diag: Add support for s390 counter facility diagnostic trace")
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b6ffdf27
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 1a9df9e2
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
       "Fixes here and there, a couple new device IDs, as usual:
      
         1) Fix BQL race in dpaa2-eth driver, from Ioana Ciornei.
      
         2) Fix 64-bit division in iwlwifi, from Arnd Bergmann.
      
         3) Fix documentation for some eBPF helpers, from Quentin Monnet.
      
         4) Some UAPI bpf header sync with tools, also from Quentin Monnet.
      
         5) Set descriptor ownership bit at the right time for jumbo frames in
            stmmac driver, from Aaro Koskinen.
      
         6) Set IFF_UP properly in tun driver, from Eric Dumazet.
      
         7) Fix load/store doubleword instruction generation in powerpc eBPF
            JIT, from Naveen N. Rao.
      
         8) nla_nest_start() return value checks all over, from Kangjie Lu.
      
         9) Fix asoc_id handling in SCTP after the SCTP_*_ASSOC changes this
            merge window. From Marcelo Ricardo Leitner and Xin Long.
      
        10) Fix memory corruption with large MTUs in stmmac, from Aaro
            Koskinen.
      
        11) Do not use ipv4 header for ipv6 flows in TCP and DCCP, from Eric
            Dumazet.
      
        12) Fix topology subscription cancellation in tipc, from Erik Hugne.
      
        13) Memory leak in genetlink error path, from Yue Haibing.
      
        14) Valid control actions properly in packet scheduler, from Davide
            Caratti.
      
        15) Even if we get EEXIST, we still need to rehash if a shrink was
            delayed. From Herbert Xu.
      
        16) Fix interrupt mask handling in interrupt handler of r8169, from
            Heiner Kallweit.
      
        17) Fix leak in ehea driver, from Wen Yang"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (168 commits)
        dpaa2-eth: fix race condition with bql frame accounting
        chelsio: use BUG() instead of BUG_ON(1)
        net: devlink: skip info_get op call if it is not defined in dumpit
        net: phy: bcm54xx: Encode link speed and activity into LEDs
        tipc: change to check tipc_own_id to return in tipc_net_stop
        net: usb: aqc111: Extend HWID table by QNAP device
        net: sched: Kconfig: update reference link for PIE
        net: dsa: qca8k: extend slave-bus implementations
        net: dsa: qca8k: remove leftover phy accessors
        dt-bindings: net: dsa: qca8k: support internal mdio-bus
        dt-bindings: net: dsa: qca8k: fix example
        net: phy: don't clear BMCR in genphy_soft_reset
        bpf, libbpf: clarify bump in libbpf version info
        bpf, libbpf: fix version info and add it to shared object
        rxrpc: avoid clang -Wuninitialized warning
        tipc: tipc clang warning
        net: sched: fix cleanup NULL pointer exception in act_mirr
        r8169: fix cable re-plugging issue
        net: ethernet: ti: fix possible object reference leak
        net: ibm: fix possible object reference leak
        ...
      1a9df9e2
  3. 27 3月, 2019 16 次提交
  4. 26 3月, 2019 3 次提交
    • H
      ftrace: Fix warning using plain integer as NULL & spelling corrections · 9efb85c5
      Hariprasad Kelam 提交于
      Changed  0 --> NULL to avoid sparse warning
      Corrected spelling mistakes reported by checkpatch.pl
      Sparse warning below:
      
      sudo make C=2 CF=-D__CHECK_ENDIAN__ M=kernel/trace
      
      CHECK   kernel/trace/ftrace.c
      kernel/trace/ftrace.c:3007:24: warning: Using plain integer as NULL pointer
      kernel/trace/ftrace.c:4758:37: warning: Using plain integer as NULL pointer
      
      Link: http://lkml.kernel.org/r/20190323183523.GA2244@hari-Inspiron-1545Signed-off-by: NHariprasad Kelam <hariprasad.kelam@gmail.com>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      9efb85c5
    • F
      tracing: initialize variable in create_dyn_event() · 3dee10da
      Frank Rowand 提交于
      Fix compile warning in create_dyn_event(): 'ret' may be used uninitialized
      in this function [-Wuninitialized].
      
      Link: http://lkml.kernel.org/r/1553237900-8555-1-git-send-email-frowand.list@gmail.com
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org
      Fixes: 5448d44c ("tracing: Add unified dynamic event framework")
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      3dee10da
    • T
      tracing: Remove unnecessary var_ref destroy in track_data_destroy() · ff9d31d0
      Tom Zanussi 提交于
      Commit 656fe2ba (tracing: Use hist trigger's var_ref array to
      destroy var_refs) centralized the destruction of all the var_refs
      in one place so that other code didn't have to do it.
      
      The track_data_destroy() added later ignored that and also destroyed
      the track_data var_ref, causing a double-free error flagged by KASAN.
      
      ==================================================================
      BUG: KASAN: use-after-free in destroy_hist_field+0x30/0x70
      Read of size 8 at addr ffff888086df2210 by task bash/1694
      
      CPU: 6 PID: 1694 Comm: bash Not tainted 5.1.0-rc1-test+ #15
      Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03
      07/14/2016
      Call Trace:
       dump_stack+0x71/0xa0
       ? destroy_hist_field+0x30/0x70
       print_address_description.cold.3+0x9/0x1fb
       ? destroy_hist_field+0x30/0x70
       ? destroy_hist_field+0x30/0x70
       kasan_report.cold.4+0x1a/0x33
       ? __kasan_slab_free+0x100/0x150
       ? destroy_hist_field+0x30/0x70
       destroy_hist_field+0x30/0x70
       track_data_destroy+0x55/0xe0
       destroy_hist_data+0x1f0/0x350
       hist_unreg_all+0x203/0x220
       event_trigger_open+0xbb/0x130
       do_dentry_open+0x296/0x700
       ? stacktrace_count_trigger+0x30/0x30
       ? generic_permission+0x56/0x200
       ? __x64_sys_fchdir+0xd0/0xd0
       ? inode_permission+0x55/0x200
       ? security_inode_permission+0x18/0x60
       path_openat+0x633/0x22b0
       ? path_lookupat.isra.50+0x420/0x420
       ? __kasan_kmalloc.constprop.12+0xc1/0xd0
       ? kmem_cache_alloc+0xe5/0x260
       ? getname_flags+0x6c/0x2a0
       ? do_sys_open+0x149/0x2b0
       ? do_syscall_64+0x73/0x1b0
       ? entry_SYSCALL_64_after_hwframe+0x44/0xa9
       ? _raw_write_lock_bh+0xe0/0xe0
       ? __kernel_text_address+0xe/0x30
       ? unwind_get_return_address+0x2f/0x50
       ? __list_add_valid+0x2d/0x70
       ? deactivate_slab.isra.62+0x1f4/0x5a0
       ? getname_flags+0x6c/0x2a0
       ? set_track+0x76/0x120
       do_filp_open+0x11a/0x1a0
       ? may_open_dev+0x50/0x50
       ? _raw_spin_lock+0x7a/0xd0
       ? _raw_write_lock_bh+0xe0/0xe0
       ? __alloc_fd+0x10f/0x200
       do_sys_open+0x1db/0x2b0
       ? filp_open+0x50/0x50
       do_syscall_64+0x73/0x1b0
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      RIP: 0033:0x7fa7b24a4ca2
      Code: 25 00 00 41 00 3d 00 00 41 00 74 4c 48 8d 05 85 7a 0d 00 8b 00 85 c0
      75 6d 89 f2 b8 01 01 00 00 48 89 fe bf 9c ff ff ff 0f 05 <48> 3d 00 f0 ff ff
      0f 87 a2 00 00 00 48 8b 4c 24 28 64 48 33 0c 25
      RSP: 002b:00007fffbafb3af0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
      RAX: ffffffffffffffda RBX: 000055d3648ade30 RCX: 00007fa7b24a4ca2
      RDX: 0000000000000241 RSI: 000055d364a55240 RDI: 00000000ffffff9c
      RBP: 00007fffbafb3bf0 R08: 0000000000000020 R09: 0000000000000002
      R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000000000
      R13: 0000000000000003 R14: 0000000000000001 R15: 000055d364a55240
      ==================================================================
      
      So remove the track_data_destroy() destroy_hist_field() call for that
      var_ref.
      
      Link: http://lkml.kernel.org/r/1deffec420f6a16d11dd8647318d34a66d1989a9.camel@linux.intel.com
      
      Fixes: 466f4528 ("tracing: Generalize hist trigger onmax and save action")
      Reported-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: NTom Zanussi <tom.zanussi@linux.intel.com>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      ff9d31d0