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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202502280430.x785GFat-lkp@xxxxxxxxx/ 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