From patchwork Sun Nov 11 17:25:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10677743 Return-Path: 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 3EB8614E2 for ; Sun, 11 Nov 2018 17:25:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B7C929FFF for ; Sun, 11 Nov 2018 17:25:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AC902A033; Sun, 11 Nov 2018 17:25:40 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6913C29FFF for ; Sun, 11 Nov 2018 17:25:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729248AbeKLDOp (ORCPT ); Sun, 11 Nov 2018 22:14:45 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34380 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729222AbeKLDOp (ORCPT ); Sun, 11 Nov 2018 22:14:45 -0500 Received: by mail-pf1-f196.google.com with SMTP id y18-v6so3151227pfn.1 for ; Sun, 11 Nov 2018 09:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pizs6Bpk0taWCL2ZTtg/Iod0gy2ZxBmg4IJIsl6qceE=; b=HSx9jXqpdTsbONjH0zkOEhxVXN7nyUL+q1y9pkgk6M6QWH/fAqlmP7E/r2FQFBSYMq 6+p92rc07FoL6oj9Sh/oz6dMUBDE+siAf5gBttKh5RHxAKZ5b2jbbtGg3tg+Utk+LjHY D5v+dQPb3Dze8LCSsVaxlXzG11QUZid74jw34edFl3R4fpHTZjTQULiqTaXKs0aQR77i 7/uC6Mx588FuajrT2YlB5CcG/OkVZ5kjotDp3uqJJneAkD9VEnuNav87qEyHGeupLls0 vt95EFpzAdq02hJvLlpvqC6kcXLKFHyGdjgBsyY2czNlI/v0w9z0xtc4URhU8tiXl2vp wsVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pizs6Bpk0taWCL2ZTtg/Iod0gy2ZxBmg4IJIsl6qceE=; b=eQfe2Qk5mkzpD2Itm7s7CTrOuZIgJt2VxFoVDDZvEIWKPRhgDSpZcb7/Z3ne2uOuKw DZQ585kyJt0FVOndhxVsDQB1yMOyGvAx5vF6WwONvrYrwMgrFzTyEGcdOLTWX/8ukXqu R1BRrXU5OC6rgX4Gv7kULJaqPDRUha+7ADKDJmLL4+mQB4xa9y4CsUPHf0T0pVlthIJM qX2tPW/fdsu2SVs6Sq86XThtIpOcxvLzM1RzK07K7IapPvrMbaDLabyofBvdiYibRIhT buqwvbT8KEUf1upEjXIGT2IPT+KILBzJS2zrG6pwNcOhj0+DEgSmmeCJWSHteTeJ+5x8 BoLA== X-Gm-Message-State: AGRZ1gLjzdBRS64R3mQqOduR0I8MzrujqR//Cnrs+pYHFsacgaGKxLoo HayxcMABTjIoeCDG3DAgseCe8i5Q0ng= X-Google-Smtp-Source: AJdET5fu6lRQFJxo5O32k0REUfL54WkVugcHh11QGU+IlDwKROupnBUckKnY3LADodTstKtIWTUOrg== X-Received: by 2002:a63:ef0b:: with SMTP id u11-v6mr14653634pgh.283.1541957137422; Sun, 11 Nov 2018 09:25:37 -0800 (PST) Received: from vader.hsd1.wa.comcast.net ([2601:602:8b00:55d3:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id e65-v6sm16545745pfa.90.2018.11.11.09.25.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 09:25:36 -0800 (PST) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: Jens Axboe , kernel-team@fb.com, Jordan Glover Subject: [PATCH] kyber: fix wrong strlcpy() size in trace_kyber_latency() Date: Sun, 11 Nov 2018 09:25:27 -0800 Message-Id: <8233c3aac03494d50bf463787661edc523292ae4.1541957005.git.osandov@fb.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval When copying to the latency type, we should be passing LATENCY_TYPE_LEN, not DOMAIN_LEN. This isn't a problem in practice because we only pass "total" or "I/O", but let's fix it. Reported-by: Jordan Glover Signed-off-by: Omar Sandoval --- include/trace/events/kyber.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/events/kyber.h b/include/trace/events/kyber.h index a9834c37ac40..7aaa298375ad 100644 --- a/include/trace/events/kyber.h +++ b/include/trace/events/kyber.h @@ -32,7 +32,7 @@ TRACE_EVENT(kyber_latency, TP_fast_assign( __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); strlcpy(__entry->domain, domain, DOMAIN_LEN); - strlcpy(__entry->type, type, DOMAIN_LEN); + strlcpy(__entry->type, type, LATENCY_TYPE_LEN); __entry->percentile = percentile; __entry->numerator = numerator; __entry->denominator = denominator;