Received: by 10.223.176.46 with SMTP id f43csp3151326wra; Mon, 22 Jan 2018 09:10:54 -0800 (PST) X-Google-Smtp-Source: AH8x226kI8aMLZOaYbatQ+YkmhTzMdMwwMW67ArhqPfEH5ldGTd16u2KiF17hw2ZO8c7rhC3gwJ9 X-Received: by 10.157.90.136 with SMTP id w8mr5052277oth.380.1516641054630; Mon, 22 Jan 2018 09:10:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516641054; cv=none; d=google.com; s=arc-20160816; b=r/XxMkUP63uRxqegTyxa/FPw47H3JxZtuWVJA6YZUNrkwj5VKZUgnFwkkkvVCX0DXY cFV3ulSyMKHVg9vxAen7QxT7fOUUw4zcDKEWPmd9A2s3hYgJbL7mBQcRAUjKRSJ1aEF5 Kl8vM6asJtI38qAMmXJEDD9i86aut6e0+L9K/CFHSKXNn7VZXDkPUpMeIYGTBl+1h2cZ 81lVN0lcNcHygfKp6LzbXoxrGf/Y3I+RcSKJBRgBe5yahyqFyjvixtBFZXoZxfU3NINr F4m96pCW8fKTE3M2KfDxCAsLeaEPd7tm+vqOKSqcqsqzDlndnTMCsY5K6+dYJ8gJ5jQZ 17Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=luxVodKc+hfFneMluLDhgyimJQy7Zqr+pv6SxUKX8bw=; b=WZHlWJRSf2D648liaIqorg1kxVv7ub34a05yoOjhxdYwiJ1a3bKV9h4KQdPBqC/A8Y Imiazl7toKwjXEz/HocS1dFBTbcnZIyefBZPSjGWRlftmZr81OlX9ZhyhKOSv3sVOhzV ZzYfSNGoE+8iYPmm9Jz9UigxJxqrPOeiVM+u2mJOIxWdMu6CnimSqgzgjBmvbnuwXBK7 30PYJSV6MeLPeK0JjyAqLWWN1Ktk2kozJVgDSPwIBUGOHtEDM2dYLO/sg1xgr94C8GnI ZRcVxq3vZ3fWeKcV7O0Yn7a+nb9LFL6Ah8U2xD20o2IUDuAfzK6SC06qVU9NtLsJxTXn 3cMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=p+a0lL3r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si6038183itg.158.2018.01.22.09.10.41; Mon, 22 Jan 2018 09:10:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=p+a0lL3r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751155AbeAVRKN (ORCPT + 99 others); Mon, 22 Jan 2018 12:10:13 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:58604 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040AbeAVRKK (ORCPT ); Mon, 22 Jan 2018 12:10:10 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0MH8KBl001673; Mon, 22 Jan 2018 17:10:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=luxVodKc+hfFneMluLDhgyimJQy7Zqr+pv6SxUKX8bw=; b=p+a0lL3r9hWmd4neAKXM+71CH6HATN6RugK9Ciewt9GiAuxlRYF2IXvkhSMuAgap1zSL Lec/ZaYxaUmx+66JCX0IcXCU69ZrEP9iG28eb3OelnlaL0ZomuXVlAdgnBiaCHmX+FKg W5GgIM4KWAXex8j5Q9d1EMWYpd5PgKyAYhdHfo7PHeVo0GPEwDOl7jz044C9kBBcwgfh 2JvAd6fpjznspRPbWMV0lw4CdqIUgu6vZm6EDAZf3+mcWuR2fHRYj11Huzm77OkOcpI9 Xp2/xrkLVtHeK7XwzVp2o7kLfLZNlUG2UoGg7MAdtPNfii9YYO+rZGWZUpNjKHQD9Aga +w== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2fnkyp04gb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Jan 2018 17:10:00 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0MH4Vf0006147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 22 Jan 2018 17:04:31 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0MH4UAV001518; Mon, 22 Jan 2018 17:04:30 GMT Received: from [10.209.243.219] (/10.209.243.219) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 22 Jan 2018 09:04:30 -0800 Subject: Re: [PATCH] RDS: Fix rds-ping inducing kernel panic To: David Miller , leon@kernel.org Cc: keescook@chromium.org, honli@redhat.com, linux-kernel@vger.kernel.org, sowmini.varadhan@oracle.com, sbeattie@ubuntu.com, apw@canonical.com, fenlason@redhat.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com References: <20180122112415.GA41074@beast> <20180122151054.GJ1393@mtr-leonro.local> <20180122.104730.362327971778717733.davem@davemloft.net> From: Santosh Shilimkar Organization: Oracle Corporation Message-ID: <2cf712c8-3c1f-17de-743f-0fe26331da2e@oracle.com> Date: Mon, 22 Jan 2018 09:04:28 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180122.104730.362327971778717733.davem@davemloft.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8782 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801220240 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/2018 7:47 AM, David Miller wrote: > From: Leon Romanovsky > 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