Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1338724rwb; Thu, 15 Dec 2022 08:59:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXs6IQqPNMF7+jMqZSX7ahLc0PBe2TNk008VhQTte6XlfDk/3RdoMJEpS1qmmIR6ETScKUOB X-Received: by 2002:a05:6a20:6a85:b0:af:9539:a29e with SMTP id bi5-20020a056a206a8500b000af9539a29emr3091900pzb.16.1671123543196; Thu, 15 Dec 2022 08:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671123543; cv=none; d=google.com; s=arc-20160816; b=ldn+RI2o1PT8quJssrzuZrUf0vEcw5W78Tdtveea5fjzIF04OyyICJd1j+foye7+5K Fi21AckmgUpB5nCa5DedTj1hpZltWisdK4sXRA4jusnMcA/eJBlgMuomkYZzFgh/t/Fn JwgYj5yh6ot3xujdHqbV4TCpXw9H7bRjmMYzUofIg0gwt/9AgAEy1ciWhxL34JpvOqnf gCNk7VALGF9x42lfT9MJapEPC4haEBwcCPy+Io5MaSyKWzycHtpLSFXN5TNZ4058hzLo kKc+dxUZueWSrQiVkYws8PvgIasWIKIkMcAO5RUWAGXHkO7AGviT5VLF+xBpb/54lQ7d DRXg== 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:cc:to:from :subject:organization:dkim-signature; bh=unfhT2gZFh+PeXXoGCTN5BIPcvygoucWIB9TvJ1/voY=; b=PL7NXPmE2ZaWeyF2QbLFbBwRdFxka3BrsCdTfuaWDxDPoRgUcVzoVoOUvNcNbyyA8n +7B9XbapecvZGlXqmNZ4p2lQmGBW+X2N+RmD92G9ViOSrldkA6m9zH94OhSX/jK8YMPW AMTLHKb5wh9Q8jcPAmRptv4jMwoXjokssOiXCDxMxSf2rq3R4jSzHPb8wUvG+ZdW4TV2 vJ2TqrVBwLo0W/LsQuMmKtkHHakoJsC/okRs+MdulqTueYHoyh61ZY2Bm08vioiJSiph QHHEnXcWylLi28qUjxC52YqeyJ+ykpkThB3PYMRlSa97k07GxXNBVs1eJoiyjg6ycOyP Gwug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FXxBRboN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc20-20020a656d94000000b004790794f1fasi3551156pgb.428.2022.12.15.08.58.54; Thu, 15 Dec 2022 08:59:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FXxBRboN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230060AbiLOQUn (ORCPT + 68 others); Thu, 15 Dec 2022 11:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbiLOQUe (ORCPT ); Thu, 15 Dec 2022 11:20:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F02BE31356 for ; Thu, 15 Dec 2022 08:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671121195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=unfhT2gZFh+PeXXoGCTN5BIPcvygoucWIB9TvJ1/voY=; b=FXxBRboNfoCwHYTfUIxHhI8O7y+AZ0cG2W97fbbbSU2ltjmXnacmvD1iSdue454gQWXn7W 4UR6MTCBqPMEq05vaFaqIlGgiIkMAAEEXm0zTnUhQaF720sK+92IXc9O1dujL8iIrJcdB/ hP0W9aPaGnJ8JGonnsXStEai2ECAZNY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-383-KqTCzZK9PYexta1rVCRfQw-1; Thu, 15 Dec 2022 11:19:51 -0500 X-MC-Unique: KqTCzZK9PYexta1rVCRfQw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1CAD338123BC; Thu, 15 Dec 2022 16:19:51 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78A571121318; Thu, 15 Dec 2022 16:19:50 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH net 1/9] rxrpc: Fix missing unlock in rxrpc_do_sendmsg() From: David Howells To: netdev@vger.kernel.org Cc: Marc Dionne , linux-afs@lists.infradead.org, dhowells@redhat.com, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Date: Thu, 15 Dec 2022 16:19:47 +0000 Message-ID: <167112118790.152641.2918682447555593225.stgit@warthog.procyon.org.uk> In-Reply-To: <167112117887.152641.6194213035340041732.stgit@warthog.procyon.org.uk> References: <167112117887.152641.6194213035340041732.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 One of the error paths in rxrpc_do_sendmsg() doesn't unlock the call mutex before returning. Fix it to do this. Note that this still doesn't get rid of the checker warning: ../net/rxrpc/sendmsg.c:617:5: warning: context imbalance in 'rxrpc_do_sendmsg' - wrong count at exit I think the interplay between the socket lock and the call's user_mutex may be too complicated for checker to analyse, especially as rxrpc_new_client_call_for_sendmsg(), which it calls, returns with the call's user_mutex if successful but unconditionally drops the socket lock. Fixes: e754eba685aa ("rxrpc: Provide a cmsg to specify the amount of Tx data for a call") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- net/rxrpc/sendmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 9fa7e37f7155..cde1e65f16b4 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -625,7 +625,7 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len) if (call->tx_total_len != -1 || call->tx_pending || call->tx_top != 0) - goto error_put; + goto out_put_unlock; call->tx_total_len = p.call.tx_total_len; } }