All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Li Li <dualli@chromium.org>,
	dualli@google.com, corbet@lwn.net, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	donald.hunter@gmail.com, gregkh@linuxfoundation.org,
	arve@android.com, tkjos@android.com, maco@android.com,
	joel@joelfernandes.org, brauner@kernel.org, cmllamas@google.com,
	surenb@google.com, omosnace@redhat.com, shuah@kernel.org,
	arnd@arndb.de, masahiroy@kernel.org, bagasdotme@gmail.com,
	horms@kernel.org, tweek@google.com, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, netdev@vger.kernel.org,
	selinux@vger.kernel.org, hridya@google.com
Cc: oe-kbuild-all@lists.linux.dev, smoreland@google.com,
	ynaffit@google.com, kernel-team@android.com
Subject: Re: [PATCH v15 2/3] binder: report txn errors via generic netlink
Date: Fri, 28 Feb 2025 04:46:26 +0800	[thread overview]
Message-ID: <202502280430.x785GFat-lkp@intel.com> (raw)
In-Reply-To: <20250226192047.734627-3-dualli@chromium.org>

Hi Li,

kernel test robot noticed the following build errors:

[auto build test ERROR on 8433c776e1eb1371f5cd40b5fd3a61f9c7b7f3ad]

url:    https://github.com/intel-lab-lkp/linux/commits/Li-Li/lsm-selinux-Add-setup_report-permission-to-binder/20250227-032351
base:   8433c776e1eb1371f5cd40b5fd3a61f9c7b7f3ad
patch link:    https://lore.kernel.org/r/20250226192047.734627-3-dualli%40chromium.org
patch subject: [PATCH v15 2/3] binder: report txn errors via generic netlink
config: arm-randconfig-001-20250227 (https://download.01.org/0day-ci/archive/20250228/202502280430.x785GFat-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250228/202502280430.x785GFat-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502280430.x785GFat-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/android/binder.c: In function 'binder_nl_report_setup_doit':
>> drivers/android/binder.c:6479:15: error: implicit declaration of function 'security_binder_setup_report' [-Wimplicit-function-declaration]
    6479 |         ret = security_binder_setup_report(current_cred());
         |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/security_binder_setup_report +6479 drivers/android/binder.c

  6462	
  6463	/**
  6464	 * binder_nl_report_setup_doit() - netlink .doit handler
  6465	 * @skb:	the metadata struct passed from netlink driver
  6466	 * @info:	the generic netlink struct passed from netlink driver
  6467	 *
  6468	 * Implements the .doit function to process binder netlink commands.
  6469	 */
  6470	int binder_nl_report_setup_doit(struct sk_buff *skb, struct genl_info *info)
  6471	{
  6472		struct binder_context *context = NULL;
  6473		struct binder_device *device;
  6474		struct binder_proc *proc;
  6475		u32 flags, pid;
  6476		void *hdr;
  6477		int ret;
  6478	
> 6479		ret = security_binder_setup_report(current_cred());
  6480		if (ret < 0) {
  6481			NL_SET_ERR_MSG(info->extack, "Permission denied");
  6482			return ret;
  6483		}
  6484	
  6485		hlist_for_each_entry(device, &binder_devices, hlist) {
  6486			if (!nla_strcmp(info->attrs[BINDER_A_CMD_CONTEXT],
  6487					device->context.name)) {
  6488				context = &device->context;
  6489				break;
  6490			}
  6491		}
  6492	
  6493		if (!context) {
  6494			NL_SET_ERR_MSG(info->extack, "Unknown binder context");
  6495			return -EINVAL;
  6496		}
  6497	
  6498		pid = nla_get_u32(info->attrs[BINDER_A_CMD_PID]);
  6499		flags = nla_get_u32(info->attrs[BINDER_A_CMD_FLAGS]);
  6500	
  6501		if (!pid) {
  6502			/* Set the global flags for the whole binder context */
  6503			context->report_flags = flags;
  6504		} else {
  6505			/* Set the per-process flags */
  6506			proc = binder_find_proc(pid);
  6507			if (!proc) {
  6508				NL_SET_ERR_MSG_FMT(info->extack,
  6509						   "Invalid binder report pid %u",
  6510						   pid);
  6511				ret = -EINVAL;
  6512				goto err_exit;
  6513			}
  6514	
  6515			proc->report_flags = flags;
  6516		}
  6517	
  6518		skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_KERNEL);
  6519		if (!skb) {
  6520			pr_err("Failed to alloc binder netlink reply message\n");
  6521			ret = -ENOMEM;
  6522			goto err_exit;
  6523		}
  6524	
  6525		hdr = genlmsg_iput(skb, info);
  6526		if (!hdr)
  6527			goto free_skb;
  6528	
  6529		if (nla_put_string(skb, BINDER_A_CMD_CONTEXT, context->name) ||
  6530		    nla_put_u32(skb, BINDER_A_CMD_PID, pid) ||
  6531		    nla_put_u32(skb, BINDER_A_CMD_FLAGS, flags))
  6532			goto cancel_skb;
  6533	
  6534		genlmsg_end(skb, hdr);
  6535	
  6536		if (genlmsg_reply(skb, info)) {
  6537			pr_err("Failed to send binder netlink reply message\n");
  6538			ret = -EFAULT;
  6539			goto err_exit;
  6540		}
  6541	
  6542		return 0;
  6543	
  6544	cancel_skb:
  6545		pr_err("Failed to add reply attributes to binder netlink message\n");
  6546		genlmsg_cancel(skb, hdr);
  6547	free_skb:
  6548		pr_err("Free binder netlink reply message on error\n");
  6549		nlmsg_free(skb);
  6550		ret = -EMSGSIZE;
  6551	err_exit:
  6552		return ret;
  6553	}
  6554	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2025-02-27 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 19:20 [PATCH v15 0/3] binder: report txn errors via generic netlink Li Li
2025-02-26 19:20 ` [PATCH v15 1/3] lsm, selinux: Add setup_report permission to binder Li Li
2025-02-26 19:20 ` [PATCH v15 2/3] binder: report txn errors via generic netlink Li Li
2025-02-27 16:03   ` kernel test robot
2025-02-27 20:46   ` kernel test robot [this message]
2025-02-26 19:20 ` [PATCH v15 3/3] binder: generic netlink binder_features flag Li Li

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=202502280430.x785GFat-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=arve@android.com \
    --cc=bagasdotme@gmail.com \
    --cc=brauner@kernel.org \
    --cc=cmllamas@google.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dualli@chromium.org \
    --cc=dualli@google.com \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=horms@kernel.org \
    --cc=hridya@google.com \
    --cc=joel@joelfernandes.org \
    --cc=kernel-team@android.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=masahiroy@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=omosnace@redhat.com \
    --cc=pabeni@redhat.com \
    --cc=selinux@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=smoreland@google.com \
    --cc=surenb@google.com \
    --cc=tkjos@android.com \
    --cc=tweek@google.com \
    --cc=ynaffit@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.