From patchwork Tue Apr 16 17:31:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Dionne X-Patchwork-Id: 13632256 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2186FF4E7; Tue, 16 Apr 2024 17:33:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713288823; cv=none; b=DAztOFBc7nKg2rKccNWDeUojtRM8Iz3ZRVfMxpdBsZ2ZpgexktzXwiB1nS2f3vaV5hgh9op7W6Ca6r7aByn3q+4qrmgYdNex8OQCksUdK8/MI09rLdVYBZZjq1K4ptBJVLJ2tH0K/1dgxjMSBP7Acd9TWvzJA/N8EweJacl50tA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713288823; c=relaxed/simple; bh=oyuMKSYGoMfRz+tvPVJ/jIgvFe45ZdlNrFcZrO/Oozo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cARZ+MBZ0F/ha0SSCEde9f29OgY9hg1MjDsmGJegmxMHcl2w14yCyE3QL7+PgHmiRLg4PEOqPW5b5kroc5VxqjFaAskpW87myvHgzEoKyojrrANRnz8yWQ/NqHQmNll9IBaEMU+10EhBGN1ptvMYVnorLYoZKdvNSp3QXoqtx1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=auristor.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=auristor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6e9e1a52b74so781276a34.0; Tue, 16 Apr 2024 10:33:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713288820; x=1713893620; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=F8Fq3HZ/CaefZ5llRGtNvq0zZoQTpNhHnR6rkcG9Onc=; b=oTXCCSbaUNGxS0kZdKo1Db0xteqmsWV3znkAYDRdPeePHZyqqDH8ja/lmWEVG4J5WP VReN8U7bNa8PGY6jAFV2hjfM1VVnV4uNLbfHi82i5pAMbcW/hpZLOT7uO0q6STcRgp/d TZJTSooCGMvlabelEwxGXkh2ICjbX01dfeL8E7bexonxEAqGKP3NZZaVKEEM5HJKJZU/ cOLNlGAqaj2hWBZF43e6SLppKKF7XG7iZ8KI5MxCKFpZeHrk4L5aPPwU1TW4eTtKHYsH nmcjvsSNibRaD6ZSO8q/dY8Ep+MXLeKlgYzquzoXZusGQFmBNauxXFbV8YS4kSArhfn8 igLw== X-Forwarded-Encrypted: i=1; AJvYcCWN5k4hxdy9GzMY325wEYooMI60dH6ppqbIRIvVmJheOSZ8ZL7KoLkVQ/X5Yj3ZdyldyMbemV9LQX4EKXiImqpT70364kPM X-Gm-Message-State: AOJu0Yz5hWKH54xjTxSQCUiAaY/V94NlMirMmD1GwBbL0pOlf2T6c6X8 2bzwdUmtRWGR1sqUQNVVMtRK4kTFEDgCM59VGKUA4J57/MYwVQnYTpIvOuBQ X-Google-Smtp-Source: AGHT+IHlUJXf+egTIlLcd42IFhCtKBOGMyeucgOobbmxD7Sy4JCYOTx59oxRQCIT8vAf0H1CE0Fkhg== X-Received: by 2002:a9d:4d89:0:b0:6eb:7cc9:93c3 with SMTP id u9-20020a9d4d89000000b006eb7cc993c3mr8004133otk.0.1713288820102; Tue, 16 Apr 2024 10:33:40 -0700 (PDT) Received: from hemlock.fiveisland.rocks (hlfxns014qw-156-57-186-228.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.57.186.228]) by smtp.gmail.com with ESMTPSA id d6-20020a05620a136600b0078ed1f9f101sm5667027qkl.88.2024.04.16.10.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 10:33:39 -0700 (PDT) From: Marc Dionne To: David Howells , netdev@vger.kernel.org, Paolo Abeni , Eric Dumazet , "David S. Miller" , Jakub Kicinski , Jeffrey Altman Cc: linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org Subject: [PATCH] rxrpc: Clients must accept conn from any address Date: Tue, 16 Apr 2024 14:31:38 -0300 Message-ID: <20240416173138.126853-1-marc.dionne@auristor.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Jeffrey Altman The find connection logic of Transarc's Rx was modified in the mid-1990s to support multi-homed servers which might send a response packet from an address other than the destination address in the received packet. The rules for accepting a packet by an Rx initiator (RX_CLIENT_CONNECTION) were altered to permit acceptance of a packet from any address provided that the port number was unchanged and all of the connection identifiers matched (Epoch, CID, SecurityClass, ...). This change applies the same rules to the Linux implementation which makes it consistent with IBM AFS 3.6, Arla, OpenAFS and AuriStorFS. Signed-off-by: Jeffrey E Altman Acked-by: David Howells Signed-off-by: Marc Dionne --- net/rxrpc/conn_object.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c index 0af4642aeec4..1539d315afe7 100644 --- a/net/rxrpc/conn_object.c +++ b/net/rxrpc/conn_object.c @@ -119,18 +119,13 @@ struct rxrpc_connection *rxrpc_find_client_connection_rcu(struct rxrpc_local *lo switch (srx->transport.family) { case AF_INET: if (peer->srx.transport.sin.sin_port != - srx->transport.sin.sin_port || - peer->srx.transport.sin.sin_addr.s_addr != - srx->transport.sin.sin_addr.s_addr) + srx->transport.sin.sin_port) goto not_found; break; #ifdef CONFIG_AF_RXRPC_IPV6 case AF_INET6: if (peer->srx.transport.sin6.sin6_port != - srx->transport.sin6.sin6_port || - memcmp(&peer->srx.transport.sin6.sin6_addr, - &srx->transport.sin6.sin6_addr, - sizeof(struct in6_addr)) != 0) + srx->transport.sin6.sin6_port) goto not_found; break; #endif