Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp705486ybv; Thu, 13 Feb 2020 08:04:58 -0800 (PST) X-Google-Smtp-Source: APXvYqw9YVIxRbJ/4WPIBx9JYx7S00Po2e4MYUU1It7UzVmkC+OvnbkI9pDv+VFr7u6uPZz+cAvp X-Received: by 2002:aca:f587:: with SMTP id t129mr3241254oih.143.1581609898867; Thu, 13 Feb 2020 08:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581609898; cv=none; d=google.com; s=arc-20160816; b=CHMiY6wRUiQ3uImBTZCf/tad2S6FkIimQgDpppcibo0ig3vcYMvpXhajQbQt4rFQqH oXi7v+O0KhuLuJTvlqFeK8+Ho69vFNUqmh4x9QvA/iU9kVN6REGGwXiI70kc7M0gCsGN 5Hf0tnayB/W1cpm7XivEAVcEthUsENIYCq61ce1jsvtI2nVtQB/C1hsh6oPVYXvOOjLE 1JzdzQnMjXzcjhpcnfkCZlRdJYybexEkISkJTDEVZ8VvkSRFSOD5EvhStdOFJ9xBGImB z6+TvPGeu0WGfbiIZOR10O4FlCYqIFTvl2y3S46mQrKoMeOceKvBmlXuZwbcN5TXtM6S ebNg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8W8pMBYWaG6KeTlo2iVnt8cAakOqE6OtIRQffRMWrdA=; b=O5fPwCSq3vYKiY46DX/3uvfFghwxIiSiqHxtNTe1HXOrqEQujj5Hev9i3AUcJu8O+0 BJuuXi3P3KsaQimME+3T+cJfJNj23hDVBwPz02tXLkBH1l60/Uzr5440ilPFSq2ab5U5 z18i6/xUXMknKIj8brCmWNa/tmnda7FhgJXgWSkDyofOBY0IUAVFUYrgTcSLe/VbIOiu Z2BV2CIYwqcRPTNn06mu5Mgh4Zctqg6HbzayvfRJfG7vX4DUVTHWkzbrqLmAXfWMHEId gw1jzbD8i4CLa0gc6ErzWsgc8aKY956c5KM5WlHhUgeIV/qPCpozizRjrNfTpF1Rmbwk LChw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KwKd33ie; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17si1415042otk.109.2020.02.13.08.04.45; Thu, 13 Feb 2020 08:04:58 -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=@kernel.org header.s=default header.b=KwKd33ie; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388329AbgBMQCr (ORCPT + 99 others); Thu, 13 Feb 2020 11:02:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:37758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728684AbgBMPYY (ORCPT ); Thu, 13 Feb 2020 10:24:24 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E84342469A; Thu, 13 Feb 2020 15:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607464; bh=cVky2Djrzk4LXJf0Vs6LTLoj6Yy0AXj+vQ8+xnb+5Mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KwKd33ieP54+kBcxp0ak8jdLbudQZxYq1APr3yLwJbqce1dnma1BzhfvGH9qHGimf OdFOfj00i0l3IS6ARqsA11nA492h0mWXSyHIOrsue5wJUb8fAA0Xt7e0/1Ts67jrUR F+7+Lsw1uYn+3isOEtdirlL534Hd1qPZAmATTD1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Haywood , =?UTF-8?q?H=C3=A5kon=20Bugge?= , Leon Romanovsky , Jason Gunthorpe Subject: [PATCH 4.9 098/116] RDMA/netlink: Do not always generate an ACK for some netlink operations Date: Thu, 13 Feb 2020 07:20:42 -0800 Message-Id: <20200213151920.803911011@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151842.259660170@linuxfoundation.org> References: <20200213151842.259660170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Håkon Bugge commit a242c36951ecd24bc16086940dbe6b522205c461 upstream. In rdma_nl_rcv_skb(), the local variable err is assigned the return value of the supplied callback function, which could be one of ib_nl_handle_resolve_resp(), ib_nl_handle_set_timeout(), or ib_nl_handle_ip_res_resp(). These three functions all return skb->len on success. rdma_nl_rcv_skb() is merely a copy of netlink_rcv_skb(). The callback functions used by the latter have the convention: "Returns 0 on success or a negative error code". In particular, the statement (equal for both functions): if (nlh->nlmsg_flags & NLM_F_ACK || err) implies that rdma_nl_rcv_skb() always will ack a message, independent of the NLM_F_ACK being set in nlmsg_flags or not. The fix could be to change the above statement, but it is better to keep the two *_rcv_skb() functions equal in this respect and instead change the three callback functions in the rdma subsystem to the correct convention. Fixes: 2ca546b92a02 ("IB/sa: Route SA pathrecord query through netlink") Fixes: ae43f8286730 ("IB/core: Add IP to GID netlink offload") Link: https://lore.kernel.org/r/20191216120436.3204814-1-haakon.bugge@oracle.com Suggested-by: Mark Haywood Signed-off-by: Håkon Bugge Tested-by: Mark Haywood Reviewed-by: Leon Romanovsky Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/addr.c | 2 +- drivers/infiniband/core/sa_query.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -141,7 +141,7 @@ int ib_nl_handle_ip_res_resp(struct sk_b if (ib_nl_is_good_ip_resp(nlh)) ib_nl_process_good_ip_rsep(nlh); - return skb->len; + return 0; } static int ib_nl_ip_send_msg(struct rdma_dev_addr *dev_addr, --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -848,7 +848,7 @@ int ib_nl_handle_set_timeout(struct sk_b } settimeout_out: - return skb->len; + return 0; } static inline int ib_nl_is_good_resolve_resp(const struct nlmsghdr *nlh) @@ -920,7 +920,7 @@ int ib_nl_handle_resolve_resp(struct sk_ } resp_out: - return skb->len; + return 0; } static void free_sm_ah(struct kref *kref)