From patchwork Tue May 17 07:26:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9109751 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E4BCB9F1C1 for ; Tue, 17 May 2016 07:26:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D065202E5 for ; Tue, 17 May 2016 07:26:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 734A320268 for ; Tue, 17 May 2016 07:26:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751101AbcEQH0b (ORCPT ); Tue, 17 May 2016 03:26:31 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:40521 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750711AbcEQH0a (ORCPT ); Tue, 17 May 2016 03:26:30 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O7B00JNN8O24150@mailout1.w1.samsung.com>; Tue, 17 May 2016 08:26:26 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-2c-573ac7a2e371 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 1C.49.05254.2A7CA375; Tue, 17 May 2016 08:26:26 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O7B00CXQ8NYO320@eusync2.samsung.com>; Tue, 17 May 2016 08:26:26 +0100 (BST) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Tomasz Figa , Michael Turquette , Stephen Boyd , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [PATCH] clk: samsung: Suppress unbinding to prevent theoretical attacks Date: Tue, 17 May 2016 09:26:14 +0200 Message-id: <1463469974-13340-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDLMWRmVeSWpSXmKPExsVy+t/xK7qLjluFG5x6LWSxccZ6VovXLwwt +h+/ZrbY9Pgaq8XHnnusFpd3zWGzmHF+H5PF2iN32S0unnK1OPymndXix5luFotVu/4wOvB4 vL/Ryu5xua+XyWPnrLvsHptWdbJ5bF5S79G3ZRWjx+dNcgHsUVw2Kak5mWWpRfp2CVwZ1xsm shS85q84+f8fewPjNt4uRg4OCQETiU8r67oYOYFMMYkL99azdTFycQgJLGWUOLevmQnCaWSS 6Fr+ngWkik3AWGLz8iVgVSICTcwSD3a1MIMkmAXSJd4ePMIIYgsLBEjs3bKbFcRmEVCV+Lr1 PFgNr4C7xNQJM9kh1slJnDw2mXUCI/cCRoZVjKKppckFxUnpuYZ6xYm5xaV56XrJ+bmbGCFh 9mUH4+JjVocYBTgYlXh4L5hYhQuxJpYVV+YeYpTgYFYS4f12CCjEm5JYWZValB9fVJqTWnyI UZqDRUmcd+6u9yFCAumJJanZqakFqUUwWSYOTqkGxsl9ekoLNJclqxbvlK352jnHT/TX25eX ts8MPPrrWdV8m0kNDCrmZ+VvMc2VfOr3R69ZPr5gyYOr7e3T8hc6Kh2ZHTDz3svsZXNsE5Y+ 1v/6kPe7VdSXr7M4t/8u6FT2Dot565fO8uGNuu70eM+MQ5wTMhgz/mXlZLXXrRSMWSP3hHPX rHu3BJRYijMSDbWYi4oTAXb3aMEvAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Although unbinding a driver requires root privileges but it still might be used theoretically in certain attacks (by triggering NULL pointer exception or memory corruption if driver does not provide proper remove callbacks or core does not handle it). Samsung clock drivers are essential for system operation so their removal is not expected. More over, the Exynos3250 ISP clock driver does not implement remove() driver callback and it is not buildable as modules. Suppress the unbind interface for Exynos3250 ISP and S3C2410 DCLK clock drivers. Suggested-by: Marek Szyprowski Cc: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Reviewed-by: Javier Martinez Canillas Acked-by: Tomasz Figa --- drivers/clk/samsung/clk-exynos3250.c | 1 + drivers/clk/samsung/clk-s3c2410-dclk.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos3250.c b/drivers/clk/samsung/clk-exynos3250.c index 16575ee874cb..dc4d493e61c2 100644 --- a/drivers/clk/samsung/clk-exynos3250.c +++ b/drivers/clk/samsung/clk-exynos3250.c @@ -1087,6 +1087,7 @@ static const struct of_device_id exynos3250_cmu_isp_of_match[] = { static struct platform_driver exynos3250_cmu_isp_driver = { .driver = { .name = "exynos3250-cmu-isp", + .suppress_bind_attrs = true, .of_match_table = exynos3250_cmu_isp_of_match, }, }; diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c b/drivers/clk/samsung/clk-s3c2410-dclk.c index ec6fb14d951c..ae9a595c72d0 100644 --- a/drivers/clk/samsung/clk-s3c2410-dclk.c +++ b/drivers/clk/samsung/clk-s3c2410-dclk.c @@ -428,8 +428,9 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_dclk_driver_ids); static struct platform_driver s3c24xx_dclk_driver = { .driver = { - .name = "s3c24xx-dclk", - .pm = &s3c24xx_dclk_pm_ops, + .name = "s3c24xx-dclk", + .pm = &s3c24xx_dclk_pm_ops, + .suppress_bind_attrs = true, }, .probe = s3c24xx_dclk_probe, .remove = s3c24xx_dclk_remove,