From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Santosh Shilimkar
<santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sowmini Varadhan
<sowmini.varadhan-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
Steve Beattie <sbeattie-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>,
Andy Whitcroft <apw-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Jay Fenlason <fenlason-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org
Subject: Re: [PATCH] RDS: Fix rds-ping inducing kernel panic
Date: Mon, 22 Jan 2018 17:10:54 +0200 [thread overview]
Message-ID: <20180122151054.GJ1393@mtr-leonro.local> (raw)
In-Reply-To: <20180122112415.GA41074@beast>
[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]
On Mon, Jan 22, 2018 at 03:24:15AM -0800, Kees Cook wrote:
> As described in: https://bugzilla.redhat.com/show_bug.cgi?id=822754
>
> Attempting an RDS connection from the IP address of an IPoIB interface
> to itself causes a kernel panic due to a BUG_ON() being triggered.
> Making the test less strict allows rds-ping to work without crashing
> the machine.
>
> A local unprivileged user could use this flaw to crash the sytem.
s/sytem/system
>
> I think this fix was written by Jay Fenlason <fenlason-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
> and extracted from the RedHat kernel patches here:
>
> https://oss.oracle.com/git/gitweb.cgi?p=redpatch.git;a=commitdiff;h=c7b6a0a1d8d636852be130fa15fa8be10d4704e8
>
> This fix appears to have been carried by at least RedHat, Oracle, and
> Ubuntu for several years.
>
> CVE-2012-2372
>
> Reported-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
> This is what I get for researching CVE lifetimes...
> ---
> net/rds/ib_send.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
> index 8557a1cae041..5fbf635d17cb 100644
> --- a/net/rds/ib_send.c
> +++ b/net/rds/ib_send.c
> @@ -506,7 +506,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
> int flow_controlled = 0;
> int nr_sig = 0;
>
> - BUG_ON(off % RDS_FRAG_SIZE);
> + BUG_ON(!conn->c_loopback && off % RDS_FRAG_SIZE);
> BUG_ON(hdr_off != 0 && hdr_off != sizeof(struct rds_header));
To be honest this function full of BUG_ONs and it looks fishy to have them there.
Why don't we return EINVAL instead of crashing system?
Thanks
>
> /* Do not send cong updates to IB loopback */
> --
> 2.7.4
>
>
> --
> Kees Cook
> Pixel Security
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-01-22 15:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 11:24 [PATCH] RDS: Fix rds-ping inducing kernel panic Kees Cook
2018-01-22 15:10 ` Leon Romanovsky [this message]
2018-01-22 15:47 ` David Miller
[not found] ` <20180122.104730.362327971778717733.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2018-01-22 17:04 ` Santosh Shilimkar
2018-01-22 17:01 ` Santosh Shilimkar
2018-01-22 22:17 ` Kees Cook
[not found] ` <CAGXu5jKhPk2MPCvYCOTbcNs7vdej5iuzJbJ9tM92QqXc7MczUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-22 22:25 ` Santosh Shilimkar
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=20180122151054.GJ1393@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=apw-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=fenlason-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rds-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org \
--cc=santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=sbeattie-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org \
--cc=sowmini.varadhan-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.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).