lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 25 Oct 2022 03:43:22 +0800
From:   kernel test robot <lkp@...el.com>
To:     chen zhang <chenzhang@...inos.cn>, oleg@...hat.com
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        chenzhang_0901@....com, linux-kernel@...r.kernel.org,
        chen zhang <chenzhang@...inos.cn>
Subject: Re: [PATCH] ptrace: disable single step in __ptrace_unlink for
 protecting init task

Hi chen,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.1-rc2 next-20221024]
[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/chen-zhang/ptrace-disable-single-step-in-__ptrace_unlink-for-protecting-init-task/20221024-175119
patch link:    https://lore.kernel.org/r/20221024094759.11434-1-chenzhang%40kylinos.cn
patch subject: [PATCH] ptrace: disable single step in __ptrace_unlink for protecting init task
config: arm-versatile_defconfig
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/intel-lab-lkp/linux/commit/30b32cd2ca59b28cda083521c0689decf9fe6243
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review chen-zhang/ptrace-disable-single-step-in-__ptrace_unlink-for-protecting-init-task/20221024-175119
        git checkout 30b32cd2ca59b28cda083521c0689decf9fe6243
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

>> kernel/ptrace.c:134:48: error: use of undeclared identifier '_TIF_SINGLESTEP'
               unlikely(task_thread_info(child)->flags & _TIF_SINGLESTEP))
                                                         ^
   1 error generated.


vim +/_TIF_SINGLESTEP +134 kernel/ptrace.c

   125	
   126		child->parent = child->real_parent;
   127		list_del_init(&child->ptrace_entry);
   128		old_cred = child->ptracer_cred;
   129		child->ptracer_cred = NULL;
   130		put_cred(old_cred);
   131	
   132		spin_lock(&child->sighand->siglock);
   133		if (unlikely(child->signal->flags & SIGNAL_UNKILLABLE) &&
 > 134		    unlikely(task_thread_info(child)->flags & _TIF_SINGLESTEP))
   135			user_disable_single_step(child);
   136		child->ptrace = 0;
   137		/*
   138		 * Clear all pending traps and TRAPPING.  TRAPPING should be
   139		 * cleared regardless of JOBCTL_STOP_PENDING.  Do it explicitly.
   140		 */
   141		task_clear_jobctl_pending(child, JOBCTL_TRAP_MASK);
   142		task_clear_jobctl_trapping(child);
   143	
   144		/*
   145		 * Reinstate JOBCTL_STOP_PENDING if group stop is in effect and
   146		 * @child isn't dead.
   147		 */
   148		if (!(child->flags & PF_EXITING) &&
   149		    (child->signal->flags & SIGNAL_STOP_STOPPED ||
   150		     child->signal->group_stop_count)) {
   151			child->jobctl |= JOBCTL_STOP_PENDING;
   152	
   153			/*
   154			 * This is only possible if this thread was cloned by the
   155			 * traced task running in the stopped group, set the signal
   156			 * for the future reports.
   157			 * FIXME: we should change ptrace_init_task() to handle this
   158			 * case.
   159			 */
   160			if (!(child->jobctl & JOBCTL_STOP_SIGMASK))
   161				child->jobctl |= SIGSTOP;
   162		}
   163	
   164		/*
   165		 * If transition to TASK_STOPPED is pending or in TASK_TRACED, kick
   166		 * @child in the butt.  Note that @resume should be used iff @child
   167		 * is in TASK_TRACED; otherwise, we might unduly disrupt
   168		 * TASK_KILLABLE sleeps.
   169		 */
   170		if (child->jobctl & JOBCTL_STOP_PENDING || task_is_traced(child))
   171			ptrace_signal_wake_up(child, true);
   172	
   173		spin_unlock(&child->sighand->siglock);
   174	}
   175	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (82720 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