浏览代码

clk: samsung: Suppress unbinding to prevent theoretical attacks

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 <m.szyprowski@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Krzysztof Kozlowski 9 年之前
父节点
当前提交
f4f4dd0c45
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 0
      drivers/clk/samsung/clk-exynos3250.c
  2. 3 2
      drivers/clk/samsung/clk-s3c2410-dclk.c

+ 1 - 0
drivers/clk/samsung/clk-exynos3250.c

@@ -1087,6 +1087,7 @@ static const struct of_device_id exynos3250_cmu_isp_of_match[] __initconst = {
 static struct platform_driver exynos3250_cmu_isp_driver __initdata = {
 static struct platform_driver exynos3250_cmu_isp_driver __initdata = {
 	.driver = {
 	.driver = {
 		.name = "exynos3250-cmu-isp",
 		.name = "exynos3250-cmu-isp",
+		.suppress_bind_attrs = true,
 		.of_match_table = exynos3250_cmu_isp_of_match,
 		.of_match_table = exynos3250_cmu_isp_of_match,
 	},
 	},
 };
 };

+ 3 - 2
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 = {
 static struct platform_driver s3c24xx_dclk_driver = {
 	.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,
 	.probe = s3c24xx_dclk_probe,
 	.remove = s3c24xx_dclk_remove,
 	.remove = s3c24xx_dclk_remove,