linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?
@ 2014-08-27  9:56 Dan Carpenter
  2014-08-27 10:09 ` Cyrill Gorcunov
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-08-27  9:56 UTC (permalink / raw)
  To: kbuild, Cyrill Gorcunov; +Cc: Linux Memory Management List, Dan Carpenter


tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d05446ae2128064a4bb8f74c84f6901ffb5c94bc
commit: 802d335c0f7f1a1867bf59814c55970a71b10413 [2131/2422] prctl: PR_SET_MM -- introduce PR_SET_MM_MAP operation

kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?

git remote add next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout 802d335c0f7f1a1867bf59814c55970a71b10413
vim +1888 kernel/sys.c

802d335c Cyrill Gorcunov 2014-08-26  1872  
802d335c Cyrill Gorcunov 2014-08-26  1873  	mm->start_code	= prctl_map.start_code;
802d335c Cyrill Gorcunov 2014-08-26  1874  	mm->end_code	= prctl_map.end_code;
802d335c Cyrill Gorcunov 2014-08-26  1875  	mm->start_data	= prctl_map.start_data;
802d335c Cyrill Gorcunov 2014-08-26  1876  	mm->end_data	= prctl_map.end_data;
802d335c Cyrill Gorcunov 2014-08-26  1877  	mm->start_brk	= prctl_map.start_brk;
802d335c Cyrill Gorcunov 2014-08-26  1878  	mm->brk		= prctl_map.brk;
802d335c Cyrill Gorcunov 2014-08-26  1879  	mm->start_stack	= prctl_map.start_stack;
802d335c Cyrill Gorcunov 2014-08-26  1880  	mm->arg_start	= prctl_map.arg_start;
802d335c Cyrill Gorcunov 2014-08-26  1881  	mm->arg_end	= prctl_map.arg_end;
802d335c Cyrill Gorcunov 2014-08-26  1882  	mm->env_start	= prctl_map.env_start;
802d335c Cyrill Gorcunov 2014-08-26  1883  	mm->env_end	= prctl_map.env_end;
802d335c Cyrill Gorcunov 2014-08-26  1884  
802d335c Cyrill Gorcunov 2014-08-26  1885  	error = 0;
802d335c Cyrill Gorcunov 2014-08-26  1886  out:
802d335c Cyrill Gorcunov 2014-08-26  1887  	up_read(&mm->mmap_sem);
802d335c Cyrill Gorcunov 2014-08-26 @1888  	return error;
802d335c Cyrill Gorcunov 2014-08-26  1889  }
802d335c Cyrill Gorcunov 2014-08-26  1890  #endif /* CONFIG_CHECKPOINT_RESTORE */
802d335c Cyrill Gorcunov 2014-08-26  1891  
028ee4be Cyrill Gorcunov 2012-01-12  1892  static int prctl_set_mm(int opt, unsigned long addr,
028ee4be Cyrill Gorcunov 2012-01-12  1893  			unsigned long arg4, unsigned long arg5)
028ee4be Cyrill Gorcunov 2012-01-12  1894  {
028ee4be Cyrill Gorcunov 2012-01-12  1895  	struct mm_struct *mm = current->mm;
fe8c7f5c Cyrill Gorcunov 2012-05-31  1896  	struct vm_area_struct *vma;

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?
  2014-08-27  9:56 [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining? Dan Carpenter
@ 2014-08-27 10:09 ` Cyrill Gorcunov
  2014-08-27 10:24   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2014-08-27 10:09 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kbuild, Linux Memory Management List

