[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220405070356.357754401@linuxfoundation.org>
Date: Tue, 5 Apr 2022 09:16:26 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Alistair Delva <adelva@...gle.com>,
Rishabh Bhatnagar <rishabhb@...eaurora.org>,
Ohad Ben-Cohen <ohad@...ery.com>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Sibi Sankar <sibis@...eaurora.org>,
linux-remoteproc@...r.kernel.org, kernel-team@...roid.com
Subject: [PATCH 5.16 0073/1017] remoteproc: Fix count check in rproc_coredump_write()
From: Alistair Delva <adelva@...gle.com>
commit f89672cc3681952f2d06314981a6b45f8b0045d1 upstream.
Check count for 0, to avoid a potential underflow. Make the check the
same as the one in rproc_recovery_write().
Fixes: 3afdc59e4390 ("remoteproc: Add coredump debugfs entry")
Signed-off-by: Alistair Delva <adelva@...gle.com>
Cc: Rishabh Bhatnagar <rishabhb@...eaurora.org>
Cc: stable@...r.kernel.org
Cc: Ohad Ben-Cohen <ohad@...ery.com>
Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: Sibi Sankar <sibis@...eaurora.org>
Cc: linux-remoteproc@...r.kernel.org
Cc: kernel-team@...roid.com
Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Link: https://lore.kernel.org/r/20220119232139.1125908-1-adelva@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/remoteproc/remoteproc_debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/remoteproc/remoteproc_debugfs.c
+++ b/drivers/remoteproc/remoteproc_debugfs.c
@@ -76,7 +76,7 @@ static ssize_t rproc_coredump_write(stru
int ret, err = 0;
char buf[20];
- if (count > sizeof(buf))
+ if (count < 1 || count > sizeof(buf))
return -EINVAL;
ret = copy_from_user(buf, user_buf, count);
Powered by blists - more mailing lists