From patchwork Thu Jan 7 19:24:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 7979381 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-acpi@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 C2F1CBEEE5 for ; Thu, 7 Jan 2016 19:24:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01E9820138 for ; Thu, 7 Jan 2016 19:24:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24882200F4 for ; Thu, 7 Jan 2016 19:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbcAGTYc (ORCPT ); Thu, 7 Jan 2016 14:24:32 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36622 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751920AbcAGTYb (ORCPT ); Thu, 7 Jan 2016 14:24:31 -0500 Received: by mail-pa0-f54.google.com with SMTP id yy13so173221403pab.3 for ; Thu, 07 Jan 2016 11:24:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition; bh=9COWgvtpnlzDvrAmO16H/iZCRMX9H1Aahhtv8eTvl98=; b=CSITXbxMvRyxGUVycLrk+WPEFgHNvyGf0v3mIATmEobMAnPdLRnzm3fKRjHQXFGnSc Fcgn9o9nTTm6BdGZNs04laKdD6VphX++qOw4q9uYWNKB9C+BGFevEC1CLr30RXOQf1ID T+wu43LlzDBHwJDx1uotd94FJuOBZJapaJD18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition; bh=9COWgvtpnlzDvrAmO16H/iZCRMX9H1Aahhtv8eTvl98=; b=SuRssfv+VyKWVer84NrxQthEWrrwwPS/PDVXmnSnNWgVVw2k6bJZprbQ4EF99FaeFg WhSMGigrzyJ1+SQ+hqO0SvLU/hIeiYYf6uqiZUiEHrm4m3zpbF5rBlLB80BRTLrrxjsY looQqATMoDQ64tQtRzgMBYMpfBwIRs27tKWAAJjd33uRKWoxtJ4HuynVNaYl5k3/cJZR NxXw7BF4naYai/TxduFjPIVLi9pQCG2/Nqi2cCp4HYdTEZy3sO3pGLoHl2BXZpFxvcpK UM1ev1T5K98aPntC0mIeJ0uBBIMbNiVI/o5Tfl43N2re0zlednmqlP8f8fNkmY0nMsOv YkoA== X-Gm-Message-State: ALoCoQnPGleRtA/MaDjWWXd/j9a+vy4SuDVJf/IOOuTXTQmhLxcRcVKZE7QPqvuuEsDp+UesD9LYPr3gzKUx0VaIU8vJqsgweA== X-Received: by 10.66.100.198 with SMTP id fa6mr112577176pab.123.1452194670790; Thu, 07 Jan 2016 11:24:30 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id ry1sm161151256pab.30.2016.01.07.11.24.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jan 2016 11:24:30 -0800 (PST) Date: Thu, 7 Jan 2016 11:24:29 -0800 From: Kees Cook To: "Rafael J. Wysocki" Cc: Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] acpi: avoid leaking format string into kobject name Message-ID: <20160107192429.GA5113@www.outflux.net> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 The dn->name is expected to be used as a literal, so add the missing "%s". Signed-off-by: Kees Cook --- drivers/acpi/device_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 707cf6213bc2..b9afb47db7ed 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -104,7 +104,7 @@ static void acpi_expose_nondev_subnodes(struct kobject *kobj, init_completion(&dn->kobj_done); ret = kobject_init_and_add(&dn->kobj, &acpi_data_node_ktype, - kobj, dn->name); + kobj, "%s", dn->name); if (ret) acpi_handle_err(dn->handle, "Failed to expose (%d)\n", ret); else