From patchwork Tue Jul 15 21:29:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 370267 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 8282D14011D; Wed, 16 Jul 2014 07:36:18 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1X7AOW-0001Xo-7e; Tue, 15 Jul 2014 21:36:16 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1X7AIT-0006Ku-Hb for kernel-team@lists.ubuntu.com; Tue, 15 Jul 2014 21:30:01 +0000 Received: from c-67-160-228-185.hsd1.ca.comcast.net ([67.160.228.185] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1X7AIT-00074n-5q; Tue, 15 Jul 2014 21:30:01 +0000 Received: from kamal by fourier with local (Exim 4.82) (envelope-from ) id 1X7AIR-0003gN-AI; Tue, 15 Jul 2014 14:29:59 -0700 From: Kamal Mostafa To: Benjamin LaHaise Subject: [3.13.y.z extended stable] Patch "aio: fix kernel memory disclosure in io_getevents() introduced in v3.10" has been added to staging queue Date: Tue, 15 Jul 2014 14:29:59 -0700 Message-Id: <1405459799-14124-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 X-Extended-Stable: 3.13 Cc: Petr Matousek , Kamal Mostafa , kernel-team@lists.ubuntu.com, Jeff Moyer , Kent Overstreet , Mateusz Guzik X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled aio: fix kernel memory disclosure in io_getevents() introduced in v3.10 to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.13.y-queue This patch is scheduled to be released in version 3.13.11.5. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.13.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ------ From 76bef3a512f312c4db1c6c6e2779bad7a4637e35 Mon Sep 17 00:00:00 2001 From: Benjamin LaHaise Date: Tue, 24 Jun 2014 13:32:51 -0400 Subject: aio: fix kernel memory disclosure in io_getevents() introduced in v3.10 commit edfbbf388f293d70bf4b7c0bc38774d05e6f711a upstream. A kernel memory disclosure was introduced in aio_read_events_ring() in v3.10 by commit a31ad380bed817aa25f8830ad23e1a0480fef797. The changes made to aio_read_events_ring() failed to correctly limit the index into ctx->ring_pages[], allowing an attacked to cause the subsequent kmap() of an arbitrary page with a copy_to_user() to copy the contents into userspace. This vulnerability has been assigned CVE-2014-0206. Thanks to Mateusz and Petr for disclosing this issue. This patch applies to v3.12+. A separate backport is needed for 3.10/3.11. Signed-off-by: Benjamin LaHaise Cc: Mateusz Guzik Cc: Petr Matousek Cc: Kent Overstreet Cc: Jeff Moyer Signed-off-by: Kamal Mostafa --- fs/aio.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 diff --git a/fs/aio.c b/fs/aio.c index e9566f2..19e7d95 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1049,6 +1049,9 @@ static long aio_read_events_ring(struct kioctx *ctx, if (head == tail) goto out; + head %= ctx->nr_events; + tail %= ctx->nr_events; + while (ret < nr) { long avail; struct io_event *ev;