Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1693798pxy; Thu, 6 May 2021 13:30:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDArz5US+jzd8hqmczXn5NijkBpqbT4YkO40zG5fHzlQT8ezeEq0pwl2BwZK/7gIxQB/aE X-Received: by 2002:a63:cc55:: with SMTP id q21mr6113561pgi.305.1620333026371; Thu, 06 May 2021 13:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620333026; cv=none; d=google.com; s=arc-20160816; b=OiiOJrUaV7fjAEzgL+kUGA7uFyQMPWM7lNK7YNaLLK87IidD3XswlEbjy1zkmZbVtK UdROqRg0hbhB+OtWzS1KdB/kDz8FreaUd09obpirSS1AqExpdgIMgl5kwG0fcObqHZwI gb3xQ++OLjt9bcymlixwhspwJfyalBRgzdrA78mmw7nIO6SlVRUyAk9G0DlAH5EA40W3 8UIUkVPzjhcXugW4B57k6YWW/9QYjzlaTUMSc79HV9lm+lSOLN6I3xOhCfn5PcJ1GABa sXShWtSfx4Zki+QgcFwml8pxGDbSfkDZ6jjY4DDyK5l/G7Cpwk55MA0+kxKM3GpUtTah FYog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=30CCgRPWxvchjmWLKh8S/1Eg8MBxi4LpEXBf19yEkNs=; b=0Wkn6vPTWXP2w/RuD3LIjZt9ws/zX5gV1lalN0QN7IdD9cERLvmfC9wSelmTrpxO0M LHIyd2E0mQDJ3tEdwZQZCG5IuDO/fpNwAi0UWO9+UrfP6UDaf7rxF6q5vbT3bYq3tMQ9 6SsCBGX9oAcBro7n3Wr+ahttyjE3uAESJ4T0rJ4KPlWYusc9W4T/AIhpXhEQIqhQVz/I iXbabdCGZFNjuE/EPogeABpT6usms80fAkwb1Wqdd/EZlTyo3K438gvYB2ep6By1SPOP ptyTX8yN+ys+FZ1oG3wHfzWtMzbwMr1Lsgn3yw31lUhuHAmvk3f8KZbdPNGHAVlRDwL0 sTgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YTAkjewG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si3962438pgs.191.2021.05.06.13.30.13; Thu, 06 May 2021 13:30:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YTAkjewG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbhEFTzB (ORCPT + 99 others); Thu, 6 May 2021 15:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbhEFTzA (ORCPT ); Thu, 6 May 2021 15:55:00 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A248C061574 for ; Thu, 6 May 2021 12:54:01 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 124so9517405lff.5 for ; Thu, 06 May 2021 12:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=30CCgRPWxvchjmWLKh8S/1Eg8MBxi4LpEXBf19yEkNs=; b=YTAkjewGOi8gt2P1w9sSLqLI3jPEmSoeaw8J5R7o5y2n0/novjCZG8DgFeNcJFafxS pso4Y5zjbzcLxnWTb9s7WTyQ3iVM3JMXus0vYj/qlxLIEa8yqWjfwZfsOF1dq/uAhmpi espfpwFokGkbu2llorB4ly3wSvfyMzsC7mckEyHMeFQg5yx5KTgvgYin9VgnVxss2oQy 8wYObbk/dYQXhPB2iXpcC7Mx4kou2ZiSf7WES0hOZsUq7PLnufpDl2c5ztN9Tw7jxr9a SO/89Z6jR/CRLfauuuVzNDqvqKXFuyhrakl4W0up0/oWcGeQSfkrtcTFEjXVtUHkmol9 7O5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=30CCgRPWxvchjmWLKh8S/1Eg8MBxi4LpEXBf19yEkNs=; b=H1APgr9B0vlXQE/eXaMzYHnU6BGS6m/cP1QgzgJMPQaKHlx+6WxAG0NP57XJnbIeOb 5oo11Ezj8TJOZj3Ohwt5hGkuBt4Iv5euN9m9hcpm8mlcrHvace/8Q953sd3/kQzCTHpb cN1lq1xFle75Zu6tRr3FrMP7e5p64C5KASRXMm+dxyWY4GS6Runm4IKQ+RZpxRCfjqFD 8j7eJ/bS9dw24lViKEqzdmdO4Ql3rRUApJV+6Kob5K9AiUI+ueMwshKGtmsbBiHlii6P 995t9pLN9b7v41xncoB+gGBihHAS9uTq5d2o2NUTTPWnrSmkn9TtdnQMZifsabgBqH4l d1rA== X-Gm-Message-State: AOAM531Qw+lm/64lVyOyN37mycT7s836w76Iica+z1uUDRVYU1uXQb/Q +icbB1smS4t8Je9/aFFcrpFyWVNND0T3ZLjBI4chmA== X-Received: by 2002:a05:6512:104d:: with SMTP id c13mr4167245lfb.59.1620330838982; Thu, 06 May 2021 12:53:58 -0700 (PDT) MIME-Version: 1.0 References: <20210506193726.45118-1-luca.stefani.ge1@gmail.com> In-Reply-To: <20210506193726.45118-1-luca.stefani.ge1@gmail.com> From: Todd Kjos Date: Thu, 6 May 2021 12:53:45 -0700 Message-ID: Subject: Re: [PATCH] binder: Return EFAULT if we fail BINDER_ENABLE_ONEWAY_SPAM_DETECTION To: Luca Stefani Cc: Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan , Hang Lu , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 6, 2021 at 12:37 PM Luca Stefani wrote: > > 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 Acked-by: Todd Kjos > --- > 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 >