public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [next:akpm 26/413] kernel/sys.c:1868:14: sparse: incorrect type in argument 1 (different base ty
Date: Wed, 26 Sep 2012 21:06:38 +0000	[thread overview]
Message-ID: <20120926210638.GI4587@mwanda> (raw)
In-Reply-To: <20120926155910.GA14447@localhost>

On Thu, Sep 27, 2012 at 12:19:34AM +0400, Cyrill Gorcunov wrote:
> On Wed, Sep 26, 2012 at 01:05:58PM -0700, Andrew Morton wrote:
> > > -	if (!access_ok(VERIFY_READ, addr, sizeof(addr)) || addr < mmap_min_addr)
> > > +	if (!access_ok(VERIFY_READ, (void *)addr, sizeof(addr)) || addr < mmap_min_addr)
> > >  		return -EINVAL;
> > >  
> > >  	error = -EINVAL;
> > 
> > It should have the __user tag as well, methinks?
> > 
> > --- a/kernel/sys.c~prctl-use-access_ok-instead-of-task_size-in-prctl_set_mm-fix-fix
> > +++ a/kernel/sys.c
> > @@ -1865,7 +1865,8 @@ static int prctl_set_mm(int opt, unsigne
> >  	if (opt = PR_SET_MM_EXE_FILE)
> >  		return prctl_set_mm_exe_file(mm, (unsigned int)addr);
> >  
> > -	if (!access_ok(VERIFY_READ, (void *)addr, sizeof(addr)) || addr < mmap_min_addr)
> > +	if (!access_ok(VERIFY_READ, (void __user *)addr, sizeof(addr)) ||

I would have expected sizeof(*addr) except addr is unsigned long.
To me sizeof(unsigned long) would be clearer.

regards,
dan carpenter


  parent reply	other threads:[~2012-09-26 21:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 15:59 [next:akpm 26/413] kernel/sys.c:1868:14: sparse: incorrect type in argument 1 (different base types) Fengguang Wu
2012-09-26 17:08 ` [next:akpm 26/413] kernel/sys.c:1868:14: sparse: incorrect type in argument 1 (different base ty Cyrill Gorcunov
2012-09-26 20:05 ` Andrew Morton
2012-09-26 20:19 ` Cyrill Gorcunov
2012-09-26 21:06 ` Dan Carpenter [this message]
2012-09-26 21:17 ` Andrew Morton
2012-09-26 21:43 ` Cyrill Gorcunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120926210638.GI4587@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox