Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752712AbdGMSon convert rfc822-to-8bit (ORCPT ); Thu, 13 Jul 2017 14:44:43 -0400 Received: from mga03.intel.com ([134.134.136.65]:63380 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbdGMSol (ORCPT ); Thu, 13 Jul 2017 14:44:41 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,355,1496127600"; d="scan'208";a="126391303" From: "Ismail, Mustafa" To: Greg Kroah-Hartman CC: "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "stable@vger.kernel.org" , Yevgeny Kliteynik , Tziporet Koren , Alex Polak , Boris Pismenny , Leon Romanovsky , Doug Ledford Subject: RE: [PATCH 4.4 29/57] RDMA/uverbs: Check port number supplied by user verbs cmds Thread-Topic: [PATCH 4.4 29/57] RDMA/uverbs: Check port number supplied by user verbs cmds Thread-Index: AQHS++9L/iTyRkuxdUiZieB8x0MiOqJR55OQgAB/PAD//6htAA== Date: Thu, 13 Jul 2017 18:44:38 +0000 Message-ID: <5C5647B5F4794941BAAC07CF28785CBC33E4EC25@fmsmsx101.amr.corp.intel.com> References: <20170713153957.515045341@linuxfoundation.org> <20170713153959.566717957@linuxfoundation.org> <5C5647B5F4794941BAAC07CF28785CBC33E4E81F@fmsmsx101.amr.corp.intel.com> <20170713162540.GB22870@kroah.com> In-Reply-To: <20170713162540.GB22870@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjViYTg4N2QtZTQyZC00MjFiLTliMzAtZGU5Y2EwZjMxZWJkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImhhVEZDV2J2a1Q1K21GenRPT05VYnlwalRzc0dHYlBlTFN3cGhtSTJQd3c9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.1.200.108] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1900 Lines: 47 > -----Original Message----- > From: Greg Kroah-Hartman [mailto:gregkh@linuxfoundation.org] > Sent: Thursday, July 13, 2017 11:26 AM > To: Ismail, Mustafa > Cc: linux-kernel@vger.kernel.org; linux-rdma@vger.kernel.org; > stable@vger.kernel.org; Yevgeny Kliteynik ; > Tziporet Koren ; Alex Polak > ; Boris Pismenny ; Leon > Romanovsky ; Doug Ledford > Subject: Re: [PATCH 4.4 29/57] RDMA/uverbs: Check port number supplied > by user verbs cmds > > On Thu, Jul 13, 2017 at 03:54:28PM +0000, Ismail, Mustafa wrote: > > > Subject: [PATCH 4.4 29/57] RDMA/uverbs: Check port number supplied > > > by user verbs cmds > > > > > > 4.4-stable review patch. If anyone has any objections, please let me > know. > > > > Yes, this breaks modify qp. > > See https://patchwork.kernel.org/patch/9830663/ > > I don't understand this response at all, sorry. > > What should I do about this? Is this patch alone a problem? Is there some > other patch I should apply that is in Linus's tree? Where is the problem, > only in this old release? > Applying this patch will break RDMA functionality with respect to modify_qp. Specifically this part: + if (cmd.port_num < rdma_start_port(ib_dev) || + cmd.port_num > rdma_end_port(ib_dev)) + return -EINVAL; + The cmd.port_num is only valid if (cmd->base.attr_mask & IB_QP_PORT). So the above can be fixed with: if ((cmd->base.attr_mask & IB_QP_PORT) && (cmd.port_num < rdma_start_port(ib_dev) || cmd.port_num > rdma_end_port(ib_dev))) return -EINVAL; A version of this patch is in Linus's tree and it has the same problem: commit 5ecce4c9b17bed4dc9cb58bfb10447307569b77b "RDMA/uverbs: Check port number supplied by user verbs cmds" We will be submitting a patch to fix this shortly. Mustafa