child->thread.gs = val & 0xffff; 
child->thread.gsindex = val & 0xffff; 
static int putreg32(struct task_struct *child, unsigned regno, u32 val){	int i;	__u64 *stack = (__u64 *)(child->thread.rsp0 - sizeof(struct pt_regs)); 	switch (regno) {	case offsetof(struct user32, regs.fs):		if (val && (val & 3) != 3) return -EIO; 		child->thread.fs = val & 0xffff; 		break;	case offsetof(struct user32, regs.gs):		if (val && (val & 3) != 3) return -EIO; 		child->thread.gs = val & 0xffff;		break;	case offsetof(struct user32, regs.ds):		if (val && (val & 3) != 3) return -EIO; 		child->thread.ds = val & 0xffff;		break;	case offsetof(struct user32, regs.es):		child->thread.es = val & 0xffff;		break;	case offsetof(struct user32, regs.ss): 		if ((val & 3) != 3) return -EIO;        	stack[offsetof(struct pt_regs, ss)/8] = val & 0xffff;		break;	case offsetof(struct user32, regs.cs): 		if ((val & 3) != 3) return -EIO;		stack[offsetof(struct pt_regs, cs)/8] = val & 0xffff;		break;	R32(ebx, rbx); 	R32(ecx, rcx);	R32(edx, rdx);	R32(edi, rdi);	R32(esi, rsi);	R32(ebp, rbp);	R32(eax, rax);	R32(orig_eax, orig_rax);	R32(eip, rip);	R32(esp, rsp);	case offsetof(struct user32, regs.eflags): {		__u64 *flags = &stack[offsetof(struct pt_regs, eflags)/8];		val &= FLAG_MASK;		*flags = val | (*flags & ~FLAG_MASK);		break;	}	case offsetof(struct user32, u_debugreg[4]): 	case offsetof(struct user32, u_debugreg[5]):		return -EIO;	case offsetof(struct user32, u_debugreg[0]):		child->thread.debugreg0 = val;		break;	case offsetof(struct user32, u_debugreg[1]):		child->thread.debugreg1 = val;		break;	case offsetof(struct user32, u_debugreg[2]):		child->thread.debugreg2 = val;		break;	case offsetof(struct user32, u_debugreg[3]):		child->thread.debugreg3 = val;		break;	case offsetof(struct user32, u_debugreg[6]):		child->thread.debugreg6 = val;		break; 	case offsetof(struct user32, u_debugreg[7]):		val &= ~DR_CONTROL_RESERVED;		/* See arch/i386/kernel/ptrace.c for an explanation of		 * this awkward check.*/		for(i=0; i<4; i++)			if ((0x5454 >> ((val >> (16 + 4*i)) & 0xf)) & 1)			       return -EIO;		child->thread.debugreg7 = val; 		break; 		    	default:		if (regno > sizeof(struct user32) || (regno & 3))			return -EIO;	       		/* Other dummy fields in the virtual user structure are ignored */ 		break; 			}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/e8ed11b9dc07df0134248542ca8e7d40751a6052/ptrace32.c/buggy/arch/x86_64/ia32/ptrace32.c