From patchwork Sun Dec 15 15:15:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13908791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F4142E7716A for ; Sun, 15 Dec 2024 15:15:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3232E10E051; Sun, 15 Dec 2024 15:15:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=weissschuh.net header.i=@weissschuh.net header.b="C1SQVUIU"; dkim-atps=neutral X-Greylist: delayed 1209 seconds by postgrey-1.36 at gabe; Sun, 15 Dec 2024 15:15:32 UTC Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id C22BC10E051 for ; Sun, 15 Dec 2024 15:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1734275730; bh=l8v0K6EgV9Pof7Es2dXxC+hC3jDa2lWcOg0k1aPIngM=; h=From:Date:Subject:To:Cc:From; b=C1SQVUIUJyT6+MoeQKs0VpFs8aQPrqZsUEW8jLMWqBgMj5cwNqRFQLzIWgl47U0uh StqSBvKdrsmw4x1LaL+Z0cDts1bBUPGrcJjPwRQKMp+JIaaa4vEqwc94+yhGU0GnnP CvgqVwA98gSwADsW76RVB8r/UY1aRbmyqv9HYKQE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 15 Dec 2024 16:15:21 +0100 Subject: [PATCH] fbdev/udlfb: Remove world-writability from EDID attribute MIME-Version: 1.0 Message-Id: <20241215-udlfb-perms-v1-1-2d1f8c96b1ab@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAIjyXmcC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxNDI0NT3dKUnLQk3YLUotxi3aQks9QUI3ODtMTkNCWgjoKi1LTMCrBp0bG 1tQCtWVrdXQAAAA== X-Change-ID: 20241215-udlfb-perms-bb6ed270facf To: Bernie Thompson , Helge Deller , Greg Kroah-Hartman Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734275729; l=1213; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=l8v0K6EgV9Pof7Es2dXxC+hC3jDa2lWcOg0k1aPIngM=; b=7bTT4KHzbC+9GZPr4wRIw5/OMEXrR2T3SlEtOAfkRzjYmGDvyHWpa5VH4dS42jxKDP0D3d+Ok WbKQVF2WowxCc6VS30+DYCj81RVkYkGQo9MHVHQGjqIVHLsHkeqzGhz X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It should not be possible for every user to override the EDID. Limit it to the system administrator. Fixes: 8ef8cc4fca4a ("staging: udlfb: support for writing backup EDID to sysfs file") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh --- The EDID passed through sysfs is only used as a fallback if the hardware does not provide one. To me it still feels incorrect to have this world-writable. --- drivers/video/fbdev/udlfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 2d8308bf5b67dff50262d8a9260a50113b3628c6 change-id: 20241215-udlfb-perms-bb6ed270facf Best regards, diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 71ac9e36f67c68aa7a54dce32323047a2a9a48bf..391bdb71197549caa839d862f0ce7456dc7bf9ec 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1480,7 +1480,7 @@ static ssize_t metrics_reset_store(struct device *fbdev, static const struct bin_attribute edid_attr = { .attr.name = "edid", - .attr.mode = 0666, + .attr.mode = 0644, .size = EDID_LENGTH, .read = edid_show, .write = edid_store