1. 27 Jan, 2023 11 commits
  2. 26 Jan, 2023 24 commits
  3. 25 Jan, 2023 5 commits
    • Vladimir Oltean's avatar
      net: ethtool: fix NULL pointer dereference in pause_prepare_data() · f5be9caf
      Vladimir Oltean authored
      In the following call path:
      
      ethnl_default_dumpit
      -> ethnl_default_dump_one
         -> ctx->ops->prepare_data
            -> pause_prepare_data
      
      struct genl_info *info will be passed as NULL, and pause_prepare_data()
      dereferences it while getting the extended ack pointer.
      
      To avoid that, just set the extack to NULL if "info" is NULL, since the
      netlink extack handling messages know how to deal with that.
      
      The pattern "info ? info->extack : NULL" is present in quite a few other
      "prepare_data" implementations, so it's clear that it's a more general
      problem to be dealt with at a higher level, but the code should have at
      least adhered to the current conventions to avoid the NULL dereference.
      
      Fixes: 04692c90 ("net: ethtool: netlink: retrieve stats from multiple sources (eMAC, pMAC)")
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reported-by: syzbot+9d44aae2720fc40b8474@syzkaller.appspotmail.com
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f5be9caf
    • Vladimir Oltean's avatar
      net: ethtool: fix NULL pointer dereference in stats_prepare_data() · c96de136
      Vladimir Oltean authored
      In the following call path:
      
      ethnl_default_dumpit
      -> ethnl_default_dump_one
         -> ctx->ops->prepare_data
            -> stats_prepare_data
      
      struct genl_info *info will be passed as NULL, and stats_prepare_data()
      dereferences it while getting the extended ack pointer.
      
      To avoid that, just set the extack to NULL if "info" is NULL, since the
      netlink extack handling messages know how to deal with that.
      
      The pattern "info ? info->extack : NULL" is present in quite a few other
      "prepare_data" implementations, so it's clear that it's a more general
      problem to be dealt with at a higher level, but the code should have at
      least adhered to the current conventions to avoid the NULL dereference.
      
      Fixes: 04692c90 ("net: ethtool: netlink: retrieve stats from multiple sources (eMAC, pMAC)")
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c96de136
    • David S. Miller's avatar
      Merge branch 's390-ism-generalized-interface' · 99db6fb0
      David S. Miller authored
      Jan Karcher says:
      
      ====================
      drivers/s390/net/ism: Add generalized interface
      
      Previously, there was no clean separation between SMC-D code and the ISM
      device driver.This patch series addresses the situation to make ISM available
      for uses outside of SMC-D.
      In detail: SMC-D offers an interface via struct smcd_ops, which only the
      ISM module implements so far. However, there is no real separation between
      the smcd and ism modules, which starts right with the ISM device
      initialization, which calls directly into the SMC-D code.
      This patch series introduces a new API in the ISM module, which allows
      registration of arbitrary clients via include/linux/ism.h: struct ism_client.
      Furthermore, it introduces a "pure" struct ism_dev (i.e. getting rid of
      dependencies on SMC-D in the device structure), and adds a number of API
      calls for data transfers via ISM (see ism_register_dmb() & friends).
      Still, the ISM module implements the SMC-D API, and therefore has a number
      of internal helper functions for that matter.
      Note that the ISM API is consciously kept thin for now (as compared to the
      SMC-D API calls), as a number of API calls are only used with SMC-D and
      hardly have any meaningful usage beyond SMC-D, e.g. the VLAN-related calls.
      
      v1 -> v2:
        Removed s390x dependency which broke config for other archs.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      99db6fb0
    • Stefan Raspl's avatar
      net/smc: De-tangle ism and smc device initialization · 8c81ba20
      Stefan Raspl authored
      The struct device for ISM devices was part of struct smcd_dev. Move to
      struct ism_dev, provide a new API call in struct smcd_ops, and convert
      existing SMCD code accordingly.
      Furthermore, remove struct smcd_dev from struct ism_dev.
      This is the final part of a bigger overhaul of the interfaces between SMC
      and ISM.
      Signed-off-by: default avatarStefan Raspl <raspl@linux.ibm.com>
      Signed-off-by: default avatarJan Karcher <jaka@linux.ibm.com>
      Signed-off-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c81ba20
    • Stefan Raspl's avatar
      s390/ism: Consolidate SMC-D-related code · 820f2100
      Stefan Raspl authored
      The ism module had SMC-D-specific code sprinkled across the entire module.
      We are now consolidating the SMC-D-specific parts into the latter parts
      of the module, so it becomes more clear what code is intended for use with
      ISM, and which parts are glue code for usage in the context of SMC-D.
      This is the fourth part of a bigger overhaul of the interfaces between SMC
      and ISM.
      Signed-off-by: default avatarStefan Raspl <raspl@linux.ibm.com>
      Signed-off-by: default avatarJan Karcher <jaka@linux.ibm.com>
      Signed-off-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      820f2100