spin_lock_irq(&current->sighand->siglock); current->signal->flags = SIGNAL_GROUP_EXIT; current->signal->group_exit_code = exit_code; spin_unlock_irq(&current->sighand->siglock); 
int do_coredump(long signr, int exit_code, struct pt_regs * regs){	char corename[CORENAME_MAX_SIZE + 1];	struct mm_struct *mm = current->mm;	struct linux_binfmt * binfmt;	struct inode * inode;	struct file * file;	int retval = 0;	int fsuid = current->fsuid;	int flag = 0;	binfmt = current->binfmt;	if (!binfmt || !binfmt->core_dump)		goto fail;	down_write(&mm->mmap_sem);	if (!mm->dumpable) {		up_write(&mm->mmap_sem);		goto fail;	}	/*	 *	We cannot trust fsuid as being the "true" uid of the	 *	process nor do we know its entire history. We only know it	 *	was tainted so we dump it as root in mode 2.	 */	if (mm->dumpable == 2) {	/* Setuid core dump mode */		flag = O_EXCL;		/* Stop rewrite attacks */		current->fsuid = 0;	/* Dump root private */	}	mm->dumpable = 0;	init_completion(&mm->core_done);	spin_lock_irq(&current->sighand->siglock);	current->signal->flags = SIGNAL_GROUP_EXIT;	current->signal->group_exit_code = exit_code;	spin_unlock_irq(&current->sighand->siglock);	coredump_wait(mm);	/*	 * Clear any false indication of pending signals that might	 * be seen by the filesystem code called to write the core file.	 */	current->signal->group_stop_count = 0;	clear_thread_flag(TIF_SIGPENDING);	if (current->signal->rlim[RLIMIT_CORE].rlim_cur < binfmt->min_coredump)		goto fail_unlock;	/*	 * lock_kernel() because format_corename() is controlled by sysctl, which	 * uses lock_kernel()	 */ 	lock_kernel();	format_corename(corename, core_pattern, signr);	unlock_kernel();	file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE | flag, 0600);	if (IS_ERR(file))		goto fail_unlock;	inode = file->f_dentry->d_inode;	if (inode->i_nlink > 1)		goto close_fail;	/* multiple links - don't dump */	if (d_unhashed(file->f_dentry))		goto close_fail;	if (!S_ISREG(inode->i_mode))		goto close_fail;	if (!file->f_op)		goto close_fail;	if (!file->f_op->write)		goto close_fail;	if (do_truncate(file->f_dentry, 0) != 0)		goto close_fail;	retval = binfmt->core_dump(signr, regs, file);	if (retval)		current->signal->group_exit_code |= 0x80;close_fail:	filp_close(file, NULL);fail_unlock:	current->fsuid = fsuid;	complete_all(&mm->core_done);fail:	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1291cf4163d21f1b4999d697cbf68d38e7151c28/exec.c/clean/fs/exec.c