Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp456200pxj; Tue, 18 May 2021 07:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzilgucaei0xdxQcu0pIiFQED4pWiAnFYhOKr1QElYV1t2um/1STT87MWFX8186btKfmVPd X-Received: by 2002:a05:6602:134c:: with SMTP id i12mr4423538iov.175.1621347038044; Tue, 18 May 2021 07:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621347038; cv=none; d=google.com; s=arc-20160816; b=lvar8Wi746UGJv64quZiLyy9OSTXOoANU2mIPPbzPpljRRcVvzwLG6mRY32FlDPuse XZc5ZjhFH/Pz01u2UncI57KH1YBHcXRhmddpH2YifQm3rdZwnne2iN/GBP+aVK7pVdGV X638stfTDeKr/bcegWTM9QOroZG2afIj5VfrVzl7bAEtUjhMktjF7D55VSHF4Bdnbowg X+GBKacsjYvx0nGX4uOa0kRp3j7ixnVAf8LPPyJklx6Se1IcjbXd4AI/dT79z5JBZRKx fEbptPhp516SGFO5puNcBW7v+FqBgbfEJBpk7B+1NEJK/Wp82w4PYTX1RgnmJVJNnC6P 1Wpg== 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=0We/E0bfkwtapMbttPU4gWwXzHUpHaQi1k5TSluwRMQ=; b=Yyu7aDkVBKz8LsnMf5WyfCdawXEFAxJKnAkM4K9gNWKX6DHcEOujwtEUSe2y9ihoLF s2x2sub/jO5hnEHyBaGi8iW8EV0eyNWVY3CSkOF1TDP/mkXbZT3gw7dP62McupsD68tK xgkPAMu3TQ7SmRJcSZrjev5SGNTB12ZR829pV2FA0b08cKRHr2S+uZuyHUaERD/6Y6tb oUs3/gwzes/QJayX4Mn04/p+y8jcwHDWnLyfBRpjWxvauqg9GnismV2grg/3r5uq5H01 NnoTfdb4Lo82RYRY3zbB2nNUQfPG5v7v/eGMc1ZJcMDLdi5A7IOyDguC0lmhjCL+G7+m whMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ENXL3zXX; 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 j8si10948401ioo.10.2021.05.18.07.10.24; Tue, 18 May 2021 07:10: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=ENXL3zXX; 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 S1343746AbhEQPmD (ORCPT + 99 others); Mon, 17 May 2021 11:42:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:42054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244167AbhEQP1D (ORCPT ); Mon, 17 May 2021 11:27:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B12561CB0; Mon, 17 May 2021 14:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262206; bh=Hmw3CIFDIDbNxdLnSdHk2KZoBVcFKLlRlIZAYVGR+z0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENXL3zXXV7+09FHpqKsDGB90MoXN7PqXRw48e3x2FluW1PfAc6drDkSlATUqg4CGY O3ja0SX8sMFHC7h7NX8CpjC7oQcZ+u4vOrYf0lafZqcU3BSy5PcFPinnM1w6BdnQEj g/Antz3mBtmgQrHChyr0lHjNB7YeMa8DwMOjCC3Y= 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.10 133/289] SUNRPC: fix ternary sign expansion bug in tracing Date: Mon, 17 May 2021 16:00:58 +0200 Message-Id: <20210517140309.647060942@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 fa7b7ae2c2c5..eba1714bf09a 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1176,7 +1176,7 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp) goto out_notconn; err = svc_tcp_sendmsg(svsk->sk_sock, &msg, 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; mutex_unlock(&xprt->xpt_mutex); -- 2.30.2