Message ID | TY1PR01MB1692AF3E473F161BED31914696090@TY1PR01MB1692.jpnprd01.prod.outlook.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <ltsi-dev-bounces@lists.linuxfoundation.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E29C175A for <patchwork-ltsi-dev@patchwork.kernel.org>; Wed, 29 Aug 2018 12:42:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CAF72B005 for <patchwork-ltsi-dev@patchwork.kernel.org>; Wed, 29 Aug 2018 12:42:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6132B2B012; Wed, 29 Aug 2018 12:42:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0223E2B005 for <patchwork-ltsi-dev@patchwork.kernel.org>; Wed, 29 Aug 2018 12:42:22 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id F1335CF2; Wed, 29 Aug 2018 12:36:50 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CB665CC9 for <ltsi-dev@lists.linuxfoundation.org>; Wed, 29 Aug 2018 12:36:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx05.melco.co.jp (mx05.melco.co.jp [192.218.140.145]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1DE08772 for <ltsi-dev@lists.linuxfoundation.org>; Wed, 29 Aug 2018 12:36:36 +0000 (UTC) Received: from mr05.melco.co.jp (mr05 [133.141.98.165]) by mx05.melco.co.jp (Postfix) with ESMTP id C87723A326F for <ltsi-dev@lists.linuxfoundation.org>; Wed, 29 Aug 2018 21:18:09 +0900 (JST) Received: from mr05.melco.co.jp (unknown [127.0.0.1]) by mr05.imss (Postfix) with ESMTP id 420l5F5jmnzRkCl for <ltsi-dev@lists.linuxfoundation.org>; Wed, 29 Aug 2018 21:18:09 +0900 (JST) Received: from mf04_second.melco.co.jp (unknown [192.168.20.184]) by mr05.melco.co.jp (Postfix) with ESMTP id 420l5F5Pt3zRkC3 for <ltsi-dev@lists.linuxfoundation.org>; Wed, 29 Aug 2018 21:18:09 +0900 (JST) Received: from mf04.melco.co.jp (unknown [133.141.98.184]) by mf04_second.melco.co.jp (Postfix) with ESMTP id 420l5F5R4HzRkCw for <ltsi-dev@lists.linuxfoundation.org>; Wed, 29 Aug 2018 21:18:09 +0900 (JST) Received: from JPN01-TY1-obe.outbound.protection.outlook.com (unknown [23.103.139.179]) by mf04.melco.co.jp (Postfix) with ESMTP id 420l5F5HvHzRkCn for <ltsi-dev@lists.linuxfoundation.org>; Wed, 29 Aug 2018 21:18:09 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mitsubishielectricgroup.onmicrosoft.com; s=selector1-mitsubishielectricgroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XSg5qUlHHXvKzNjIxMIfNcFX8KLhPLWdik9ieGOHXus=; b=BVR3yZgHPsvF5IBlPK5XzE+aPyVwHpfHz31y4pcY/yGuMGvac1imqgkwx8R+P46GymAXa1LmaUFpn/0GWAT0w85Ckxo2XnqYNyRMC446SwePduJNEzAW7hI5Xt0xB/oqY4yTLs/7P8ygFKJRjaIrK5GQeoKad7OJgO198OFbbls= Received: from TY1PR01MB1692.jpnprd01.prod.outlook.com (52.133.160.145) by TY1PR01MB0841.jpnprd01.prod.outlook.com (10.167.159.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Wed, 29 Aug 2018 12:18:08 +0000 Received: from TY1PR01MB1692.jpnprd01.prod.outlook.com ([fe80::d04e:e6f6:c782:22fa]) by TY1PR01MB1692.jpnprd01.prod.outlook.com ([fe80::d04e:e6f6:c782:22fa%2]) with mapi id 15.20.1080.015; Wed, 29 Aug 2018 12:18:08 +0000 From: "Motai.Hirotaka@aj.MitsubishiElectric.co.jp" <Motai.Hirotaka@aj.MitsubishiElectric.co.jp> To: "ltsi-dev@lists.linuxfoundation.org" <ltsi-dev@lists.linuxfoundation.org> Thread-Topic: [LTSI-dev] [PATCH 47/54] tracing: Make sure variable string fields are NULL-terminated Thread-Index: AdQ/jQzQyazadiAWTsep5QVHJT+xcw== Date: Wed, 29 Aug 2018 12:17:12 +0000 Deferred-Delivery: Wed, 29 Aug 2018 12:15:00 +0000 Message-ID: <TY1PR01MB1692AF3E473F161BED31914696090@TY1PR01MB1692.jpnprd01.prod.outlook.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-melpop: 1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=Motai.Hirotaka@aj.MitsubishiElectric.co.jp; x-originating-ip: [153.231.200.201] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TY1PR01MB0841; 6:3Jyi7UX39F79wwvLCgcXtLwxY2atzirxzXt3CR/iW8RxkyRLNtjlfe2h02BXgBoGntQHb3SGbuOKJ7rlvO/mwteg4Js48DNoZLLkFGTeklsdlJwkISLl9Ns7nq1TcTbz0/BlvvWdjHTD/xb9wBoMSmPzawuPhQA2/6StN9QnqhkyaaRJrsQ4d4LhVF+zmatJ5QVZmlI87xgJbbjKNfiArlrp7QCY9RP7acudVveyrdfw7xwPllgS5e/r5OkXbn2ScLfI7q5MFbuEFXdtgIv+v2oH0+smc1JmWbCguxSL+yOGuv3Q0z0rf956Ri8Qv7mOt1MsiT+l9DTt5TLiADy7Fevj+Vnb7XprnHD1Kx0wPowYCpmnfnkHHfGG4YQvfcMG4OO3ZcYch4S1+b2PZYvSkIsRYPVkx5dL5n5W3azTuWFwBJ3J+zuS0jQEKRA5yyZqdQpqe3taY4bYv/AP47eHwQ==; 5:jLZ6KKhJyUnFChEnu/Ir+5LFMPVm00yIpy268WxavKDh5ovk93C2vF5j60OXVEjwEvKOwZ9G/jhobJuqnW+SWJPXbxQ2Zk/1/01/1FxfSKwHtkT0vxTyQ8b2WA102uvX3n/HB4G+6uD6sIP0mUOZkeJw0+3i30BSNjTzrSUx9bg=; 7:EvxihIj/AW0Wz4Hw9tA3AAkI6JQMlchmLaUUEUcxFuD2ztHpQ47WN4tRYZx2qcAKicyMiz986opyMOSCOwfUfbKWreRopC3tVbFsDs8zDIk0psB9pb1Dnfyxu8RlGdCwKwcnfAPoXrF/QFV96v5m/mjsFzaRiVk5yYw3Gc+soZXkxAuyyC56T/eWPkL90K4pYC8p7cKkMBwYlGM+ym3FuI5cJ4EbVaO8xhRBcsoaS6VeoV25sNLMEmct1IukKt0X x-ms-office365-filtering-correlation-id: b30611f0-7665-44c9-d945-08d60da97b3f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:TY1PR01MB0841; x-ms-traffictypediagnostic: TY1PR01MB0841: x-microsoft-antispam-prvs: <TY1PR01MB0841A8A916F3929279D4621E96090@TY1PR01MB0841.jpnprd01.prod.outlook.com> x-exchange-antispam-report-test: UriScan:(42068640409301)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:TY1PR01MB0841; BCL:0; PCL:0; RULEID:; SRVR:TY1PR01MB0841; x-forefront-prvs: 077929D941 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39850400004)(136003)(346002)(396003)(366004)(376002)(199004)(189003)(2906002)(68736007)(2501003)(97736004)(72206003)(6666003)(966005)(2351001)(478600001)(25786009)(66066001)(2900100001)(8676002)(5250100002)(81156014)(74316002)(305945005)(7736002)(81166006)(6306002)(53936002)(33656002)(9686003)(6116002)(6436002)(5640700003)(55016002)(6916009)(105586002)(86362001)(99286004)(74482002)(3846002)(7696005)(316002)(6506007)(102836004)(106356001)(186003)(1857600001)(26005)(256004)(14444005)(486006)(14454004)(8936002)(5660300001)(476003); DIR:OUT; SFP:1102; SCL:1; SRVR:TY1PR01MB0841; H:TY1PR01MB1692.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:0; MX:1; received-spf: None (protection.outlook.com: aj.MitsubishiElectric.co.jp does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0WP33Voq8lVoY0nd0uBzNAtYk349OELIX9gEnLsPLwXXDR/at2rV3kLGn+m4uo7Hpe0OvoTYiH1OzhjoMHnufpwwBHsEsLc82p7jCQ4DKhq1LznQdkj8Xw6f3+HGjKklyvacB9aWzL05GixnO9Y70PPdjbZE2P+IyiB/IjFvjTHUravXViMZ06jt43ykhMsvx2ZZyfWGji3YsIeb0bFUqhirB1v4sZZ/1F+I6UbQsVIMyy834ngn9++0z8/GiIx+nQYionijvPy2uOYEfzfKvScZ+HmI/Dnx1WlIxbv/AYQUrooPWEZKII85EhRLUrfydoOA02D6DdUQEfOG9rfz1RCh0BFnDXRNI88bhfHXDuc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aj.MitsubishiElectric.co.jp X-MS-Exchange-CrossTenant-Network-Message-Id: b30611f0-7665-44c9-d945-08d60da97b3f X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2018 12:17:22.6487 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c5a75b62-4bff-4c96-a720-6621ce9978e5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB0841 Subject: [LTSI-dev] [PATCH 47/54] tracing: Make sure variable string fields are NULL-terminated X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" <ltsi-dev.lists.linuxfoundation.org> List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/ltsi-dev>, <mailto:ltsi-dev-request@lists.linuxfoundation.org?subject=unsubscribe> List-Archive: <http://lists.linuxfoundation.org/pipermail/ltsi-dev/> List-Post: <mailto:ltsi-dev@lists.linuxfoundation.org> List-Help: <mailto:ltsi-dev-request@lists.linuxfoundation.org?subject=help> List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/ltsi-dev>, <mailto:ltsi-dev-request@lists.linuxfoundation.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
[01/54] tracing: Remove redundant unread variable ret
|
expand
|
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 6114939f..15ea11c2 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -664,17 +664,17 @@ static notrace void trace_event_raw_event_synth(void *__data, if (!entry) goto out; for (i = 0, n_u64 = 0; i < event->n_fields; i++) { if (event->fields[i]->is_string) { char *str_val = (char *)(long)var_ref_vals[var_ref_idx + i]; char *str_field = (char *)&entry->fields[n_u64]; - strncpy(str_field, str_val, STR_VAR_LEN_MAX); + strscpy(str_field, str_val, STR_VAR_LEN_MAX); n_u64 += STR_VAR_LEN_MAX / sizeof(u64); } else { entry->fields[n_u64] = var_ref_vals[var_ref_idx + i]; n_u64++; } } trace_event_buffer_commit(&fbuffer); @@ -3086,17 +3086,17 @@ static inline void __update_field_vars(struct tracing_map_elt *elt, var_val = val->fn(val, elt, rbe, rec); var_idx = var->var.idx; if (val->flags & HIST_FIELD_FL_STRING) { char *str = elt_data->field_var_str[j++]; char *val_str = (char *)(uintptr_t)var_val; - strncpy(str, val_str, STR_VAR_LEN_MAX); + strscpy(str, val_str, STR_VAR_LEN_MAX); var_val = (u64)(uintptr_t)str; } tracing_map_set_var(elt, var_idx, var_val); } } static void update_field_vars(struct hist_trigger_data *hist_data, struct tracing_map_elt *elt,