From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A245C3A5AA for ; Wed, 4 Sep 2019 18:19:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD0CF2087E for ; Wed, 4 Sep 2019 18:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567621180; bh=nDJFjBuvgLE+5sJdEHt8JBVMrzHmbRyH798P8lcwKJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jkS0pFykOQtI9WYxThniEg/JvyB1wRf8WftPh3mUEUED917wrM1f+we1ZfCEcwiGJ +gZKA62X08h0BAeMT3h5t4XA0+63faFrusypMo1obLc2d9GpFKEbsIUWtuJAyJj38G H4p3w5vkjkvjw/puv8mzinqpOk76rGnAyOvf/nfE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389932AbfIDSJZ (ORCPT ); Wed, 4 Sep 2019 14:09:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:52620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389131AbfIDSJY (ORCPT ); Wed, 4 Sep 2019 14:09:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 25BB722CF7; Wed, 4 Sep 2019 18:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620563; bh=nDJFjBuvgLE+5sJdEHt8JBVMrzHmbRyH798P8lcwKJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rUt/nRIuAZY8Wy20HDeA2TxfnVmSGgEwcRkdPPplMdg8qwHyr57xBKixjjvIiF4ZI 6AUufCWchm/WxT0rZQwVyIdJsYS15vosAFVINaEawRKIVrtVLX7QLnWF6RUVgS67bI H4Y1dH0CreuZsmhtVS+fF4soYVX2CV7awLjq/qoE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Jeffrey Altman , Sasha Levin Subject: [PATCH 5.2 003/143] afs: Fix the CB.ProbeUuid service handler to reply correctly Date: Wed, 4 Sep 2019 19:52:26 +0200 Message-Id: <20190904175314.321909400@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 2067b2b3f4846402a040286135f98f46f8919939 ] Fix the service handler function for the CB.ProbeUuid RPC call so that it replies in the correct manner - that is an empty reply for success and an abort of 1 for failure. Putting 0 or 1 in an integer in the body of the reply should result in the fileserver throwing an RX_PROTOCOL_ERROR abort and discarding its record of the client; older servers, however, don't necessarily check that all the data got consumed, and so might incorrectly think that they got a positive response and associate the client with the wrong host record. If the client is incorrectly associated, this will result in callbacks intended for a different client being delivered to this one and then, when the other client connects and responds positively, all of the callback promises meant for the client that issued the improper response will be lost and it won't receive any further change notifications. Fixes: 9396d496d745 ("afs: support the CB.ProbeUuid RPC op") Signed-off-by: David Howells Reviewed-by: Jeffrey Altman Signed-off-by: Sasha Levin --- fs/afs/cmservice.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c index 3451be03667f0..00033a481ba05 100644 --- a/fs/afs/cmservice.c +++ b/fs/afs/cmservice.c @@ -502,18 +502,14 @@ static void SRXAFSCB_ProbeUuid(struct work_struct *work) struct afs_call *call = container_of(work, struct afs_call, work); struct afs_uuid *r = call->request; - struct { - __be32 match; - } reply; - _enter(""); if (memcmp(r, &call->net->uuid, sizeof(call->net->uuid)) == 0) - reply.match = htonl(0); + afs_send_empty_reply(call); else - reply.match = htonl(1); + rxrpc_kernel_abort_call(call->net->socket, call->rxcall, + 1, 1, "K-1"); - afs_send_simple_reply(call, &reply, sizeof(reply)); afs_put_call(call); _leave(""); } -- 2.20.1