[PATCH 13/17] signal: Stop skipping current in do_group_exit & get_signal

Eric W. Biederman posted 17 patches 1 year, 7 months ago
[PATCH 13/17] signal: Stop skipping current in do_group_exit & get_signal
Posted by Eric W. Biederman 1 year, 7 months ago

Now that schedule_task_exit_locked uses JOBCTL_WILL_EXIT instead of
setting the per task SIGKILL pending bit, and JOBCTL_WILL_EXIT is
expected to be present on all tasks that are exiting, it makes no
sense to skip the current task.  So call schedule_task_exit_locked on
all threads.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 kernel/exit.c   | 6 +-----
 kernel/signal.c | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 564bf17f4589..471af82376e5 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1015,12 +1015,8 @@ do_group_exit(int exit_code)
 			sig->group_exit_code = exit_code;
 			sig->flags = SIGNAL_GROUP_EXIT;
 			sig->group_stop_count = 0;
-			__for_each_thread(sig, t) {
-				if (t == current)
-					continue;
+			__for_each_thread(sig, t)
 				schedule_task_exit_locked(t);
-			}
-			current->jobctl |= JOBCTL_WILL_EXIT;
 		}
 		spin_unlock_irq(&sighand->siglock);
 	}
diff --git a/kernel/signal.c b/kernel/signal.c
index 2b0f6d8baebb..8ae6d6550e82 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2876,12 +2876,8 @@ bool get_signal(struct ksignal *ksig)
 			signal->group_exit_code = exit_code;
 			signal->flags = SIGNAL_GROUP_EXIT;
 			signal->group_stop_count = 0;
-			__for_each_thread(signal, t) {
-				if (t == current)
-					continue;
+			__for_each_thread(signal, t)
 				schedule_task_exit_locked(t);
-			}
-			current->jobctl |= JOBCTL_WILL_EXIT;
 		}
 	fatal:
 		spin_unlock_irq(&sighand->siglock);
-- 
2.41.0
Re: [PATCH 13/17] signal: Stop skipping current in do_group_exit & get_signal
Posted by kernel test robot 1 year, 7 months ago

Hello,

kernel test robot noticed "ltp.acct02.fail" on:

commit: 6d882a729c098fb5c94db8e203a9498b79e846ca ("[PATCH 13/17] signal: Stop skipping current in do_group_exit & get_signal")
url: https://github.com/intel-lab-lkp/linux/commits/Eric-W-Biederman/signal-Make-SIGKILL-during-coredumps-an-explicit-special-case/20240619-121513
base: https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git c793a62823d1ce8f70d9cfc7803e3ea436277cda
patch link: https://lore.kernel.org/all/87iky5fu6y.fsf_-_@email.froward.int.ebiederm.org/
patch subject: [PATCH 13/17] signal: Stop skipping current in do_group_exit & get_signal

in testcase: ltp
version: ltp-x86_64-14c1f76-1_20240615
with following parameters:

	disk: 1HDD
	fs: ext4
	test: syscalls-06/acct02



compiler: gcc-13
test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)




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 <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202406281321.6026952-oliver.sang@intel.com



Running tests.......
<<<test_start>>>
tag=acct02 stime=1719055971
cmdline="acct02"
contacts=""
analysis=exit
<<<test_output>>>
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_test.c:1734: TINFO: LTP version: 20240524-41-g248223546
tst_test.c:1618: TINFO: Timeout per run is 0h 02m 30s
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
acct02.c:63: TINFO: CONFIG_BSD_PROCESS_ACCT_V3=y
acct02.c:240: TINFO: Verifying using 'struct acct_v3'
acct02.c:193: TINFO: == entry 1 ==
acct02.c:84: TINFO: ac_comm != 'acct02_helper' ('acct02')
acct02.c:133: TINFO: ac_exitcode != 32768 (0)
acct02.c:141: TINFO: ac_ppid != 3859 (3856)
acct02.c:183: TFAIL: end of file reached

HINT: You _MAY_ be missing kernel fixes:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4d9570158b626

Summary:
passed   0
failed   1
broken   0
skipped  0
warnings 0
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=3
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20240524-41-g248223546

       ###############################################################

            Done executing testcases.
            LTP Version:  20240524-41-g248223546
       ###############################################################




The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20240628/202406281321.6026952-oliver.sang@intel.com



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