)]}'
{
  "commit": "a55bc4ffc06d8c965a7d6f0a01ed0ed41380df28",
  "tree": "e35165252e487f20bb061c1f8b3a63ee433405ee",
  "parents": [
    "e04c78d86a9699d136910cfc0bdcf01087e3267e"
  ],
  "author": {
    "name": "Nathan Chancellor",
    "email": "nathan@kernel.org",
    "time": "Mon Jun 09 14:13:14 2025 -0700"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Thu Jun 19 17:33:43 2025 +0200"
  },
  "message": "staging: rtl8723bs: Avoid memset() in aes_cipher() and aes_decipher()\n\nAfter commit 6f110a5e4f99 (\"Disable SLUB_TINY for build testing\"), which\ncauses CONFIG_KASAN to be enabled in allmodconfig again, arm64\nallmodconfig builds with older versions of clang (15 through 17) show an\ninstance of -Wframe-larger-than (which breaks the build with\nCONFIG_WERROR\u003dy):\n\n  drivers/staging/rtl8723bs/core/rtw_security.c:1287:5: error: stack frame size (2208) exceeds limit (2048) in \u0027rtw_aes_decrypt\u0027 [-Werror,-Wframe-larger-than]\n   1287 | u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)\n        |     ^\n\nThis comes from aes_decipher() being inlined in rtw_aes_decrypt().\nRunning the same build with CONFIG_FRAME_WARN\u003d128 shows aes_cipher()\nalso uses a decent amount of stack, just under the limit of 2048:\n\n  drivers/staging/rtl8723bs/core/rtw_security.c:864:19: warning: stack frame size (1952) exceeds limit (128) in \u0027aes_cipher\u0027 [-Wframe-larger-than]\n    864 | static signed int aes_cipher(u8 *key, uint      hdrlen,\n        |                   ^\n\n-Rpass-analysis\u003dstack-frame-layout only shows one large structure on the\nstack, which is the ctx variable inlined from aes128k128d(). A good\nnumber of the other variables come from the additional checks of\nfortified string routines, which are present in memset(), which both\naes_cipher() and aes_decipher() use to initialize some temporary\nbuffers. In this case, since the size is known at compile time, these\nadditional checks should not result in any code generation changes but\nallmodconfig has several sanitizers enabled, which may make it harder\nfor the compiler to eliminate the compile time checks and the variables\nthat come about from them.\n\nThe memset() calls are just initializing these buffers to zero, so use\n\u0027\u003d {}\u0027 instead, which is used all over the kernel and does the exact\nsame thing as memset() without the fortify checks, which drops the stack\nusage of these functions by a few hundred kilobytes.\n\n  drivers/staging/rtl8723bs/core/rtw_security.c:864:19: warning: stack frame size (1584) exceeds limit (128) in \u0027aes_cipher\u0027 [-Wframe-larger-than]\n    864 | static signed int aes_cipher(u8 *key, uint      hdrlen,\n        |                   ^\n  drivers/staging/rtl8723bs/core/rtw_security.c:1271:5: warning: stack frame size (1456) exceeds limit (128) in \u0027rtw_aes_decrypt\u0027 [-Wframe-larger-than]\n   1271 | u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)\n        |     ^\n\nCc: stable@vger.kernel.org\nFixes: 554c0a3abf21 (\"staging: Add rtl8723bs sdio wifi driver\")\nSigned-off-by: Nathan Chancellor \u003cnathan@kernel.org\u003e\nReviewed-by: Dan Carpenter \u003cdan.carpenter@linaro.org\u003e\nLink: https://lore.kernel.org/r/20250609-rtl8723bs-fix-clang-arm64-wflt-v1-1-e2accba43def@kernel.org\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1e9eff01b1aa5221f6b42f13ed2425f2794a4b21",
      "old_mode": 33188,
      "old_path": "drivers/staging/rtl8723bs/core/rtw_security.c",
      "new_id": "e9f382c280d9b0c8bd3dc5127fb89a071dfa77a2",
      "new_mode": 33188,
      "new_path": "drivers/staging/rtl8723bs/core/rtw_security.c"
    }
  ]
}
