]> asedeno.scripts.mit.edu Git - linux.git/commit
net/rds: remove user triggered WARN_ON in rds_sendmsg
authorshamir rabinovitch <shamir.rabinovitch@oracle.com>
Sun, 16 Dec 2018 07:01:09 +0000 (09:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2018 18:27:58 +0000 (10:27 -0800)
commitc75ab8a55ac1083c232e4407f52b0cadae6c1e0e
treee83b619d72b6c229928260b1a9644c79ba08dda5
parentea010070d0a7497253d5a6f919f6dd107450b31a
net/rds: remove user triggered WARN_ON in rds_sendmsg

per comment from Leon in rdma mailing list
https://lkml.org/lkml/2018/10/31/312 :

Please don't forget to remove user triggered WARN_ON.
https://lwn.net/Articles/769365/
"Greg Kroah-Hartman raised the problem of core kernel API code that will
use WARN_ON_ONCE() to complain about bad usage; that will not generate
the desired result if WARN_ON_ONCE() is configured to crash the machine.
He was told that the code should just call pr_warn() instead, and that
the called function should return an error in such situations. It was
generally agreed that any WARN_ON() or WARN_ON_ONCE() calls that can be
triggered from user space need to be fixed."

in addition harden rds_sendmsg to detect and overcome issues with
invalid sg count and fail the sendmsg.

Suggested-by: Leon Romanovsky <leon@kernel.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: shamir rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/message.c
net/rds/rdma.c
net/rds/rds.h
net/rds/send.c