Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8102121imu; Tue, 4 Dec 2018 03:02:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/UM0nV/EohMdI7FWGg50JcwWro2o7xWlyw09aBXfHmsAWnlOPzE1URyCych8r6M5ZJhubw0 X-Received: by 2002:a17:902:8d8e:: with SMTP id v14mr19430559plo.133.1543921379366; Tue, 04 Dec 2018 03:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543921379; cv=none; d=google.com; s=arc-20160816; b=EipshEGIYhhGxaVbCA8q66wHp2jha+5hrdhZ7DJYAx7xfMe1uQz7tayb/Sbykxx9Aa qsFM6lVToYLBqMFzs9Xi8GhX3LrK7n1psB+hcEYfgEKyra1U/yHQNy5nSy681XlSbsL+ j+ZngABM157LjRXxsMvw00zoWRK1esfrzS4RfWNpSzhtp+n3b3fzcxGZTzK2jTMTypbV oKfiAHjEnZvkHoENxqGxypPE+YaQdMNTr5r5nqQFAL2xr6pfbH2t0sl7+8xsZEfC1+XU n77AwEKeUJVFhsF+Vm7hPx5WDmU2uNPhmwZNBKMDWKKmiDiKPNuLUhMaaH6MK7aKU5nd kIMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rj5o/5AjaI7havjKquUQc/Lb4X+QTIOa66PrBfmVapk=; b=LGmXiJ84HTTB2fi2ZJoIgie+t1rBtVpYVrynW3QHt8hJgEyePtmt1kvHxyFQbfz4p0 E2fJaXO1iOzpe4edqoFME0bz+b14WkVfZMEwUZXZK19vz84oQtd/YelHMX8Mo4j0Yqsc lFS15S3fROCDzQl092IrMnbE/v+TXd2MbySRgdmTGEt6U27Z3t75IxL0m41Uf1rUlUTp IVoqJ5TJXHJnuI2iBhYk37R39C4DgMRsbsnG4+valFLIpUWrB65eph00Nq94pdlWOq6c GeVUE6qP2hXC52tktWtL92ikLQsIQxHW9qioB/Rlfmrn9Ud2v8jG6O+u5zZ5lotUtbEn Tk5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=omlm3VGj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si17391445plm.431.2018.12.04.03.02.44; Tue, 04 Dec 2018 03:02:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=omlm3VGj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727282AbeLDLAP (ORCPT + 99 others); Tue, 4 Dec 2018 06:00:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:45422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727269AbeLDLAL (ORCPT ); Tue, 4 Dec 2018 06:00:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F29D6214DA; Tue, 4 Dec 2018 11:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921210; bh=MeofzYFr5REyrMmiKD6bf3cq0ZhKBvWaq3njKFqti3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=omlm3VGj/ILw8ZmUzaXb3SCzuekyx5OHg53GEPUJXO9YHj9Sbfi85mpBRkeMbXMQ3 HAHvSygt53IUhqKXH9SEyGMeyIz2LB80cDWpF9scSDXGj0EqzbmZl9PEQPsSFMv5x9 5EahSiO/m0tBOaaCK/wqfgAPYwRJrVPLnEta4Khk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King Subject: [PATCH 4.19 124/139] staging: most: use format specifier "%s" in snprintf Date: Tue, 4 Dec 2018 11:50:05 +0100 Message-Id: <20181204103655.816375740@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Colin Ian King commit 13c45007e0a87e912da21223599583fdea677914 upstream. Passing string ch_data_type[i].name as the format specifier is potentially hazardous because it could (although very unlikely to) have a format specifier embedded in it causing issues when parsing the non-existent arguments to these. Follow best practice by using the "%s" format string for the string. Cleans up clang warning: format string is not a string literal (potentially insecure) [-Wformat-security] Fixes: e7f2b70fd3a9 ("staging: most: replace multiple if..else with table lookup") Signed-off-by: Colin Ian King Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/most/core.c +++ b/drivers/staging/most/core.c @@ -351,7 +351,7 @@ static ssize_t set_datatype_show(struct for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) { if (c->cfg.data_type & ch_data_type[i].most_ch_data_type) - return snprintf(buf, PAGE_SIZE, ch_data_type[i].name); + return snprintf(buf, PAGE_SIZE, "%s", ch_data_type[i].name); } return snprintf(buf, PAGE_SIZE, "unconfigured\n"); }