Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3065936pxj; Mon, 17 May 2021 16:54:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNmH5uh7LUjadfvJ7SXCFeaqdr1Cmy6EsKtXjjNOIKLHFY6CfyeRQ/ZWFYWRopfBcBbRZE X-Received: by 2002:a17:906:edaf:: with SMTP id sa15mr2745895ejb.174.1621295678063; Mon, 17 May 2021 16:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621295678; cv=none; d=google.com; s=arc-20160816; b=rff6jHCAc7OmNxnLdD5XG6OWUV7aql9qjwYstSlWC/AyAyamtG6znQLU64aCMiTF8+ KuVXqJR7zJUEQsGQ6T23xhW5IkcaXR5qqXPyBkEGFvP8iCzhe2RtntNet1e9XiOs9p6x ENUZe840EcZUrVN7UbY44QwvbLI7vxiXYfS9l+1KP+bvzr7GjxaC1xpc99VGNU6VN2FU JzTMVhJN9jFUFi9rTLiUpIp3D3dnuBrcLQPCfWMtfFeKn3c0jVIMmmkgJAtusTR73H2z lcCFoUMrTIceNzlmQd7Wuj8aPZLKTyidku2J29ZVnShx7Eiu5+IdgazlDKi89AsuTAva oXkg== 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=hMzuM0ndWSaREK1K9bViCcVyxhvaTiY48JKiu1ndP74=; b=upEykUGDuo1XN6KTzMkbYEyQqyvftct4qJryM9yFQ/bK04mBrq519GK9HV9O/Z2MLg 696dLC6Z4a0rUCRmSwO6Zp3p1LlxsGC2EljQ+GCzdfqsbxlC4MmdABmMcxPK/MFWT/u3 IIqpFiLjrMYhAYubgQVAg2ltX3NSwlb+NPMBbhuG8M3cjOfAH8Nva72pvCg/cGlmzGIU sTwbDpfaN0vKu6FkPA8O8tMTbeBR9A5heyXIIBFAx7zN8QAhv9IMt/CNZ3owoqFnNZZc r/4ARTWAGqrhaX2zvlM1l3xkN4d9AG99qHtf+YhrYhEszapP7YAr7YD72lar2RxSMwog dtMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ctpvvl3j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dy4si14907884edb.544.2021.05.17.16.54.14; Mon, 17 May 2021 16:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ctpvvl3j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239502AbhEQOYR (ORCPT + 99 others); Mon, 17 May 2021 10:24:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:36118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237416AbhEQOUr (ORCPT ); Mon, 17 May 2021 10:20:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D7F76145C; Mon, 17 May 2021 14:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260688; bh=V67MZokF6hVXxbAyBiyCldiZnykDDti5nA0ZlYz4M2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ctpvvl3jIrIYYvfZzf81ndqU4f/jBiQyGSIxYHXj8Gxk6kEUmWHp2Iy++in2jhdwF N+1EsUcHEzONU+Dgnm2bot1UHG1PMtfELVOuDuKdhnt8AHmuHZz//XjEUXGM7r5zBc Mta3X0Wwinn2G5G1WjEvar9URkLPBvE20O/bEEwQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Chuck Lever , Sasha Levin Subject: [PATCH 5.12 178/363] SUNRPC: fix ternary sign expansion bug in tracing Date: Mon, 17 May 2021 16:00:44 +0200 Message-Id: <20210517140308.619608919@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit cb579086536f6564f5846f89808ec394ef8b8621 ] This code is supposed to pass negative "err" values for tracing but it passes positive values instead. The problem is that the trace_svcsock_tcp_send() function takes a long but "err" is an int and "sent" is a u32. The negative is first type promoted to u32 so it becomes a high positive then it is promoted to long and it stays positive. Fix this by casting "err" directly to long. Fixes: 998024dee197 ("SUNRPC: Add more svcsock tracepoints") Signed-off-by: Dan Carpenter Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- net/sunrpc/svcsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 2e2f007dfc9f..7cde41a936a4 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1171,7 +1171,7 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp) tcp_sock_set_cork(svsk->sk_sk, true); err = svc_tcp_sendmsg(svsk->sk_sock, xdr, marker, &sent); xdr_free_bvec(xdr); - trace_svcsock_tcp_send(xprt, err < 0 ? err : sent); + trace_svcsock_tcp_send(xprt, err < 0 ? (long)err : sent); if (err < 0 || sent != (xdr->len + sizeof(marker))) goto out_close; if (atomic_dec_and_test(&svsk->sk_sendqlen)) -- 2.30.2