1. 17 11月, 2018 1 次提交
  2. 16 11月, 2018 5 次提交
  3. 15 11月, 2018 12 次提交
  4. 14 11月, 2018 13 次提交
    • M
      SCSI: fix queue cleanup race before queue initialization is done · 8dc765d4
      Ming Lei 提交于
      c2856ae2 ("blk-mq: quiesce queue before freeing queue") has
      already fixed this race, however the implied synchronize_rcu()
      in blk_mq_quiesce_queue() can slow down LUN probe a lot, so caused
      performance regression.
      
      Then 1311326c ("blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()")
      tried to quiesce queue for avoiding unnecessary synchronize_rcu()
      only when queue initialization is done, because it is usual to see
      lots of inexistent LUNs which need to be probed.
      
      However, turns out it isn't safe to quiesce queue only when queue
      initialization is done. Because when one SCSI command is completed,
      the user of sending command can be waken up immediately, then the
      scsi device may be removed, meantime the run queue in scsi_end_request()
      is still in-progress, so kernel panic can be caused.
      
      In Red Hat QE lab, there are several reports about this kind of kernel
      panic triggered during kernel booting.
      
      This patch tries to address the issue by grabing one queue usage
      counter during freeing one request and the following run queue.
      
      Fixes: 1311326c ("blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()")
      Cc: Andrew Jones <drjones@redhat.com>
      Cc: Bart Van Assche <bart.vanassche@wdc.com>
      Cc: linux-scsi@vger.kernel.org
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
      Cc: stable <stable@vger.kernel.org>
      Cc: jianchao.wang <jianchao.w.wang@oracle.com>
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      8dc765d4
    • D
      block: fix 32 bit overflow in __blkdev_issue_discard() · 4800bf7b
      Dave Chinner 提交于
      A discard cleanup merged into 4.20-rc2 causes fstests xfs/259 to
      fall into an endless loop in the discard code. The test is creating
      a device that is exactly 2^32 sectors in size to test mkfs boundary
      conditions around the 32 bit sector overflow region.
      
      mkfs issues a discard for the entire device size by default, and
      hence this throws a sector count of 2^32 into
      blkdev_issue_discard(). It takes the number of sectors to discard as
      a sector_t - a 64 bit value.
      
      The commit ba5d7385 ("block: cleanup __blkdev_issue_discard")
      takes this sector count and casts it to a 32 bit value before
      comapring it against the maximum allowed discard size the device
      has. This truncates away the upper 32 bits, and so if the lower 32
      bits of the sector count is zero, it starts issuing discards of
      length 0. This causes the code to fall into an endless loop, issuing
      a zero length discards over and over again on the same sector.
      
      Fixes: ba5d7385 ("block: cleanup __blkdev_issue_discard")
      Tested-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      
      Killed pointless WARN_ON().
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      4800bf7b
    • M
      xtensa: fix boot parameters address translation · 40dc948f
      Max Filippov 提交于
      The bootloader may pass physical address of the boot parameters structure
      to the MMUv3 kernel in the register a2. Code in the _SetupMMU block in
      the arch/xtensa/kernel/head.S is supposed to map that physical address to
      the virtual address in the configured virtual memory layout.
      
      This code haven't been updated when additional 256+256 and 512+512
      memory layouts were introduced and it may produce wrong addresses when
      used with these layouts.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      40dc948f
    • P
      selinux: fix non-MLS handling in mls_context_to_sid() · 877181a8
      Paul Moore 提交于
      Commit 95ffe194 ("selinux: refactor mls_context_to_sid() and make
      it stricter") inadvertently changed how we handle labels that did not
      contain MLS information.  This patch restores the proper behavior in
      mls_context_to_sid() and adds a comment explaining the proper
      behavior to help ensure this doesn't happen again.
      
      Fixes: 95ffe194 ("selinux: refactor mls_context_to_sid() and make it stricter")
      Reported-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      877181a8
    • T
      NFSv4: Fix an Oops during delegation callbacks · e39d8a18
      Trond Myklebust 提交于
      If the server sends a CB_GETATTR or a CB_RECALL while the filesystem is
      being unmounted, then we can Oops when releasing the inode in
      nfs4_callback_getattr() and nfs4_callback_recall().
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      e39d8a18
    • M
      integrity: support new struct public_key_signature encoding field · fd35f192
      Mimi Zohar 提交于
      On systems with IMA-appraisal enabled with a policy requiring file
      signatures, the "good" signature values are stored on the filesystem as
      extended attributes (security.ima).  Signature verification failure
      would normally be limited to just a particular file (eg. executable),
      but during boot signature verification failure could result in a system
      hang.
      
      Defining and requiring a new public_key_signature field requires all
      callers of asymmetric signature verification to be updated to reflect
      the change.  This patch updates the integrity asymmetric_verify()
      caller.
      
      Fixes: 82f94f24 ("KEYS: Provide software public key query function [ver #2]")
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      Cc: David Howells <dhowells@redhat.com>
      Acked-by: NDenis Kenzior <denkenz@gmail.com>
      Signed-off-by: NJames Morris <james.morris@microsoft.com>
      fd35f192
    • G
      kdb: kdb_support: mark expected switch fall-throughs · 646558ff
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      Notice that in this particular case, I replaced the code comments with
      a proper "fall through" annotation, which is what GCC is expecting
      to find.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      646558ff
    • G
      kdb: kdb_keyboard: mark expected switch fall-throughs · 01cb3735
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      Notice that in this particular case, I replaced the code comments with
      a proper "fall through" annotation, which is what GCC is expecting
      to find.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      01cb3735
    • G
      kdb: kdb_main: refactor code in kdb_md_line · 9eb62f0e
      Gustavo A. R. Silva 提交于
      Replace the whole switch statement with a for loop.  This makes the
      code clearer and easy to read.
      
      This also addresses the following Coverity warnings:
      
      Addresses-Coverity-ID: 115090 ("Missing break in switch")
      Addresses-Coverity-ID: 115091 ("Missing break in switch")
      Addresses-Coverity-ID: 114700 ("Missing break in switch")
      Suggested-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
      [daniel.thompson@linaro.org: Tiny grammar change in description]
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      9eb62f0e
    • P
      kdb: Use strscpy with destination buffer size · c2b94c72
      Prarit Bhargava 提交于
      gcc 8.1.0 warns with:
      
      kernel/debug/kdb/kdb_support.c: In function ‘kallsyms_symbol_next’:
      kernel/debug/kdb/kdb_support.c:239:4: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
           strncpy(prefix_name, name, strlen(name)+1);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      kernel/debug/kdb/kdb_support.c:239:31: note: length computed here
      
      Use strscpy() with the destination buffer size, and use ellipses when
      displaying truncated symbols.
      
      v2: Use strscpy()
      Signed-off-by: NPrarit Bhargava <prarit@redhat.com>
      Cc: Jonathan Toppins <jtoppins@redhat.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Daniel Thompson <daniel.thompson@linaro.org>
      Cc: kgdb-bugreport@lists.sourceforge.net
      Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      c2b94c72
    • C
      kdb: print real address of pointers instead of hashed addresses · 568fb6f4
      Christophe Leroy 提交于
      Since commit ad67b74d ("printk: hash addresses printed with %p"),
      all pointers printed with %p are printed with hashed addresses
      instead of real addresses in order to avoid leaking addresses in
      dmesg and syslog. But this applies to kdb too, with is unfortunate:
      
          Entering kdb (current=0x(ptrval), pid 329) due to Keyboard Entry
          kdb> ps
          15 sleeping system daemon (state M) processes suppressed,
          use 'ps A' to see all.
          Task Addr       Pid   Parent [*] cpu State Thread     Command
          0x(ptrval)      329      328  1    0   R  0x(ptrval) *sh
      
          0x(ptrval)        1        0  0    0   S  0x(ptrval)  init
          0x(ptrval)        3        2  0    0   D  0x(ptrval)  rcu_gp
          0x(ptrval)        4        2  0    0   D  0x(ptrval)  rcu_par_gp
          0x(ptrval)        5        2  0    0   D  0x(ptrval)  kworker/0:0
          0x(ptrval)        6        2  0    0   D  0x(ptrval)  kworker/0:0H
          0x(ptrval)        7        2  0    0   D  0x(ptrval)  kworker/u2:0
          0x(ptrval)        8        2  0    0   D  0x(ptrval)  mm_percpu_wq
          0x(ptrval)       10        2  0    0   D  0x(ptrval)  rcu_preempt
      
      The whole purpose of kdb is to debug, and for debugging real addresses
      need to be known. In addition, data displayed by kdb doesn't go into
      dmesg.
      
      This patch replaces all %p by %px in kdb in order to display real
      addresses.
      
      Fixes: ad67b74d ("printk: hash addresses printed with %p")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      568fb6f4
    • C
      kdb: use correct pointer when 'btc' calls 'btt' · dded2e15
      Christophe Leroy 提交于
      On a powerpc 8xx, 'btc' fails as follows:
      
      Entering kdb (current=0x(ptrval), pid 282) due to Keyboard Entry
      kdb> btc
      btc: cpu status: Currently on cpu 0
      Available cpus: 0
      kdb_getarea: Bad address 0x0
      
      when booting the kernel with 'debug_boot_weak_hash', it fails as well
      
      Entering kdb (current=0xba99ad80, pid 284) due to Keyboard Entry
      kdb> btc
      btc: cpu status: Currently on cpu 0
      Available cpus: 0
      kdb_getarea: Bad address 0xba99ad80
      
      On other platforms, Oopses have been observed too, see
      https://github.com/linuxppc/linux/issues/139
      
      This is due to btc calling 'btt' with %p pointer as an argument.
      
      This patch replaces %p by %px to get the real pointer value as
      expected by 'btt'
      
      Fixes: ad67b74d ("printk: hash addresses printed with %p")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      dded2e15
    • O
      selinux: check length properly in SCTP bind hook · c138325f
      Ondrej Mosnacek 提交于
      selinux_sctp_bind_connect() must verify if the address buffer has
      sufficient length before accessing the 'sa_family' field. See
      __sctp_connect() for a similar check.
      
      The length of the whole address ('len') is already checked in the
      callees.
      Reported-by: NQian Cai <cai@gmx.us>
      Fixes: d452930f ("selinux: Add SCTP support")
      Cc: <stable@vger.kernel.org> # 4.17+
      Cc: Richard Haines <richard_c_haines@btinternet.com>
      Signed-off-by: NOndrej Mosnacek <omosnace@redhat.com>
      Tested-by: NQian Cai <cai@gmx.us>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      c138325f
  5. 13 11月, 2018 9 次提交