All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@linux.intel.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch -resend] NVMe: check for integer overflow in nvme_map_user_pages()
Date: Fri, 17 May 2013 13:41:28 +0000	[thread overview]
Message-ID: <20130517134128.GT6057@linux.intel.com> (raw)
In-Reply-To: <20130513145950.GA21239@elgon.mountain>

On Mon, May 13, 2013 at 05:59:50PM +0300, Dan Carpenter wrote:
> You need to have CAP_SYS_ADMIN to trigger this overflow but it makes the
> static checkers complain so we should fix it.  The worry is that
> "length" comes from copy_from_user() so we need to check that "length +
> offset" can't overflow.
> 
> I also changed the min_t() cast to be unsigned instead of signed.  Now
> that we cap "length" to INT_MAX it doesn't make a difference, but it's a
> little easier for reviewers to know that large values aren't cast to
> negative.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied

WARNING: multiple messages have this Message-ID (diff)
From: willy@linux.intel.com (Matthew Wilcox)
Subject: [patch -resend] NVMe: check for integer overflow in nvme_map_user_pages()
Date: Fri, 17 May 2013 09:41:28 -0400	[thread overview]
Message-ID: <20130517134128.GT6057@linux.intel.com> (raw)
In-Reply-To: <20130513145950.GA21239@elgon.mountain>

On Mon, May 13, 2013@05:59:50PM +0300, Dan Carpenter wrote:
> You need to have CAP_SYS_ADMIN to trigger this overflow but it makes the
> static checkers complain so we should fix it.  The worry is that
> "length" comes from copy_from_user() so we need to check that "length +
> offset" can't overflow.
> 
> I also changed the min_t() cast to be unsigned instead of signed.  Now
> that we cap "length" to INT_MAX it doesn't make a difference, but it's a
> little easier for reviewers to know that large values aren't cast to
> negative.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

Applied

WARNING: multiple messages have this Message-ID (diff)
From: Matthew Wilcox <willy@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>,
	Keith Busch <keith.busch@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-nvme@lists.infradead.org
Subject: Re: [patch -resend] NVMe: check for integer overflow in nvme_map_user_pages()
Date: Fri, 17 May 2013 09:41:28 -0400	[thread overview]
Message-ID: <20130517134128.GT6057@linux.intel.com> (raw)
In-Reply-To: <20130513145950.GA21239@elgon.mountain>

On Mon, May 13, 2013 at 05:59:50PM +0300, Dan Carpenter wrote:
> You need to have CAP_SYS_ADMIN to trigger this overflow but it makes the
> static checkers complain so we should fix it.  The worry is that
> "length" comes from copy_from_user() so we need to check that "length +
> offset" can't overflow.
> 
> I also changed the min_t() cast to be unsigned instead of signed.  Now
> that we cap "length" to INT_MAX it doesn't make a difference, but it's a
> little easier for reviewers to know that large values aren't cast to
> negative.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied

  reply	other threads:[~2013-05-17 13:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-11 16:31 [patch] NVMe: check for integer overflow in nvme_map_user_pages() Dan Carpenter
2013-05-11 16:31 ` Dan Carpenter
2013-05-13 13:53 ` Wilcox, Matthew R
2013-05-13 14:59   ` [patch -resend] " Dan Carpenter
2013-05-13 14:59     ` Dan Carpenter
2013-05-13 14:59     ` Dan Carpenter
2013-05-17 13:41     ` Matthew Wilcox [this message]
2013-05-17 13:41       ` Matthew Wilcox
2013-05-17 13:41       ` Matthew Wilcox
2013-05-13 15:00   ` [patch] MAINTAINERS: update NVM EXPRESS DRIVER file list Dan Carpenter
2013-05-13 15:00     ` Dan Carpenter
2013-05-13 15:00     ` Dan Carpenter
2013-05-17 13:41     ` Matthew Wilcox
2013-05-17 13:41       ` Matthew Wilcox
2013-05-17 13:41       ` Matthew Wilcox

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=20130517134128.GT6057@linux.intel.com \
    --to=willy@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.