Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/817720/?format=api
{ "id": 817720, "url": "http://patchwork.ozlabs.org/api/patches/817720/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170922212930.620249-9-arnd@arndb.de/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170922212930.620249-9-arnd@arndb.de>", "list_archive_url": null, "date": "2017-09-22T21:29:19", "name": "[v4,8/9] netlink: fix nla_put_{u8,u16,u32} for KASAN", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "28e3d7ebdb4561d77ed04f14866b349d87e4a0d2", "submitter": { "id": 30, "url": "http://patchwork.ozlabs.org/api/people/30/?format=api", "name": "Arnd Bergmann", "email": "arnd@arndb.de" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170922212930.620249-9-arnd@arndb.de/mbox/", "series": [ { "id": 4712, "url": "http://patchwork.ozlabs.org/api/series/4712/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4712", "date": "2017-09-22T21:29:16", "name": "bring back stack frame warning with KASAN", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/4712/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/817720/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/817720/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xzRYr4Nwvz9sRm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 23 Sep 2017 07:33:52 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752830AbdIVVdN (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 22 Sep 2017 17:33:13 -0400", "from mout.kundenserver.de ([212.227.126.130]:56769 \"EHLO\n\tmout.kundenserver.de\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752622AbdIVVco (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 22 Sep 2017 17:32:44 -0400", "from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de\n\t(mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id\n\t0M4Nqe-1dAAmn2q4a-00yiSw; Fri, 22 Sep 2017 23:31:17 +0200" ], "From": "Arnd Bergmann <arnd@arndb.de>", "To": "\"David S. Miller\" <davem@davemloft.net>", "Cc": "Arnd Bergmann <arnd@arndb.de>,\n\tMauro Carvalho Chehab <mchehab@kernel.org>, Jiri Pirko\n\t<jiri@resnulli.us>, Arend van Spriel <arend.vanspriel@broadcom.com>,\n\tKalle Valo <kvalo@codeaurora.org>, \n\tAndrey Ryabinin <aryabinin@virtuozzo.com>, Alexander Potapenko\n\t<glider@google.com>, Dmitry Vyukov <dvyukov@google.com>,\n\tMasahiro Yamada <yamada.masahiro@socionext.com>, \n\tMichal Marek <mmarek@suse.com>,\n\tAndrew Morton <akpm@linux-foundation.org>, Kees Cook\n\t<keescook@chromium.org>, Geert Uytterhoeven <geert@linux-m68k.org>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tlinux-media@vger.kernel.org, linux-kernel@vger.kernel.org, \n\tnetdev@vger.kernel.org, linux-wireless@vger.kernel.org, \n\tbrcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com,\n\tkasan-dev@googlegroups.com, linux-kbuild@vger.kernel.org,\n\tJakub Jelinek <jakub@gcc.gnu.org>, =?utf-8?q?Martin_Li=C5=A1ka?=\n\t<marxin@gcc.gnu.org>, stable@vger.kernel.org", "Subject": "[PATCH v4 8/9] netlink: fix nla_put_{u8,u16,u32} for KASAN", "Date": "Fri, 22 Sep 2017 23:29:19 +0200", "Message-Id": "<20170922212930.620249-9-arnd@arndb.de>", "X-Mailer": "git-send-email 2.9.0", "In-Reply-To": "<20170922212930.620249-1-arnd@arndb.de>", "References": "<20170922212930.620249-1-arnd@arndb.de>", "X-Provags-ID": "V03:K0:5fd1PTIUsekEKn7pLd/yVh+583BOgexHMgOgtoE0B0k3AZ7JFZB\n\tQeOdCMI5g7g/hlRkL+Y0YWh+oTcfYKkUE74Q+eF2vgjis7kPQRnQeM6J3IHBidP5DPIxw7U\n\tgDVEglAHPZIpuhw3Afg6VAnPTV3q47rzIwadEGv+oj5moS7tyu8t5clK9NVIH/4HciFa1rt\n\t51nJ76jGOOMf+MaLKpnbw==", "X-UI-Out-Filterresults": "notjunk:1; V01:K0:4DaHNn7aP90=:TI5z2YahQJXcnawvZesEZ4\n\t3GZZKWXODNrwqpWadAx73qyJsAIchEtJlgNIcc1IhSAq5YRcwB+fyJANBnbV3F8SPuh2QAw2m\n\tDexrXYamIrtbn/3zbdbTiV0KVtS9ewB06MPYMwbF9km0gREPrx1iHRr3V03f4E/8eKttXYU+z\n\tOhchkVXlVIxFZ9R1AP4YMKyOr5W6YvCUyoVhPpxiDwZgHGU0+j+r+5kwfp3IEQHV7DqTCzK2i\n\tgOPE+BK2YpmIQgehISnzd3zBMWK73Ptj9GRCK/MVI345b84ESfjmRiu4VNNOgcLz+hJcl+D7c\n\tsiHtvy8yTP7CwaVvDfkYsK2u19mWFVnD9MExI+3H26B3kKH47w8lV+//1iEfForfUJ9xxxyNn\n\tWpwrhPDTwJ5ikyLv0TVwpuU2ntb4HWgazB3kxUhuyhcY34lZinb6hikl5RDmeKhV1KBu4eKeG\n\tPR0Ou6VHiXe4F7onQhMFCYjcKXsE1O5mKLOJekusbTx2pk8THlvJB6xpSoXQq7nUN4pPWtAsU\n\tTR0+Fb4Kodq3MNgLcHoRTiiq2vaJh4+qTagwwgW7312kkkZs0OEUJdUIN1xxK7wr/LswZJcwg\n\t410OiY3yvHNTyFGmYxbhUbw5VYHLMT70+rEPjOQiJlwNWco5TBGhy6Sp5BYERsg+yzHSGFAny\n\t5HJan2BQs2SNdYu4SYukC3cbxMDTf9SoQzoGE6OZS17uTYrhiaVGvkyEIuvXf7S94QLYidT7J\n\tHovbvnlI7l6owwqlln3Jw9TBMapCx/E3K0CRzA==", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "When CONFIG_KASAN is enabled, the \"--param asan-stack=1\" causes rather large\nstack frames in some functions. This goes unnoticed normally because\nCONFIG_FRAME_WARN is disabled with CONFIG_KASAN by default as of commit\n3f181b4d8652 (\"lib/Kconfig.debug: disable -Wframe-larger-than warnings with\nKASAN=y\").\n\nThe kernelci.org build bot however has the warning enabled and that led\nme to investigate it a little further, as every build produces these warnings:\n\nnet/wireless/nl80211.c:4389:1: warning: the frame size of 2240 bytes is larger than 2048 bytes [-Wframe-larger-than=]\nnet/wireless/nl80211.c:1895:1: warning: the frame size of 3776 bytes is larger than 2048 bytes [-Wframe-larger-than=]\nnet/wireless/nl80211.c:1410:1: warning: the frame size of 2208 bytes is larger than 2048 bytes [-Wframe-larger-than=]\nnet/bridge/br_netlink.c:1282:1: warning: the frame size of 2544 bytes is larger than 2048 bytes [-Wframe-larger-than=]\n\nMost of this problem is now solved in gcc-8, which can consolidate\nthe stack slots for the inline function arguments. On older compilers\nwe can add a workaround by declaring a local variable in each function\nto pass the inline function argument.\n\nCc: stable@vger.kernel.org\nLink: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\n---\n include/net/netlink.h | 73 ++++++++++++++++++++++++++++++++++++++-------------\n 1 file changed, 55 insertions(+), 18 deletions(-)", "diff": "diff --git a/include/net/netlink.h b/include/net/netlink.h\nindex e51cf5f81597..14c289393071 100644\n--- a/include/net/netlink.h\n+++ b/include/net/netlink.h\n@@ -773,7 +773,10 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,\n */\n static inline int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(u8), &value);\n+\t/* temporary variables to work around GCC PR81715 with asan-stack=1 */\n+\tu8 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(u8), &tmp);\n }\n \n /**\n@@ -784,7 +787,9 @@ static inline int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value)\n */\n static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(u16), &value);\n+\tu16 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(u16), &tmp);\n }\n \n /**\n@@ -795,7 +800,9 @@ static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value)\n */\n static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(__be16), &value);\n+\t__be16 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(__be16), &tmp);\n }\n \n /**\n@@ -806,7 +813,9 @@ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)\n */\n static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value)\n {\n-\treturn nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value);\n+\t__be16 tmp = value;\n+\n+\treturn nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, tmp);\n }\n \n /**\n@@ -817,7 +826,9 @@ static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value)\n */\n static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(__le16), &value);\n+\t__le16 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(__le16), &tmp);\n }\n \n /**\n@@ -828,7 +839,9 @@ static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value)\n */\n static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(u32), &value);\n+\tu32 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(u32), &tmp);\n }\n \n /**\n@@ -839,7 +852,9 @@ static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value)\n */\n static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(__be32), &value);\n+\t__be32 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(__be32), &tmp);\n }\n \n /**\n@@ -850,7 +865,9 @@ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)\n */\n static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value)\n {\n-\treturn nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value);\n+\t__be32 tmp = value;\n+\n+\treturn nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, tmp);\n }\n \n /**\n@@ -861,7 +878,9 @@ static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value)\n */\n static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(__le32), &value);\n+\t__le32 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(__le32), &tmp);\n }\n \n /**\n@@ -874,7 +893,9 @@ static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value)\n static inline int nla_put_u64_64bit(struct sk_buff *skb, int attrtype,\n \t\t\t\t u64 value, int padattr)\n {\n-\treturn nla_put_64bit(skb, attrtype, sizeof(u64), &value, padattr);\n+\tu64 tmp = value;\n+\n+\treturn nla_put_64bit(skb, attrtype, sizeof(u64), &tmp, padattr);\n }\n \n /**\n@@ -887,7 +908,9 @@ static inline int nla_put_u64_64bit(struct sk_buff *skb, int attrtype,\n static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value,\n \t\t\t int padattr)\n {\n-\treturn nla_put_64bit(skb, attrtype, sizeof(__be64), &value, padattr);\n+\t__be64 tmp = value;\n+\n+\treturn nla_put_64bit(skb, attrtype, sizeof(__be64), &tmp, padattr);\n }\n \n /**\n@@ -900,7 +923,9 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value,\n static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value,\n \t\t\t\tint padattr)\n {\n-\treturn nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value,\n+\t__be64 tmp = value;\n+\n+\treturn nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, tmp,\n \t\t\t padattr);\n }\n \n@@ -914,7 +939,9 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value,\n static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value,\n \t\t\t int padattr)\n {\n-\treturn nla_put_64bit(skb, attrtype, sizeof(__le64), &value, padattr);\n+\t__le64 tmp = value;\n+\n+\treturn nla_put_64bit(skb, attrtype, sizeof(__le64), &tmp, padattr);\n }\n \n /**\n@@ -925,7 +952,9 @@ static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value,\n */\n static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(s8), &value);\n+\ts8 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(s8), &tmp);\n }\n \n /**\n@@ -936,7 +965,9 @@ static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value)\n */\n static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(s16), &value);\n+\ts16 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(s16), &tmp);\n }\n \n /**\n@@ -947,7 +978,9 @@ static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value)\n */\n static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)\n {\n-\treturn nla_put(skb, attrtype, sizeof(s32), &value);\n+\ts32 tmp = value;\n+\n+\treturn nla_put(skb, attrtype, sizeof(s32), &tmp);\n }\n \n /**\n@@ -960,7 +993,9 @@ static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)\n static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value,\n \t\t\t int padattr)\n {\n-\treturn nla_put_64bit(skb, attrtype, sizeof(s64), &value, padattr);\n+\ts64 tmp = value;\n+\n+\treturn nla_put_64bit(skb, attrtype, sizeof(s64), &tmp, padattr);\n }\n \n /**\n@@ -1010,7 +1045,9 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,\n static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype,\n \t\t\t\t __be32 addr)\n {\n-\treturn nla_put_be32(skb, attrtype, addr);\n+\t__be32 tmp = addr;\n+\n+\treturn nla_put_be32(skb, attrtype, tmp);\n }\n \n /**\n", "prefixes": [ "v4", "8/9" ] }