From: Saeed Mahameed <saeedm@mellanox.com>
To: "jannh@google.com" <jannh@google.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"leon@kernel.org" <leon@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH net v2] net/mlx5: fix uaccess beyond "count" in debugfs read/write handlers
Date: Wed, 11 Jul 2018 19:10:38 +0000 [thread overview]
Message-ID: <063e455ca5fc8af9f888eb9afd03f24f4320db25.camel@mellanox.com> (raw)
In-Reply-To: <20180706201809.105152-1-jannh@google.com>
On Fri, 2018-07-06 at 22:18 +0200, Jann Horn wrote:
> In general, accessing userspace memory beyond the length of the
> supplied
> buffer in VFS read/write handlers can lead to both kernel memory
> corruption
> (via kernel_read()/kernel_write(), which can e.g. be triggered via
> sys_splice()) and privilege escalation inside userspace.
>
> In this case, the affected files are in debugfs (and should therefore
> only
> be accessible to root) and check that *pos is zero (which prevents
> the
> sys_splice() trick). Therefore, this is not a security fix, but
> rather a
> small cleanup.
>
> For the read handlers, fix it by using simple_read_from_buffer()
> instead of
> custom logic.
> For the write handler, add a check.
>
> changed in v2:
> - also fix dbg_write()
>
> Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB
> adapters")
> Signed-off-by: Jann Horn <jannh@google.com>
>
Applied to mlx5-next, Thanks!!
prev parent reply other threads:[~2018-07-11 19:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-06 20:18 [PATCH net v2] net/mlx5: fix uaccess beyond "count" in debugfs read/write handlers Jann Horn
2018-07-08 6:51 ` Leon Romanovsky
2018-07-11 19:10 ` Saeed Mahameed [this message]
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=063e455ca5fc8af9f888eb9afd03f24f4320db25.camel@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=jannh@google.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).