{"id":811279,"url":"http://patchwork.ozlabs.org/api/patches/811279/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170908013615.973478-1-yhs@fb.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/projects/7/?format=json","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":"<20170908013615.973478-1-yhs@fb.com>","list_archive_url":null,"date":"2017-09-08T01:36:15","name":"[net] perf/bpf: fix a clang compilation issue","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"fbd630b98dfae1eb094cbefbfa5bd68e8cb6044c","submitter":{"id":71628,"url":"http://patchwork.ozlabs.org/api/people/71628/?format=json","name":"Yonghong Song","email":"yhs@fb.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170908013615.973478-1-yhs@fb.com/mbox/","series":[{"id":2084,"url":"http://patchwork.ozlabs.org/api/series/2084/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=2084","date":"2017-09-08T01:36:15","name":"[net] perf/bpf: fix a clang compilation issue","version":1,"mbox":"http://patchwork.ozlabs.org/series/2084/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/811279/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/811279/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>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=fb.com header.i=@fb.com header.b=\"eIInpfO2\";\n\tdkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpKfY1crWz9sBZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 11:36:21 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753183AbdIHBgS (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 7 Sep 2017 21:36:18 -0400","from mx0b-00082601.pphosted.com ([67.231.153.30]:36582 \"EHLO\n\tmx0a-00082601.pphosted.com\" rhost-flags-OK-OK-OK-FAIL)\n\tby vger.kernel.org with ESMTP id S1751456AbdIHBgR (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 7 Sep 2017 21:36:17 -0400","from pps.filterd (m0089730.ppops.net [127.0.0.1])\n\tby m0089730.ppops.net (8.16.0.21/8.16.0.21) with SMTP id\n\tv881XeBB014840\n\tfor <netdev@vger.kernel.org>; Thu, 7 Sep 2017 18:36:17 -0700","from mail.thefacebook.com ([199.201.64.23])\n\tby m0089730.ppops.net with ESMTP id 2cufg5gec4-1\n\t(version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT)\n\tfor <netdev@vger.kernel.org>; Thu, 07 Sep 2017 18:36:17 -0700","from mx-out.facebook.com (192.168.52.123) by\n\tPRN-CHUB14.TheFacebook.com (192.168.16.24) with Microsoft SMTP Server\n\tid 14.3.319.2; Thu, 7 Sep 2017 18:36:16 -0700","by devbig474.prn1.facebook.com (Postfix, from userid 128203)  id\n\t34E3246E0489; Thu,  7 Sep 2017 18:36:15 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com;\n\th=from : to : cc : subject\n\t: date : message-id : mime-version : content-type; s=facebook;\n\tbh=xBgtuJA0jzRXNTpz496i2aAUSNVid4naB1q3OCbRGTU=;\n\tb=eIInpfO29pOEaqnaAL0rzhHg31na8MNX5XxpnTGFXPicYq0slNTfoLvRh6GzER1SMd31\n\tbi8xXSGVwUTyGumkJcZ1H62lGLXoUZJRiXPjv+A/OvO0JkTm8ixKjahuZjXglJFZgTEv\n\tu6p4wt71Ht8add8iXlDXW2akaNAbxA2xYBY= ","Smtp-Origin-Hostprefix":"devbig","From":"Yonghong Song <yhs@fb.com>","Smtp-Origin-Hostname":"devbig474.prn1.facebook.com","To":"<peterz@infradead.org>, <rostedt@goodmis.org>, <ast@fb.com>,\n\t<daniel@iogearbox.net>, <ndesaulniers@google.com>,\n\t<netdev@vger.kernel.org>","CC":"<kernel-team@fb.com>","Smtp-Origin-Cluster":"prn1c29","Subject":"[PATCH net] perf/bpf: fix a clang compilation issue","Date":"Thu, 7 Sep 2017 18:36:15 -0700","Message-ID":"<20170908013615.973478-1-yhs@fb.com>","X-Mailer":"git-send-email 2.9.5","X-FB-Internal":["Safe","Safe"],"MIME-Version":"1.0","Content-Type":"text/plain","X-Proofpoint-Spam-Reason":"safe","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-08_01:, , signatures=0","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"clang does not support variable length array for structure member.\nIt has the following error during compilation:\n\nkernel/trace/trace_syscalls.c:568:17: error: fields must have a constant size:\n'variable length array in structure' extension will never be supported\n                unsigned long args[sys_data->nb_args];\n                              ^\n\nThe fix is to use a fixed array length instead.\n\nReported-by: Nick Desaulniers <ndesaulniers@google.com>\nSigned-off-by: Yonghong Song <yhs@fb.com>\n---\n include/linux/syscalls.h      | 2 ++\n kernel/trace/trace_syscalls.c | 2 +-\n 2 files changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h\nindex 88951b7..95606a2 100644\n--- a/include/linux/syscalls.h\n+++ b/include/linux/syscalls.h\n@@ -200,6 +200,8 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)\n #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)\n #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)\n \n+#define SYSCALL_DEFINE_MAXARGS\t6\n+\n #define SYSCALL_DEFINEx(x, sname, ...)\t\t\t\t\\\n \tSYSCALL_METADATA(sname, x, __VA_ARGS__)\t\t\t\\\n \t__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)\ndiff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c\nindex 9c4eef2..696afe7 100644\n--- a/kernel/trace/trace_syscalls.c\n+++ b/kernel/trace/trace_syscalls.c\n@@ -565,7 +565,7 @@ static int perf_call_bpf_enter(struct bpf_prog *prog, struct pt_regs *regs,\n \tstruct syscall_tp_t {\n \t\tunsigned long long regs;\n \t\tunsigned long syscall_nr;\n-\t\tunsigned long args[sys_data->nb_args];\n+\t\tunsigned long args[SYSCALL_DEFINE_MAXARGS];\n \t} param;\n \tint i;\n \n","prefixes":["net"]}