Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1369086yba; Tue, 2 Apr 2019 07:39:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZZfQ6jdCFSJOXPBnrrbyWW0keuGMSmuq06Jw8lDwJpxaJxt00HRjowaem7M+vdVe/gPnP X-Received: by 2002:a63:28f:: with SMTP id 137mr40897091pgc.377.1554215981680; Tue, 02 Apr 2019 07:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554215981; cv=none; d=google.com; s=arc-20160816; b=WwW+JSL6dNN1j/0JrAM/6x9DMvp47KLnjiEHBES3QRTcv8e3KwIHXGzEcXa6f99q47 cm250lagrOzMKIwyBVQ/TfPM6WoZwwRgfl1/JhQxklDHfQybm9qxtcPDesWIoTb1qfMq CZUpGgzJcpc3me+XbnNmWWXcikRy3ufDV48oJqYPFz84EWgBL4xOepYfNwxFtJZfbn2e ZbCQexCoJsElwQPtjSk2DMzrNI3kXy3oGxQuYidbHxTuUAmWW2LyoORLDhiNbtw/gwP/ sr2xtCUeizwaN0W04SGB3FyrAU8Ubtb8MuyHrpqQuYuTXAbRODZRero01xVvoLZHjKwq iauw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=J7DFmD4hk6XDuZmEzrwraEQpmCMxM4OC/YSCcVI2+3I=; b=1KUBc7Bq29Kvml0bNx78ojxOXRkn/vQam6EstMHf/yoIMJF5xPAzjECfPMlL0KiQGL 5YpEodcWH3V+47ZeeX18mcc66kCq0mGQGDDvc7HFBjFtW1pG0lz+sz51EeItCMSL7PPe p5D5wdugvGU427xn1Fj7a5SeVCEzCQ28qmnOTyiRWx9CDrtvUpZxie0ephYCQJ10IVUO mqFqy50vtgzmdy0iD+3EttBWBzbYcUmR7FUzzFcvXZzxyIWsFRZtFBlCBWpf/ct8I3n6 YAqirBdaZluq209Dkw1ebrGlNHqIafN+PtokV9lgm4xQO15Kq8Lc9vF6NB+zoHdgP5VU MnCg== ARC-Authentication-Results: i=1; mx.google.com; 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 a12si10963318pls.209.2019.04.02.07.39.25; Tue, 02 Apr 2019 07:39:41 -0700 (PDT) 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; 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 S1731501AbfDBNkJ (ORCPT + 99 others); Tue, 2 Apr 2019 09:40:09 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:42798 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728817AbfDBNkB (ORCPT ); Tue, 2 Apr 2019 09:40:01 -0400 Received: from [167.98.27.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hBJdu-0002mW-0x; Tue, 02 Apr 2019 14:39:58 +0100 Received: from ben by deadeye with local (Exim 4.92) (envelope-from ) id 1hBJdt-0004qb-7C; Tue, 02 Apr 2019 14:39:57 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Herbert Xu" , "Colin Ian King" Date: Tue, 02 Apr 2019 14:38:27 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 04/99] pcrypt: use format specifier in kobject_add In-Reply-To: X-SA-Exim-Connect-IP: 167.98.27.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.65-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Colin Ian King commit b1e3874c75ab15288f573b3532e507c37e8e7656 upstream. Passing string 'name' as the format specifier is potentially hazardous because name 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 'name'. Cleans up clang warning: crypto/pcrypt.c:397:40: warning: format string is not a string literal (potentially insecure) [-Wformat-security] Fixes: a3fb1e330dd2 ("pcrypt: Added sysfs interface to pcrypt") Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu Signed-off-by: Ben Hutchings --- crypto/pcrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c @@ -440,7 +440,7 @@ static int pcrypt_sysfs_add(struct padat int ret; pinst->kobj.kset = pcrypt_kset; - ret = kobject_add(&pinst->kobj, NULL, name); + ret = kobject_add(&pinst->kobj, NULL, "%s", name); if (!ret) kobject_uevent(&pinst->kobj, KOBJ_ADD);