From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH v1 2/2] pinctrl: Relax user input size in pinmux_select()
Date: Sun, 4 Jun 2023 16:12:15 +0300 [thread overview]
Message-ID: <20230604131215.78847-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20230604131215.78847-1-andriy.shevchenko@linux.intel.com>
This is debugfs and there is no much sense to strict the user from
sending as much data as they can. The memdup_user_nul() will anyway
fail if there is not enough memory.
Relax the user input size by removing an artificial limitaion.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/pinmux.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 2d2f3bd164d5..82c750a31952 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -677,7 +677,6 @@ void pinmux_show_setting(struct seq_file *s,
DEFINE_SHOW_ATTRIBUTE(pinmux_functions);
DEFINE_SHOW_ATTRIBUTE(pinmux_pins);
-#define PINMUX_SELECT_MAX 128
static ssize_t pinmux_select(struct file *file, const char __user *user_buf,
size_t len, loff_t *ppos)
{
@@ -689,9 +688,6 @@ static ssize_t pinmux_select(struct file *file, const char __user *user_buf,
unsigned int num_groups;
int fsel, gsel, ret;
- if (len > PINMUX_SELECT_MAX)
- return -ENOMEM;
-
buf = memdup_user_nul(user_buf, len);
if (IS_ERR(buf))
return PTR_ERR(buf);
--
2.40.0.1.gaa8946217a0b
next prev parent reply other threads:[~2023-06-04 13:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-04 13:12 [PATCH v1 1/2] pinctrl: Duplicate user memory in one go in pinmux_select() Andy Shevchenko
2023-06-04 13:12 ` Andy Shevchenko [this message]
2023-06-09 7:22 ` [PATCH v1 2/2] pinctrl: Relax user input size " Linus Walleij
[not found] ` <24d8898b-1e3b-8180-e96b-a3296de178a9@web.de>
2023-06-13 15:33 ` [PATCH " Andy Shevchenko
2023-06-13 18:17 ` Linus Walleij
2023-06-09 7:21 ` [PATCH v1 1/2] pinctrl: Duplicate user memory in one go " Linus Walleij
[not found] ` <39569326-6b1c-39b1-0eb2-f1c1d11251ec@web.de>
2023-06-13 15:35 ` [PATCH " Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230604131215.78847-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).