Skip to content
Snippets Groups Projects
  1. Jul 25, 2024
  2. Jul 24, 2024
    • Simon Horman's avatar
      net: stmmac: Correct byte order of perfect_match · e9dbebae
      Simon Horman authored
      
      The perfect_match parameter of the update_vlan_hash operation is __le16,
      and is correctly converted from host byte-order in the lone caller,
      stmmac_vlan_update().
      
      However, the implementations of this caller, dwxgmac2_update_vlan_hash()
      and dwxgmac2_update_vlan_hash(), both treat this parameter as host byte
      order, using the following pattern:
      
      	u32 value = ...
      	...
      	writel(value | perfect_match, ...);
      
      This is not correct because both:
      1) value is host byte order; and
      2) writel expects a host byte order value as it's first argument
      
      I believe that this will break on big endian systems. And I expect it
      has gone unnoticed by only being exercised on little endian systems.
      
      The approach taken by this patch is to update the callback, and it's
      caller to simply use a host byte order value.
      
      Flagged by Sparse.
      Compile tested only.
      
      Fixes: c7ab0b80 ("net: stmmac: Fallback to VLAN Perfect filtering if HASH is not available")
      Signed-off-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9dbebae
  3. Jul 23, 2024
  4. Jul 19, 2024
  5. Jul 18, 2024
  6. Jul 17, 2024
  7. Jul 16, 2024
    • Colin Ian King's avatar
      eth: fbnic: Fix spelling mistake "tiggerring" -> "triggering" · 77ae5e5b
      Colin Ian King authored
      
      There is a spelling mistake in a netdev_warn message. Fix it.
      
      Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
      Link: https://patch.msgid.link/20240716093851.1003131-1-colin.i.king@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      77ae5e5b
    • Paolo Abeni's avatar
      wifi: ath12k: fix build vs old compiler · b49991d8
      Paolo Abeni authored
      
      gcc 11.4.1-3 warns about memcpy() with overlapping pointers:
      
      drivers/net/wireless/ath/ath12k/wow.c: In function ‘ath12k_wow_convert_8023_to_80211.constprop’:
      ./include/linux/fortify-string.h:114:33: error: ‘__builtin_memcpy’ accessing 18446744073709551611 or more bytes at offsets 0 and 0 overlaps 9223372036854775799 bytes at offset -9223372036854775804 [-Werror=restrict]
        114 | #define __underlying_memcpy     __builtin_memcpy
            |                                 ^
      ./include/linux/fortify-string.h:637:9: note: in expansion of macro ‘__underlying_memcpy’
        637 |         __underlying_##op(p, q, __fortify_size);                        \
            |         ^~~~~~~~~~~~~
      ./include/linux/fortify-string.h:682:26: note: in expansion of macro ‘__fortify_memcpy_chk’
        682 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
            |                          ^~~~~~~~~~~~~~~~~~~~
      drivers/net/wireless/ath/ath12k/wow.c:190:25: note: in expansion of macro ‘memcpy’
        190 |                         memcpy(pat, eth_pat, eth_pat_len);
            |                         ^~~~~~
      ./include/linux/fortify-string.h:114:33: error: ‘__builtin_memcpy’ accessing 18446744073709551605 or more bytes at offsets 0 and 0 overlaps 9223372036854775787 bytes at offset -9223372036854775798 [-Werror=restrict]
        114 | #define __underlying_memcpy     __builtin_memcpy
            |                                 ^
      ./include/linux/fortify-string.h:637:9: note: in expansion of macro ‘__underlying_memcpy’
        637 |         __underlying_##op(p, q, __fortify_size);                        \
            |         ^~~~~~~~~~~~~
      ./include/linux/fortify-string.h:682:26: note: in expansion of macro ‘__fortify_memcpy_chk’
        682 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
            |                          ^~~~~~~~~~~~~~~~~~~~
      drivers/net/wireless/ath/ath12k/wow.c:232:25: note: in expansion of macro ‘memcpy’
        232 |                         memcpy(pat, eth_pat, eth_pat_len);
            |                         ^~~~~~
      
      The sum of size_t operands can overflow SIZE_MAX, triggering the
      warning.
      Address the issue using the suitable helper.
      
      Fixes: 4a3c212e ("wifi: ath12k: add basic WoW functionalities")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarKees Cook <kees@kernel.org>
      Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Link: https://patch.msgid.link/3175f87d7227e395b330fd88fb840c1645084ea7.1721127979.git.pabeni@redhat.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b49991d8
Loading