int copy_strings(int argc,char __user * __user * argv, struct linux_binprm *bprm) 
static int copy_strings(int argc, char __user * __user * argv, struct linux_binprm *bprm) 
int copy_strings(int argc,char __user * __user * argv, struct linux_binprm *bprm){	struct page *kmapped_page = NULL;	char *kaddr = NULL;	int ret;	while (argc-- > 0) {		char __user *str;		int len;		unsigned long pos;		if (get_user(str, argv+argc) ||				!(len = strnlen_user(str, bprm->p))) {			ret = -EFAULT;			goto out;		}		if (bprm->p < len)  {			ret = -E2BIG;			goto out;		}		bprm->p -= len;		/* XXX: add architecture specific overflow check here. */		pos = bprm->p;		while (len > 0) {			int i, new, err;			int offset, bytes_to_copy;			struct page *page;			offset = pos % PAGE_SIZE;			i = pos/PAGE_SIZE;			page = bprm->page[i];			new = 0;			if (!page) {				page = alloc_page(GFP_HIGHUSER);				bprm->page[i] = page;				if (!page) {					ret = -ENOMEM;					goto out;				}				new = 1;			}			if (page != kmapped_page) {				if (kmapped_page)					kunmap(kmapped_page);				kmapped_page = page;				kaddr = kmap(kmapped_page);			}			if (new && offset)				memset(kaddr, 0, offset);			bytes_to_copy = PAGE_SIZE - offset;			if (bytes_to_copy > len) {				bytes_to_copy = len;				if (new)					memset(kaddr+offset+len, 0,						PAGE_SIZE-offset-len);			}			err = copy_from_user(kaddr+offset, str, bytes_to_copy);			if (err) {				ret = -EFAULT;				goto out;			}			pos += bytes_to_copy;			str += bytes_to_copy;			len -= bytes_to_copy;		}	}	ret = 0;out:	if (kmapped_page)		kunmap(kmapped_page);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/75c96f85845a6707b0f9916cb263cb3584f7d48f/exec.c/buggy/fs/exec.c