linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Stefani <luca.stefani.ge1@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: "Luca Stefani" <luca.stefani.ge1@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	"Martijn Coenen" <maco@android.com>,
	"Joel Fernandes" <joel@joelfernandes.org>,
	"Christian Brauner" <christian@brauner.io>,
	"Hridya Valsaraju" <hridya@google.com>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Hang Lu" <hangl@codeaurora.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] binder: Return EFAULT if we fail BINDER_ENABLE_ONEWAY_SPAM_DETECTION
Date: Thu,  6 May 2021 21:37:25 +0200	[thread overview]
Message-ID: <20210506193726.45118-1-luca.stefani.ge1@gmail.com> (raw)

All the other ioctl paths return EFAULT in case the
copy_from_user/copy_to_user call fails, make oneway spam detection
follow the same paradigm.

Fixes: a7dc1e6f99df ("binder: tell userspace to dump current backtrace
when detected oneway spamming")
Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 61d34e1dc59c..bcec598b89f2 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4918,7 +4918,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		uint32_t enable;
 
 		if (copy_from_user(&enable, ubuf, sizeof(enable))) {
-			ret = -EINVAL;
+			ret = -EFAULT;
 			goto err;
 		}
 		binder_inner_proc_lock(proc);
-- 
2.31.1


             reply	other threads:[~2021-05-06 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 19:37 Luca Stefani [this message]
2021-05-06 19:53 ` [PATCH] binder: Return EFAULT if we fail BINDER_ENABLE_ONEWAY_SPAM_DETECTION Todd Kjos
2021-05-07  7:15 ` Christian Brauner

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=20210506193726.45118-1-luca.stefani.ge1@gmail.com \
    --to=luca.stefani.ge1@gmail.com \
    --cc=arve@android.com \
    --cc=christian@brauner.io \
    --cc=gregkh@linuxfoundation.org \
    --cc=hangl@codeaurora.org \
    --cc=hridya@google.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=surenb@google.com \
    --cc=tkjos@android.com \
    /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).