From patchwork Mon Jun 8 22:30:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 6568501 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2EADC0020 for ; Mon, 8 Jun 2015 22:39:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32FA6203A1 for ; Mon, 8 Jun 2015 22:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 044E02044C for ; Mon, 8 Jun 2015 22:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932559AbbFHWjp (ORCPT ); Mon, 8 Jun 2015 18:39:45 -0400 Received: from smtp.outflux.net ([198.145.64.163]:51559 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbbFHWjo (ORCPT ); Mon, 8 Jun 2015 18:39:44 -0400 X-Greylist: delayed 523 seconds by postgrey-1.27 at vger.kernel.org; Mon, 08 Jun 2015 18:39:44 EDT Received: from www.outflux.net (serenity.outflux.net [10.2.0.2]) by vinyl.outflux.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t58MUr60029217; Mon, 8 Jun 2015 15:30:53 -0700 Date: Mon, 8 Jun 2015 15:30:53 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Tomi Valkeinen , Jean-Christophe Plagniol-Villard , Kees Cook , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: [PATCH] fbdev: omap2: remove potential format string leak Message-ID: <20150608223053.GA28939@www.outflux.net> MIME-Version: 1.0 Content-Disposition: inline X-MIMEDefang-Filter: outflux$Revision: 1.316 $ X-HELO: www.outflux.net X-Scanned-By: MIMEDefang 2.73 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since kobject_init_and_add takes a format string, make sure that the passed in name cannot be accidentally parsed. Signed-off-by: Kees Cook --- drivers/video/fbdev/omap2/dss/display-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/omap2/dss/display-sysfs.c b/drivers/video/fbdev/omap2/dss/display-sysfs.c index 12186557a9d4..6ad0991f8259 100644 --- a/drivers/video/fbdev/omap2/dss/display-sysfs.c +++ b/drivers/video/fbdev/omap2/dss/display-sysfs.c @@ -324,7 +324,7 @@ int display_init_sysfs(struct platform_device *pdev) for_each_dss_dev(dssdev) { r = kobject_init_and_add(&dssdev->kobj, &display_ktype, - &pdev->dev.kobj, dssdev->alias); + &pdev->dev.kobj, "%s", dssdev->alias); if (r) { DSSERR("failed to create sysfs files\n"); omap_dss_put_device(dssdev);