Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1616164pxv; Sat, 10 Jul 2021 09:36:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylp5FnXfFiLDz+mQE1wvx8H07YMpZmZ6P+ORlRxc946EWJintj5YowYIflZS+8S2qAWnyu X-Received: by 2002:a17:907:3e9c:: with SMTP id hs28mr30552753ejc.473.1625935011093; Sat, 10 Jul 2021 09:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625935011; cv=none; d=google.com; s=arc-20160816; b=oIq9c46zo3iuk7WIdlckqoIZCTcu86ddIdQ8EdterIpoX7wQwVlCHhMU13jkDx7jPO lbStdtWSscpWfN+7DtqKMZvve60LhH5zwyeZIfkAuU7hKawxjG6WU7+Ipc4DGGL6ZUCF f2FOEZP8MtQvIwv9JRzugie2Aq3PlA1JO6BTmHiTcUDLjj7CDT1+Gy8mti408rLW3lI1 035dx3mGopZ8rn3Na6t5o/n3oAdQ2uzyYDvvEmRh32qsPOpHAtnZxc7qJiYDcyCIt6vk u5a7pr9b28+iDNIqGavKuu0HIb51zliph43vYw7+Ie1m+RZLMgz8ejWf6o2L4ocv1Odq 5qcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=pCKyPRPE/b6pbaxEj2WfHY82QaiPQRkKPIRtb5R+GfM=; b=xOQDxW1A5eWZOvMksbIdaC7bbBvokkCzGmkRf7krZQTbpHeWReFmJpHSaPmoVa8Zi5 F4RVuYGbKjSado9GnkEnyEslxuvq3Au2vFm/T6w5NW/FD6OhT8zdpjHYQInnbVBdvph2 aXTSAr/uSLw66xZZbjZuCe0jONH3ip+x2jAykDWanT1uL/hE9456FFAj4x6SrnjLrfzw Bw+gR4n97nkEKNKJ492Qq7cj5r7RxcCQX3xP5HSpKN7QT5DKPYi3H5P9R+t2NUcSniKm n0uq0L0d/hsbcvMuHgcfW+rOxrCKWFBPw+9D0gUcsAZs2DFyrdFxvWhCvJhc9YZUZ+Ft Q/Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OUbXjslt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si11518428ejj.154.2021.07.10.09.36.27; Sat, 10 Jul 2021 09:36:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OUbXjslt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbhGJQhz (ORCPT + 99 others); Sat, 10 Jul 2021 12:37:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbhGJQhz (ORCPT ); Sat, 10 Jul 2021 12:37:55 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C65C0613DD; Sat, 10 Jul 2021 09:35:08 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id l2so19149885edt.1; Sat, 10 Jul 2021 09:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=pCKyPRPE/b6pbaxEj2WfHY82QaiPQRkKPIRtb5R+GfM=; b=OUbXjslt/FjsM7He2cpBPldorMy4nk4AVD57sADfgk4do3JoewXd3DWK0J0JcFIf6K +u0PmQyY0+CLR27Lu6AcCJ7eJujIvlkDLjA9KPw6U/DyDuf3bKd2FznkQD6HkvtwECrA tSF2PbCsxADViJUWwMbxCK6LI+sGjiJ1BKmu0XnjqzkQRyP8MtOLXxyBEA3xIQo7Ee80 q4sbJNQfeY2XtDVk29BaVkbQVCSM/wbZ34vXQJaH9srLOnqNlllRrOFNmqUAfBkijXmz 5j1TkPftZs+ftHxQee24xFrNEU4u/L7EdZOq6OOlK/4+UXs9rZNG4ZbSgK+bLdFE5uOy 7MBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=pCKyPRPE/b6pbaxEj2WfHY82QaiPQRkKPIRtb5R+GfM=; b=KH+Kt9oOscEtwDFOoGRt4WlnyQCPqjTPnlPwkzWsRFdpCm7qxXO2d4SNKa8MNaZPPb LRhYRnF87ndq18ocPwRuffqOJYbYumTWXD+w7VGJL4bZZHVvuMGP/Iu3FrQzIwN50Ybv yzJGmlgMEe+9CZpG4KpToZzYB6am2cs7oyg5OjKJZn8Gwwte53fvE+nkTYhATySX0wcO sd86Ei+DIZo+Vp6CRpzHjRwCX3J9JqaNGK9GdK9IkWuaglXGvbMdfeAprzxsztwFYwiC p7loPUWdWwY4d9AZlrdVXWIYHgMP/wc5OqjNiXZCrEFP3/OCtfbQw/2TK8EFVJsBe4nd yfvQ== X-Gm-Message-State: AOAM5312LFjsM0kr8iy+P5ycB76kR84vBgSmyH5m6gUnCvBmJwL+6SUX Ff+zBTrohwQkSgOPF3g+B7MaPo2UAfg= X-Received: by 2002:a05:6402:524d:: with SMTP id t13mr54586135edd.303.1625934907294; Sat, 10 Jul 2021 09:35:07 -0700 (PDT) Received: from pc ([196.235.212.194]) by smtp.gmail.com with ESMTPSA id p26sm3914834ejn.112.2021.07.10.09.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 09:35:06 -0700 (PDT) Date: Sat, 10 Jul 2021 17:35:05 +0100 From: Salah Triki To: bp@alien8.de, mchehab@kernel.org, tony.luck@intel.com, james.morse@arm.com, rric@kernel.org Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND] edac: replace sprintf() by scnprintf() Message-ID: <20210710163505.GA689509@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace sprintf() by scnprintf() in order to avoid buffer overflows. Signed-off-by: Salah Triki --- drivers/edac/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/edac/debugfs.c b/drivers/edac/debugfs.c index 4804332d9946..c83653084aa3 100644 --- a/drivers/edac/debugfs.c +++ b/drivers/edac/debugfs.c @@ -61,7 +61,7 @@ void edac_create_debugfs_nodes(struct mem_ctl_info *mci) parent = debugfs_create_dir(mci->dev.kobj.name, edac_debugfs); for (i = 0; i < mci->n_layers; i++) { - sprintf(name, "fake_inject_%s", + scnprintf(name, sizeof(name), "fake_inject_%s", edac_layer_name[mci->layers[i].type]); debugfs_create_u8(name, S_IRUGO | S_IWUSR, parent, &mci->fake_inject_layer[i]); -- 2.25.1