Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp629991pxb; Tue, 5 Apr 2022 16:33:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE5gr9+HS0r4y/Rs7hsICJUDXP1qvBdYzFvx6D/G0FHRbpcbz2zV6/p4dQOTq5/+jg4MuL X-Received: by 2002:a17:90a:5983:b0:1c9:ee11:76df with SMTP id l3-20020a17090a598300b001c9ee1176dfmr6822872pji.95.1649201614257; Tue, 05 Apr 2022 16:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649201614; cv=none; d=google.com; s=arc-20160816; b=z9irg2v2tXoPg/E60aFY449mbIS9EJp9yB1DzKwiJrBaCCOLf7zRzXiq+cl2Vnb0gn 1oHf+bqWxsrJIKQ2RXgNRcFUzUJXCtF87OFBV+2ugrfAFUqEJnhnJscPg3DEOnY9dGE3 rcn+Ig+UnKI/yupyo56S8uXdBBFV7C+oWMU48rZvIVVMQI9ME40UFDxy+kMLwh5eMl8a ay9A0ZGbk+3L1tIWs5giLMxqWuftcybiyNYPGu0TWniZJcBiemfaXyBpLMi9H58EoTkk jo75KPxvuUR9xSbeEgxF6ZUn/ato4XHtPtBX0lTOe32PlSQTzpsPvfZ0kkiUMTziZVRG QU4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nz/m9JfRmitg+pCXtUkUrpvxbqXdvk+KnzPTz8xC1hQ=; b=OEMwcPwtSvdEWUIbDhWInpnPYjWi8pxjnmrU1Hwg2hujTR8y5oduwmrl686dyxi/Qx rAnY9qYuD9Z8dJS1bokDcq/bRzFhitRLGwtAC6LgJ3K+lu/mL92latqMzyp/8y4hLyHC qQRMvb1RcJPrYUxJXX5fTwhSqx2Ka4L6pljsdGFaUNE4ttei+P+hrEixXtKWGdoaAV+i 4Z7shdIIpzyOH6vpXFD59EVlXObdPyqh5RjTq9V013bdNjOAQuGujNjd3YMqjMr7Rm/K c3bZqjpr1GKeNa2vg0cTdOhX2bjzZAKxgJDTfhi/F4YK1NIMtucWb0UNT4Dn4uYWAq2G 6jYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tQPBa8xA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e22-20020a62ee16000000b004fa3a8e007fsi11553437pfi.310.2022.04.05.16.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tQPBa8xA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB12575222; Tue, 5 Apr 2022 16:17:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358805AbiDEMvr (ORCPT + 99 others); Tue, 5 Apr 2022 08:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243931AbiDEJJj (ORCPT ); Tue, 5 Apr 2022 05:09:39 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DDDA1BE98; Tue, 5 Apr 2022 01:58:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 970CCCE1C0D; Tue, 5 Apr 2022 08:58:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB20FC385A0; Tue, 5 Apr 2022 08:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149128; bh=rbe+zv7Nmz16ANnvEAT8XDOSId2te/xaaarNcwHqQZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tQPBa8xAI37p+1HIkWQuu2GCF/+tO136Kbcjs2IcuotyM/pfJ4LYTDKrIha6daUQJ n1yafiXRCR8li+ikX0QsZrKkHTykYMMCem20k5c578n23QnGj2mOudFoZw6L9VCW2O DiAJxc9We8T8EUIngzyR9EatXAeU9t3KfyAHzkcc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chengguang Xu , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.16 0605/1017] RDMA/rxe: Change variable and function argument to proper type Date: Tue, 5 Apr 2022 09:25:18 +0200 Message-Id: <20220405070412.236112619@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chengguang Xu [ Upstream commit 7e8e611d6a0ff228577b1167335ffefb0f44d5d8 ] The type of wqe length is u32 so in order to avoid overflow and shadow casting change variable and relevant function argument to proper type. Link: https://lore.kernel.org/r/20220307145047.3235675-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_req.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 0c9d2af15f3d..79ed4ca2fe2c 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -362,7 +362,7 @@ static inline int get_mtu(struct rxe_qp *qp) static struct sk_buff *init_req_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe, - int opcode, int payload, + int opcode, u32 payload, struct rxe_pkt_info *pkt) { struct rxe_dev *rxe = to_rdev(qp->ibqp.device); @@ -455,7 +455,7 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp, static int finish_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe, struct rxe_pkt_info *pkt, struct sk_buff *skb, - int paylen) + u32 paylen) { int err; @@ -503,7 +503,7 @@ static void update_wqe_state(struct rxe_qp *qp, static void update_wqe_psn(struct rxe_qp *qp, struct rxe_send_wqe *wqe, struct rxe_pkt_info *pkt, - int payload) + u32 payload) { /* number of packets left to send including current one */ int num_pkt = (wqe->dma.resid + payload + qp->mtu - 1) / qp->mtu; @@ -546,7 +546,7 @@ static void rollback_state(struct rxe_send_wqe *wqe, } static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe, - struct rxe_pkt_info *pkt, int payload) + struct rxe_pkt_info *pkt, u32 payload) { qp->req.opcode = pkt->opcode; @@ -618,7 +618,7 @@ int rxe_requester(void *arg) struct sk_buff *skb; struct rxe_send_wqe *wqe; enum rxe_hdr_mask mask; - int payload; + u32 payload; int mtu; int opcode; int ret; -- 2.34.1