1. 01 11月, 2019 5 次提交
  2. 10 10月, 2019 3 次提交
  3. 04 10月, 2019 1 次提交
    • S
      scsi: zfcp: fix reaction on bit error threshold notification · 2190168a
      Steffen Maier 提交于
      On excessive bit errors for the FCP channel ingress fibre path, the channel
      notifies us.  Previously, we only emitted a kernel message and a trace
      record.  Since performance can become suboptimal with I/O timeouts due to
      bit errors, we now stop using an FCP device by default on channel
      notification so multipath on top can timely failover to other paths.  A new
      module parameter zfcp.ber_stop can be used to get zfcp old behavior.
      
      User explanation of new kernel message:
      
       * Description:
       * The FCP channel reported that its bit error threshold has been exceeded.
       * These errors might result from a problem with the physical components
       * of the local fibre link into the FCP channel.
       * The problem might be damage or malfunction of the cable or
       * cable connection between the FCP channel and
       * the adjacent fabric switch port or the point-to-point peer.
       * Find details about the errors in the HBA trace for the FCP device.
       * The zfcp device driver closed down the FCP device
       * to limit the performance impact from possible I/O command timeouts.
       * User action:
       * Check for problems on the local fibre link, ensure that fibre optics are
       * clean and functional, and all cables are properly plugged.
       * After the repair action, you can manually recover the FCP device by
       * writing "0" into its "failed" sysfs attribute.
       * If recovery through sysfs is not possible, set the CHPID of the device
       * offline and back online on the service element.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: <stable@vger.kernel.org> #2.6.30+
      Link: https://lore.kernel.org/r/20191001104949.42810-1-maier@linux.ibm.comReviewed-by: NJens Remus <jremus@linux.ibm.com>
      Reviewed-by: NBenjamin Block <bblock@linux.ibm.com>
      Signed-off-by: NSteffen Maier <maier@linux.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      2190168a
  4. 01 10月, 2019 3 次提交
  5. 24 9月, 2019 2 次提交
    • V
      s390/cio: exclude subchannels with no parent from pseudo check · ab575884
      Vasily Gorbik 提交于
      ccw console is created early in start_kernel and used before css is
      initialized or ccw console subchannel is registered. Until then console
      subchannel does not have a parent. For that reason assume subchannels
      with no parent are not pseudo subchannels. This fixes the following
      kasan finding:
      
      BUG: KASAN: global-out-of-bounds in sch_is_pseudo_sch+0x8e/0x98
      Read of size 8 at addr 00000000000005e8 by task swapper/0/0
      
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.3.0-rc8-07370-g6ac43dd12538 #2
      Hardware name: IBM 2964 NC9 702 (z/VM 6.4.0)
      Call Trace:
      ([<000000000012cd76>] show_stack+0x14e/0x1e0)
       [<0000000001f7fb44>] dump_stack+0x1a4/0x1f8
       [<00000000007d7afc>] print_address_description+0x64/0x3c8
       [<00000000007d75f6>] __kasan_report+0x14e/0x180
       [<00000000018a2986>] sch_is_pseudo_sch+0x8e/0x98
       [<000000000189b950>] cio_enable_subchannel+0x1d0/0x510
       [<00000000018cac7c>] ccw_device_recognition+0x12c/0x188
       [<0000000002ceb1a8>] ccw_device_enable_console+0x138/0x340
       [<0000000002cf1cbe>] con3215_init+0x25e/0x300
       [<0000000002c8770a>] console_init+0x68a/0x9b8
       [<0000000002c6a3d6>] start_kernel+0x4fe/0x728
       [<0000000000100070>] startup_continue+0x70/0xd0
      
      Cc: stable@vger.kernel.org
      Reviewed-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      ab575884
    • V
      s390/cio: avoid calling strlen on null pointer · ea298e6e
      Vasily Gorbik 提交于
      Fix the following kasan finding:
      BUG: KASAN: global-out-of-bounds in ccwgroup_create_dev+0x850/0x1140
      Read of size 1 at addr 0000000000000000 by task systemd-udevd.r/561
      
      CPU: 30 PID: 561 Comm: systemd-udevd.r Tainted: G    B
      Hardware name: IBM 3906 M04 704 (LPAR)
      Call Trace:
      ([<0000000231b3db7e>] show_stack+0x14e/0x1a8)
       [<0000000233826410>] dump_stack+0x1d0/0x218
       [<000000023216fac4>] print_address_description+0x64/0x380
       [<000000023216f5a8>] __kasan_report+0x138/0x168
       [<00000002331b8378>] ccwgroup_create_dev+0x850/0x1140
       [<00000002332b618a>] group_store+0x3a/0x50
       [<00000002323ac706>] kernfs_fop_write+0x246/0x3b8
       [<00000002321d409a>] vfs_write+0x132/0x450
       [<00000002321d47da>] ksys_write+0x122/0x208
       [<0000000233877102>] system_call+0x2a6/0x2c8
      
      Triggered by:
      openat(AT_FDCWD, "/sys/bus/ccwgroup/drivers/qeth/group",
      		O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 16
      write(16, "0.0.bd00,0.0.bd01,0.0.bd02", 26) = 26
      
      The problem is that __get_next_id in ccwgroup_create_dev might set "buf"
      buffer pointer to NULL and explicit check for that is required.
      
      Cc: stable@vger.kernel.org
      Reviewed-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      ea298e6e
  6. 19 9月, 2019 3 次提交
  7. 17 9月, 2019 1 次提交
  8. 16 9月, 2019 1 次提交
  9. 05 9月, 2019 2 次提交
  10. 03 9月, 2019 1 次提交
  11. 29 8月, 2019 1 次提交
  12. 26 8月, 2019 1 次提交
  13. 25 8月, 2019 8 次提交
  14. 23 8月, 2019 1 次提交
    • C
      vfio-ccw: add some logging · 60e05d1c
      Cornelia Huck 提交于
      Usually, the common I/O layer logs various things into the s390
      cio debug feature, which has been very helpful in the past when
      looking at crash dumps. As vfio-ccw devices unbind from the
      standard I/O subchannel driver, we lose some information there.
      
      Let's introduce some vfio-ccw debug features and log some things
      there. (Unfortunately we cannot reuse the cio debug feature from
      a module.)
      
      Message-Id: <20190816151505.9853-2-cohuck@redhat.com>
      Reviewed-by: NEric Farman <farman@linux.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      60e05d1c
  15. 21 8月, 2019 7 次提交
    • H
      s390/pkey: add CCA AES cipher key support · f2bbc96e
      Harald Freudenberger 提交于
      Introduce new ioctls and structs to be used with these new ioctls
      which are able to handle CCA AES secure keys and CCA AES cipher keys:
      
      PKEY_GENSECK2: Generate secure key, version 2.
        Generate either a CCA AES secure key or a CCA AES cipher key.
      
      PKEY_CLR2SECK2: Generate secure key from clear key value, version 2.
        Construct a CCA AES secure key or CCA AES cipher key from a given
        clear key value.
      
      PKEY_VERIFYKEY2: Verify the given secure key, version 2.
        Check for correct key type. If cardnr and domain are given, also
        check if this apqn is able to handle this type of key. If cardnr and
        domain are 0xFFFF, on return these values are filled with an apqn
        able to handle this key. The function also checks for the master key
        verification patterns of the key matching to the current or
        alternate mkvp of the apqn. CCA AES cipher keys are also checked
        for CPACF export allowed (CPRTCPAC flag). Currently CCA AES secure
        keys and CCA AES cipher keys are supported (may get extended in the
        future).
      
      PKEY_KBLOB2PROTK2: Transform a key blob (of any type) into
        a protected key, version 2. Difference to version 1 is only that
        this new ioctl has additional parameters to provide a list of
        apqns to be used for the transformation.
      
      PKEY_APQNS4K: Generate a list of APQNs based on the key blob given.
        Is able to find out which type of secure key is given (CCA AES
        secure key or CCA AES cipher key) and tries to find all matching
        crypto cards based on the MKVP and maybe other criterias (like CCA
        AES cipher keys need a CEX6C or higher). The list of APQNs is
        further filtered by the key's mkvp which needs to match to either
        the current mkvp or the alternate mkvp (which is the old mkvp on CCA
        adapters) of the apqns. The flags argument may be used to limit the
        matching apqns. If the PKEY_FLAGS_MATCH_CUR_MKVP is given, only the
        current mkvp of each apqn is compared. Likewise with the
        PKEY_FLAGS_MATCH_ALT_MKVP. If both are given it is assumed to return
        apqns where either the current or the alternate mkvp matches. If no
        matching APQN is found, the ioctl returns with 0 but the
        apqn_entries value is 0.
      
      PKEY_APQNS4KT: Generate a list of APQNs based on the key type given.
        Build a list of APQNs based on the given key type and maybe further
        restrict the list by given master key verification patterns.
        For different key types there may be different ways to match the
        master key verification patterns. For CCA keys (CCA data key and CCA
        cipher key) the first 8 bytes of cur_mkvp refer to the current mkvp
        value of the apqn and the first 8 bytes of the alt_mkvp refer to the
        old mkvp. The flags argument controls if the apqns current and/or
        alternate mkvp should match. If the PKEY_FLAGS_MATCH_CUR_MKVP is
        given, only the current mkvp of each apqn is compared. Likewise with
        the PKEY_FLAGS_MATCH_ALT_MKVP. If both are given, it is assumed to
        return apqns where either the current or the alternate mkvp
        matches. If no matching APQN is found, the ioctl returns with 0 but
        the apqn_entries value is 0.
      
      These new ioctls are now prepared for another new type of secure key
      blob which may come in the future. They all use a pointer to the key
      blob and a key blob length information instead of some hardcoded byte
      array. They all use the new enums pkey_key_type, pkey_key_size and
      pkey_key_info for getting/setting key type, key size and additional
      info about the key. All but the PKEY_VERIFY2 ioctl now work based on a
      list of apqns. This list is walked through trying to perform the
      operation on exactly this apqn without any further checking (like card
      type or online state). If the apqn fails, simple the next one in the
      list is tried until success (return 0) or the end of the list is
      reached (return -1 with errno ENODEV). All apqns in the list need to
      be exact apqns (0xFFFF as any card or domain is not allowed). There
      are two new ioctls which can be used to build a list of apqns based on
      a key or key type and maybe restricted by match to a current or
      alternate master key verifcation pattern.
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Reviewed-by: NIngo Franzki <ifranzki@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      f2bbc96e
    • H
      s390/zcrypt: Add low level functions for CCA AES cipher keys · 4bc123b1
      Harald Freudenberger 提交于
      This patch adds low level functions, structs and defines to support
      CCA AES cipher keys:
      - struct cipherkeytoken can be used for an inside view of the CCA AES
        cipher key token blob.
      - function cca_cipher2protkey() derives an CPACF protected key from an
        CCA AES cipher key.
      - function cca_gencipherkey() generates an CCA AES cipher key with
        random value.
      - function cca_findcard2() constructs a list of apqns based on input
        constrains like min hardware type, mkvp values.
      - cca_check_secaescipherkey() does a check on the given CCA AES cipher
        key blob.
      - cca_clr2cipherkey() generates an CCA AES cipher key from a given
        clear key value.
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Reviewed-by: NIngo Franzki <ifranzki@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      4bc123b1
    • H
      s390/zcrypt: extend cca_findcard function and helper · 4da57a2f
      Harald Freudenberger 提交于
      Rework and extension of the cca_findcard function to be prepared for
      other types of secure key blobs. Split the function and extract an
      internal function which has no awareness of key blobs any
      more. Improve this function and the helper code around to be able to
      check for a minimal crypto card hardware level (Background: the newer
      AES cipher keys need to match to the master key verification pattern
      and need to have a crypto card CEX6 or higher).
      
      No API change, neither for the in-kernel API nor the ioctl interface.
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Reviewed-by: NIngo Franzki <ifranzki@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      4da57a2f
    • H
      s390/pkey: pkey cleanup: narrow in-kernel API, fix some variable types · 183cb469
      Harald Freudenberger 提交于
      There are a lot of pkey functions exported as in-kernel callable
      API functions but not used at all. This patch narrows down the
      pkey in-kernel API to what is currently only used and exploited.
      
      Within the kernel just use u32 without any leading __u32. Also
      functions declared in a header file in arch/s390/include/asm
      don't need a comment 'In-kernel API', this is by definition,
      otherwise the header file would be in arch/s390/include/uapi/asm.
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Reviewed-by: NIngo Franzki <ifranzki@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      183cb469
    • V
      s390: clean .bss before running uncompressed kernel · 2e83e0eb
      Vasily Gorbik 提交于
      Clean uncompressed kernel .bss section in the startup code before
      the uncompressed kernel is executed. At this point of time initrd and
      certificates have been already rescued. Uncompressed kernel .bss size
      is known from vmlinux_info. It is also taken into consideration during
      uncompressed kernel positioning by kaslr (so it is safe to clean it).
      
      With that uncompressed kernel is starting with .bss section zeroed and
      no .bss section usage restrictions apply. Which makes chkbss checks for
      uncompressed kernel objects obsolete and they can be removed.
      
      early_nobss.c is also not needed anymore. Parts of it which are still
      relevant are moved to early.c. Kasan initialization code is now called
      directly from head64 (early.c is instrumented and should not be
      executed before kasan shadow memory is set up).
      Reviewed-by: NPhilipp Rudo <prudo@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      2e83e0eb
    • J
      s390/lcs: don't use intparm for channel IO · 0506d5ba
      Julian Wiedmann 提交于
      lcs passes an intparm when calling ccw_device_*(), even though lcs_irq()
      later makes no use of this.
      
      To reduce the confusion, consistently pass 0 as intparm instead.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0506d5ba
    • J
      s390/ctcm: don't use intparm for channel IO · 4f6e01f3
      Julian Wiedmann 提交于
      ctcm passes an intparm when calling ccw_device_*(), even though
      ctcm_irq_handler() later makes no use of this.
      
      To reduce the confusion, consistently pass 0 as intparm instead.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: NSebastian Ott <sebott@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f6e01f3