* [PATCH] RDS: Fix rds-ping inducing kernel panic
@ 2018-01-22 11:24 Kees Cook
2018-01-22 15:10 ` Leon Romanovsky
2018-01-22 17:01 ` Santosh Shilimkar
0 siblings, 2 replies; 7+ messages in thread
From: Kees Cook @ 2018-01-22 11:24 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: Honggang Li, linux-kernel, Sowmini Varadhan, Steve Beattie,
Andy Whitcroft, David S. Miller, Jay Fenlason, netdev, linux-rdma,
rds-devel
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.
I think this fix was written by Jay Fenlason <fenlason@redhat.com>,
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@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.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));
/* Do not send cong updates to IB loopback */
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] RDS: Fix rds-ping inducing kernel panic
2018-01-22 11:24 [PATCH] RDS: Fix rds-ping inducing kernel panic Kees Cook
@ 2018-01-22 15:10 ` Leon Romanovsky
2018-01-22 15:47 ` David Miller
2018-01-22 17:01 ` Santosh Shilimkar
1 sibling, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2018-01-22 15:10 UTC (permalink / raw)
To: Kees Cook
Cc: Santosh Shilimkar, Honggang Li,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Sowmini Varadhan,
Steve Beattie, Andy Whitcroft, David S. Miller, Jay Fenlason,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g
[-- 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 --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] RDS: Fix rds-ping inducing kernel panic
2018-01-22 15:10 ` Leon Romanovsky
@ 2018-01-22 15:47 ` David Miller
[not found] ` <20180122.104730.362327971778717733.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2018-01-22 15:47 UTC (permalink / raw)
To: leon
Cc: keescook, santosh.shilimkar, honli, linux-kernel,
sowmini.varadhan, sbeattie, apw, fenlason, netdev, linux-rdma,
rds-devel
From: Leon Romanovsky <leon@kernel.org>
Date: Mon, 22 Jan 2018 17:10:54 +0200
> On Mon, Jan 22, 2018 at 03:24:15AM -0800, Kees Cook wrote:
>> 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?
I completely agree that these assertions should just cause an error-out
rather than trigger a BUG().
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] RDS: Fix rds-ping inducing kernel panic
2018-01-22 11:24 [PATCH] RDS: Fix rds-ping inducing kernel panic Kees Cook
2018-01-22 15:10 ` Leon Romanovsky
@ 2018-01-22 17:01 ` Santosh Shilimkar
2018-01-22 22:17 ` Kees Cook
1 sibling, 1 reply; 7+ messages in thread
From: Santosh Shilimkar @ 2018-01-22 17:01 UTC (permalink / raw)
To: Kees Cook
Cc: Honggang Li, linux-kernel, Sowmini Varadhan, Steve Beattie,
Andy Whitcroft, David S. Miller, Jay Fenlason, netdev, linux-rdma,
rds-devel
On 1/22/2018 3:24 AM, 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.
>
Are you able to reproduce this issue on mainline kernel ?
IIRC, this sjouldn't happen anymore but if you see it, please
let me know. Will try it as well. rds-ping on self
loopback device is often tested and used as well for
monitoring services in production.
> I think this fix was written by Jay Fenlason <fenlason@redhat.com>,
> and extracted from the RedHat kernel patches here:
>
> https://oss.oracle.com/git/gitweb.cgi?p=redpatch.git;a=commitdiff;h=c7b6a0a1d8d636852be130fa15fa8be10d4704e8
>
It was part of redhat patched kernel but not carried in shipping
Oracle UEK kernels at least afaik.
> 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@redhat.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> This is what I get for researching CVE lifetimes...
Am not sure if its applicable anymore. Infact the issue with
loopback device was due to congestion update and thats been
already addressed with commit '18fc25c94: {rds: prevent BUG_ON
triggered on congestion update to loopback}'
Regards,
Santosh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] RDS: Fix rds-ping inducing kernel panic
[not found] ` <20180122.104730.362327971778717733.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2018-01-22 17:04 ` Santosh Shilimkar
0 siblings, 0 replies; 7+ messages in thread
From: Santosh Shilimkar @ 2018-01-22 17:04 UTC (permalink / raw)
To: David Miller, leon-DgEjT+Ai2ygdnm+yROfE0A
Cc: keescook-F7+t8E8rja9g9hUCZPvPmw, honli-H+wXaHxf7aLQT0dZR+AlfA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
sowmini.varadhan-QHcLZuEGTsvQT0dZR+AlfA,
sbeattie-GeWIH/nMZzLQT0dZR+AlfA, apw-Z7WLFzj8eWMS+FvcfC7Uqw,
fenlason-H+wXaHxf7aLQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
rds-devel-N0ozoZBvEnrZJqsBc5GL+g
On 1/22/2018 7:47 AM, David Miller wrote:
> From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Date: Mon, 22 Jan 2018 17:10:54 +0200
>
>> On Mon, Jan 22, 2018 at 03:24:15AM -0800, Kees Cook wrote:
>>> 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?
>
> I completely agree that these assertions should just cause an error-out
> rather than trigger a BUG().
Andy did remove bunch of them but there are still few more left overs.
Will have a look at remainder set since most of them were added during
early development and remained there. Thanks Dave/Leon.
Regards,
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] RDS: Fix rds-ping inducing kernel panic
2018-01-22 17:01 ` Santosh Shilimkar
@ 2018-01-22 22:17 ` Kees Cook
[not found] ` <CAGXu5jKhPk2MPCvYCOTbcNs7vdej5iuzJbJ9tM92QqXc7MczUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2018-01-22 22:17 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: Honggang Li, LKML, Sowmini Varadhan, Steve Beattie,
Andy Whitcroft, David S. Miller, Jay Fenlason,
Network Development, linux-rdma, rds-devel
On Tue, Jan 23, 2018 at 4:01 AM, Santosh Shilimkar
<santosh.shilimkar@oracle.com> wrote:
> On 1/22/2018 3:24 AM, 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.
>>
> Are you able to reproduce this issue on mainline kernel ?
> IIRC, this sjouldn't happen anymore but if you see it, please
> let me know. Will try it as well. rds-ping on self
> loopback device is often tested and used as well for
> monitoring services in production.
I don't have an RDS test setup, no. But it sounds like kernels without
this patch aren't seeing the problem.
> Am not sure if its applicable anymore. Infact the issue with
> loopback device was due to congestion update and thats been
> already addressed with commit '18fc25c94: {rds: prevent BUG_ON
> triggered on congestion update to loopback}'
That looks very much like it was fixed there. Thanks!
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] RDS: Fix rds-ping inducing kernel panic
[not found] ` <CAGXu5jKhPk2MPCvYCOTbcNs7vdej5iuzJbJ9tM92QqXc7MczUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-01-22 22:25 ` Santosh Shilimkar
0 siblings, 0 replies; 7+ messages in thread
From: Santosh Shilimkar @ 2018-01-22 22:25 UTC (permalink / raw)
To: Kees Cook
Cc: Honggang Li, LKML, Sowmini Varadhan, Steve Beattie,
Andy Whitcroft, David S. Miller, Jay Fenlason,
Network Development, linux-rdma, rds-devel-N0ozoZBvEnrZJqsBc5GL+g
On 1/22/2018 2:17 PM, Kees Cook wrote:
> On Tue, Jan 23, 2018 at 4:01 AM, Santosh Shilimkar
> <santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
>> On 1/22/2018 3:24 AM, 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.
>>>
>> Are you able to reproduce this issue on mainline kernel ?
>> IIRC, this sjouldn't happen anymore but if you see it, please
>> let me know. Will try it as well. rds-ping on self
>> loopback device is often tested and used as well for
>> monitoring services in production.
>
> I don't have an RDS test setup, no. But it sounds like kernels without
> this patch aren't seeing the problem.
>
Yep. Thats what I thought and hence asked.
>> Am not sure if its applicable anymore. Infact the issue with
>> loopback device was due to congestion update and thats been
>> already addressed with commit '18fc25c94: {rds: prevent BUG_ON
>> triggered on congestion update to loopback}'
>
> That looks very much like it was fixed there. Thanks!
>
Yeah. Thanks Kees !!
Regards,
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-01-22 22:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 11:24 [PATCH] RDS: Fix rds-ping inducing kernel panic Kees Cook
2018-01-22 15:10 ` Leon Romanovsky
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
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).