* Re: [PATCH] execve: block Emacs binaries
[not found] <20260401131226.4011156-1-mjguzik@gmail.com>
@ 2026-04-07 3:58 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-07 3:58 UTC (permalink / raw)
To: Mateusz Guzik, linux-mm
Cc: llvm, oe-kbuild-all, linux-kernel, linux-fsdevel, Mateusz Guzik
Hi Mateusz,
kernel test robot noticed the following build errors:
[auto build test ERROR on kees/for-next/execve]
[also build test ERROR on arnd-asm-generic/master linus/master v7.0-rc6 next-20260403]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mateusz-Guzik/execve-block-Emacs-binaries/20260405-070808
base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
patch link: https://lore.kernel.org/r/20260401131226.4011156-1-mjguzik%40gmail.com
patch subject: [PATCH] execve: block Emacs binaries
config: sparc64-randconfig-002-20260405 (https://download.01.org/0day-ci/archive/20260405/202604051155.fCOdDQwL-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project c80443cd37b2e2788cba67ffa180a6331e5f0791)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260405/202604051155.fCOdDQwL-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/202604051155.fCOdDQwL-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/exec.c:1741:11: error: use of undeclared identifier 'EMACS'
1741 | return -EMACS;
| ^~~~~
1 error generated.
vim +/EMACS +1741 fs/exec.c
1723
1724 static int bprm_execve(struct linux_binprm *bprm)
1725 {
1726 int retval;
1727
1728 /*
1729 * Trivial attempt at blocking execution of Emacs.
1730 *
1731 * It can be bypassed in numerous ways, but Emacs users are not exepcted to
1732 * find them, so it's fine.
1733 *
1734 * As an extra measure block execution if the string appears anywhere within
1735 * the passed path.
1736 */
1737 if (strstr(bprm->filename, "emacs")) {
1738 /*
1739 * Disgusting!
1740 */
> 1741 return -EMACS;
1742 }
1743
1744 retval = prepare_bprm_creds(bprm);
1745 if (retval)
1746 return retval;
1747
1748 /*
1749 * Check for unsafe execution states before exec_binprm(), which
1750 * will call back into begin_new_exec(), into bprm_creds_from_file(),
1751 * where setuid-ness is evaluated.
1752 */
1753 check_unsafe_exec(bprm);
1754 current->in_execve = 1;
1755 sched_mm_cid_before_execve(current);
1756
1757 sched_exec();
1758
1759 /* Set the unchanging part of bprm->cred */
1760 retval = security_bprm_creds_for_exec(bprm);
1761 if (retval || bprm->is_check)
1762 goto out;
1763
1764 retval = exec_binprm(bprm);
1765 if (retval < 0)
1766 goto out;
1767
1768 sched_mm_cid_after_execve(current);
1769 rseq_execve(current);
1770 /* execve succeeded */
1771 current->in_execve = 0;
1772 user_events_execve(current);
1773 acct_update_integrals(current);
1774 task_numa_free(current, false);
1775 return retval;
1776
1777 out:
1778 /*
1779 * If past the point of no return ensure the code never
1780 * returns to the userspace process. Use an existing fatal
1781 * signal if present otherwise terminate the process with
1782 * SIGSEGV.
1783 */
1784 if (bprm->point_of_no_return && !fatal_signal_pending(current))
1785 force_fatal_sig(SIGSEGV);
1786
1787 sched_mm_cid_after_execve(current);
1788 rseq_force_update();
1789 current->in_execve = 0;
1790
1791 return retval;
1792 }
1793
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread