lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 22 Mar 2019 16:43:56 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     stable@...r.kernel.org, Ulf Hansson <ulf.hansson@...aro.org>
Cc:     Chuanxiao Dong <chuanxiao.dong@...el.com>,
        Yuan Juntao <juntaox.yuan@...el.com>,
        Pawel Wodkowski <pawelx.wodkowski@...el.com>,
        Arnd Bergmann <arnd@...db.de>, linux-mmc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [BACKPORT 4.4.y 05/25] mmc: debugfs: Add a restriction to mmc debugfs clock setting

From: Chuanxiao Dong <chuanxiao.dong@...el.com>

Clock frequency values written to an mmc host should not be less than
the minimum clock frequency which the mmc host supports.

Signed-off-by: Yuan Juntao <juntaox.yuan@...el.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@...el.com>
Signed-off-by: Ulf Hansson <ulf.hansson@...aro.org>
(cherry picked from commit e5905ff1281f0a0f5c9863c430ac1ed5faaf5707)
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/mmc/core/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 154aced0b91b..705586dcd9fa 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, u64 val)
 	struct mmc_host *host = data;
 
 	/* We need this check due to input value is u64 */
-	if (val > host->f_max)
+	if (val != 0 && (val > host->f_max || val < host->f_min))
 		return -EINVAL;
 
 	mmc_claim_host(host);
-- 
2.20.0

Powered by blists - more mailing lists