On Wed, Aug 27, 2014 at 12:56:13PM +0300, Dan Carpenter wrote:
> 
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   d05446ae2128064a4bb8f74c84f6901ffb5c94bc
> commit: 802d335c0f7f1a1867bf59814c55970a71b10413 [2131/2422] prctl: PR_SET_MM -- introduce PR_SET_MM_MAP operation
> 
> kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?
> 
> git remote add next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git remote update next
> git checkout 802d335c0f7f1a1867bf59814c55970a71b10413
> vim +1888 kernel/sys.c
> 
> 802d335c Cyrill Gorcunov 2014-08-26  1872  
> 802d335c Cyrill Gorcunov 2014-08-26  1873  	mm->start_code	= prctl_map.start_code;
> 802d335c Cyrill Gorcunov 2014-08-26  1874  	mm->end_code	= prctl_map.end_code;
> 802d335c Cyrill Gorcunov 2014-08-26  1875  	mm->start_data	= prctl_map.start_data;
> 802d335c Cyrill Gorcunov 2014-08-26  1876  	mm->end_data	= prctl_map.end_data;
> 802d335c Cyrill Gorcunov 2014-08-26  1877  	mm->start_brk	= prctl_map.start_brk;
> 802d335c Cyrill Gorcunov 2014-08-26  1878  	mm->brk		= prctl_map.brk;
> 802d335c Cyrill Gorcunov 2014-08-26  1879  	mm->start_stack	= prctl_map.start_stack;
> 802d335c Cyrill Gorcunov 2014-08-26  1880  	mm->arg_start	= prctl_map.arg_start;
> 802d335c Cyrill Gorcunov 2014-08-26  1881  	mm->arg_end	= prctl_map.arg_end;
> 802d335c Cyrill Gorcunov 2014-08-26  1882  	mm->env_start	= prctl_map.env_start;
> 802d335c Cyrill Gorcunov 2014-08-26  1883  	mm->env_end	= prctl_map.env_end;
> 802d335c Cyrill Gorcunov 2014-08-26  1884  
> 802d335c Cyrill Gorcunov 2014-08-26  1885  	error = 0;
> 802d335c Cyrill Gorcunov 2014-08-26  1886  out:
> 802d335c Cyrill Gorcunov 2014-08-26  1887  	up_read(&mm->mmap_sem);
> 802d335c Cyrill Gorcunov 2014-08-26 @1888  	return error;

Not really sure I'm follow. @error is error code either 0 (on success) or
any other if some problem happened.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?
  2014-08-27 10:09 ` Cyrill Gorcunov
@ 2014-08-27 10:24   ` Dan Carpenter
  2014-08-27 10:28     ` Cyrill Gorcunov
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-08-27 10:24 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: kbuild, Linux Memory Management List

On Wed, Aug 27, 2014 at 02:09:09PM +0400, Cyrill Gorcunov wrote:

> Not really sure I'm follow. @error is error code either 0 (on success) or
> any other if some problem happened.


It's complaining about this:

kernel/sys.c
  1846          if (prctl_map.auxv_size) {
  1847                  up_read(&mm->mmap_sem);
  1848                  memset(user_auxv, 0, sizeof(user_auxv));
  1849                  error = copy_from_user(user_auxv,
  1850                                         (const void __user *)prctl_map.auxv,
  1851                                         prctl_map.auxv_size);
  1852                  down_read(&mm->mmap_sem);
  1853                  if (error)
  1854                          goto out;
  1855          }

It should say:

			if (error) {
				error = -EFAULT;
				goto out;
			}

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?
  2014-08-27 10:24   ` Dan Carpenter
@ 2014-08-27 10:28     ` Cyrill Gorcunov
  0 siblings, 0 replies; 4+ messages in thread
From: Cyrill Gorcunov @ 2014-08-27 10:28 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kbuild, Linux Memory Management List

On Wed, Aug 27, 2014 at 01:24:39PM +0300, Dan Carpenter wrote:
> On Wed, Aug 27, 2014 at 02:09:09PM +0400, Cyrill Gorcunov wrote:
> 
> > Not really sure I'm follow. @error is error code either 0 (on success) or
> > any other if some problem happened.
> 
> 
> It's complaining about this:
> 
> kernel/sys.c
>   1846          if (prctl_map.auxv_size) {
>   1847                  up_read(&mm->mmap_sem);
>   1848                  memset(user_auxv, 0, sizeof(user_auxv));
>   1849                  error = copy_from_user(user_auxv,
>   1850                                         (const void __user *)prctl_map.auxv,
>   1851                                         prctl_map.auxv_size);
>   1852                  down_read(&mm->mmap_sem);
>   1853                  if (error)
>   1854                          goto out;
>   1855          }

Ah, thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-27 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27  9:56 [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining? Dan Carpenter
2014-08-27 10:09 ` Cyrill Gorcunov
2014-08-27 10:24   ` Dan Carpenter
2014-08-27 10:28     ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).