From patchwork Tue Nov 26 22:02:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 3241611 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BFB43C045B for ; Tue, 26 Nov 2013 22:05:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F40FE20529 for ; Tue, 26 Nov 2013 22:05:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E61C420524 for ; Tue, 26 Nov 2013 22:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932338Ab3KZWFW (ORCPT ); Tue, 26 Nov 2013 17:05:22 -0500 Received: from smtpfb1-g21.free.fr ([212.27.42.9]:59673 "EHLO smtpfb1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932219Ab3KZWFG (ORCPT ); Tue, 26 Nov 2013 17:05:06 -0500 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by smtpfb1-g21.free.fr (Postfix) with ESMTP id 831B82D3B4 for ; Tue, 26 Nov 2013 23:05:02 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e35:2e9f:6ac0:8e70:5aff:fe2f:2d74]) by smtp4-g21.free.fr (Postfix) with ESMTP id 0ABCF4C808E; Tue, 26 Nov 2013 23:04:02 +0100 (CET) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.7/8.14.7) with ESMTP id rAQM41vq021419; Tue, 26 Nov 2013 23:04:01 +0100 Received: (from ydroneaud@localhost) by localhost.localdomain (8.14.7/8.14.7/Submit) id rAQM41Pj021418; Tue, 26 Nov 2013 23:04:01 +0100 From: Yann Droneaud To: Roland Dreier , linux-rdma@vger.kernel.org Cc: Or Gerlitz , Matan Barak , Yann Droneaud Subject: [PATCH for v3.13 5/7] IB/uverbs: check comp_mask in destroy_flow Date: Tue, 26 Nov 2013 23:02:43 +0100 Message-Id: X-Mailer: git-send-email 1.8.4.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just like the check added to create_flow in 22878dbc9173, comp_mask must be checked in destroy_flow too. Since only empty comp_mask is currently supported, any other value must be rejected. Link: http://marc.info/?i=cover.1385501822.git.ydroneaud@opteya.com Cc: Matan Barak Signed-off-by: Yann Droneaud --- drivers/infiniband/core/uverbs_cmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index d9d91c412628..f1ba441cd2ed 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2795,6 +2795,9 @@ int ib_uverbs_ex_destroy_flow(struct ib_uverbs_file *file, if (ret) return ret; + if (cmd.comp_mask) + return -EINVAL; + uobj = idr_write_uobj(&ib_uverbs_rule_idr, cmd.flow_handle, file->ucontext); if (!uobj)