Received: by 10.213.65.68 with SMTP id h4csp2117660imn; Sun, 8 Apr 2018 20:08:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49AsL4hFuqmL/KBVKsjaf8hysgGbAobs13THHcFO9S72XntLPitA57lbhYia09vLHSgaSe6 X-Received: by 10.101.85.73 with SMTP id t9mr4920122pgr.451.1523243324660; Sun, 08 Apr 2018 20:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243324; cv=none; d=google.com; s=arc-20160816; b=yCwVuTeW1SlOsu1VuRqysfcjhFBy0UHHjclP8CS21qcvQKYkghNiGOEkfuc1VzMwQ3 0QbOGuNViWVT8xVltpGeNj7VKz/TvssmAfrK2lTXi/oeactLMXhvey3+7jeYZouYy9AS F9lKE4OUY1tsqMpkZ6sFurwHQoqryuwoPEPyyQxJb16cTz5x1E+DR+QyvOYrNHPu6qEE +EFGbfSncanzuof+ggy5s5wfh+62n5mHF/aCAX2NRrq2FgN+ETsHLUaNVDA3mW/aELpQ oK6zL6mZkv/REeoTTXx2PKHs3q5s97cIvaXLq9G8j+UlG0iLJ0LPJxDCrnFyPI5Oixai mzZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=vza3czM7Du1qCmqW71LHHmU0QJBxlwpiHpGjf/xYTOk=; b=XHQ1tZQrlYqKgrCiHrt2EqGTwCq3dCZtJFyALpUqQZiqryecdDbl7J+RIm7CN8rscz 5oR8W2oalaZZRBKrdEw9WQQ1XEIGPEBNpVaEH9cS7Erk/IJmP40gbPTrm9XjJ9nziqHJ OY6Dg9soVoz1IB0Xf0RH0398lUQ5pjCkfspM293/LG2s6ONNxHBESLSMCHyGOaaT7Eud GNyzgJrK82wKC4oK53Uf/fwmlb7vTJjISHF7fXX+6AIy5G8FM8OYhRFrQr1C9GWyIz0X DDTYaQT77WtZZQlhRTO3IUCCiHCyxDU4IEtBv2kLGSDJKlTyjpu3T4lmZJlgogjbygXQ GDzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=aHAxEoCB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1-v6si13715190plo.171.2018.04.08.20.08.07; Sun, 08 Apr 2018 20:08:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=aHAxEoCB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757922AbeDICJt (ORCPT + 99 others); Sun, 8 Apr 2018 22:09:49 -0400 Received: from mail-by2nam03on0135.outbound.protection.outlook.com ([104.47.42.135]:16544 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756229AbeDIAbS (ORCPT ); Sun, 8 Apr 2018 20:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vza3czM7Du1qCmqW71LHHmU0QJBxlwpiHpGjf/xYTOk=; b=aHAxEoCBp8TNZy/anu++YvLb/Q90knzoiPLh0sC1M28EybpeA5NRrwwD/ZxFv6aNpvoipviyaCGcNhOVcR1HIjVi5t/+O/OAclwlPg89xaPUUjxzA4CrfQPOJpwcgvMC83gsxREf4hhKzHY4nUISgR3y+NCkchx9NKjjkgXVDuQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0917.namprd21.prod.outlook.com (52.132.132.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:31:14 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:31:14 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Chuck Lever , "J . Bruce Fields" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 164/293] sunrpc: Disable splice for krb5i Thread-Topic: [PATCH AUTOSEL for 4.9 164/293] sunrpc: Disable splice for krb5i Thread-Index: AQHTz5kzjr7qH0QUOUaXE8f2zk9U/A== Date: Mon, 9 Apr 2018 00:25:02 +0000 Message-ID: <20180409002239.163177-164-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0917;7:DoKDj5kwu2IFdgFaks5ixMa9k7OTk9aQTRyNtaiMaYshR+9uVS14Um86zIqmB+DnlAq/mvfZ7vdmvqeNB+STx0hTv+Vhlkr8ARX8bH+LzNCNOjIiEQ4gSGTnILhWWOh2Z0tyRpzq/SxRd2bxMxP5DFXA5XKfebhKJY0aiopbJlje/HRPO0Y6AqSWZwjohN0hPB0icOFIht2/vPg3d7AbQdeyrKNNnK8kI+mFGX6xjhZcPQZKcbFLp0rGvnVHKYmd;20:Awe/IATEawMbrhrR2zevY/0H9w5Msj3jsnmZI9/dhAi7N2V4P++nwz6DZ0eqsReAh7JOeicw9Ymih+iJcTnonAYxqQ6SJ0D7girDYHNz8ZEzFArMZVhmYVy3s036N27A6qvMlFbWLRLhfS1KhikWI6bs1GwjkiEAZtQKvq1wW/4= X-MS-Office365-Filtering-Correlation-Id: 5eea997b-370b-451d-7c63-08d59db133ab x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0917; x-ms-traffictypediagnostic: DM5PR2101MB0917: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(158342451672863)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0917;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0917; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(99286004)(22452003)(106356001)(26005)(110136005)(478600001)(54906003)(10290500003)(316002)(1076002)(72206003)(186003)(4326008)(97736004)(66066001)(11346002)(25786009)(86362001)(476003)(446003)(2906002)(6666003)(6486002)(105586002)(86612001)(3280700002)(3660700001)(6512007)(3846002)(6306002)(6116002)(6436002)(2616005)(486006)(53936002)(7736002)(8676002)(81166006)(81156014)(8936002)(68736007)(305945005)(10090500001)(76176011)(6506007)(102836004)(36756003)(107886003)(59450400001)(2900100001)(2501003)(14454004)(966005)(5660300001)(5250100002)(22906009)(32563001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0917;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: w8fmaAqoWWFl8xVbRxuthaB2iLfsRu5Jn2UjM0pK9K58/o7bHlf7Z2WpLgEQamxm7Hgu11gq59iukckIXeqVTcBBX0sW2gGeJovwWH24ZC6E7Fb/JdEv6mAMI7bHR1zLx021mgDC32iSD5nrQJmb/yzYvIYvjJfHtJ0ygAa6tfGRKXqEp1ZPZI1BfaQqkEEjiT0P7iwLHcptGER5u6kncbxZR59DeLabbC1zZQKL7PgRRPR83zlGwiyfpVzk0Wi41V6GkI3JNrMNRMBSFXhUxXZkReUNf+Mow+gc/CBzQ2rIo0J2/BsEqKYDk5PLaY5aDoEOlvrpIRhW5b3xtDhW7uCU/msigTgdxpks9bQumG08fBWfXF+CTPP+/gygFRwr+STyoe9gtOyTyTPnLtZYVkPFl4zG2Ozi/OTvt5oGzS4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5eea997b-370b-451d-7c63-08d59db133ab X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:02.9876 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0917 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuck Lever [ Upstream commit 06eb8a56af23ae32e90fdd6b27fec30930364b52 ] Running a multi-threaded 8KB fio test (70/30 mix), three or four out of twelve of the jobs fail when using krb5i. The failure is an EIO on a read. Troubleshooting confirmed the EIO results when the client fails to verify the MIC of an NFS READ reply. Bruce suggested the problem could be due to the data payload changing between the time the reply's MIC was computed on the server and the time the reply was actually sent. krb5p gets around this problem by disabling RQ_SPLICE_OK. Use the same mechanism for krb5i RPCs. "iozone -i0 -i1 -s128m -y1k -az -I", export is tmpfs, mount is sec=3Dkrb5i,vers=3D3,proto=3Drdma. The important numbers are the read / reread column. Here's without the RQ_SPLICE_OK patch: kB reclen write rewrite read reread 131072 1 7546 7929 8396 8267 131072 2 14375 14600 15843 15639 131072 4 19280 19248 21303 21410 131072 8 32350 31772 35199 34883 131072 16 36748 37477 49365 51706 131072 32 55669 56059 57475 57389 131072 64 74599 75190 74903 75550 131072 128 99810 101446 102828 102724 131072 256 122042 122612 124806 125026 131072 512 137614 138004 141412 141267 131072 1024 146601 148774 151356 151409 131072 2048 180684 181727 293140 292840 131072 4096 206907 207658 552964 549029 131072 8192 223982 224360 454493 473469 131072 16384 228927 228390 654734 632607 And here's with it: kB reclen write rewrite read reread 131072 1 7700 7365 7958 8011 131072 2 13211 13303 14937 14414 131072 4 19001 19265 20544 20657 131072 8 30883 31097 34255 33566 131072 16 36868 34908 51499 49944 131072 32 56428 55535 58710 56952 131072 64 73507 74676 75619 74378 131072 128 100324 101442 103276 102736 131072 256 122517 122995 124639 124150 131072 512 137317 139007 140530 140830 131072 1024 146807 148923 151246 151072 131072 2048 179656 180732 292631 292034 131072 4096 206216 208583 543355 541951 131072 8192 223738 224273 494201 489372 131072 16384 229313 229840 691719 668427 I would say that there is not much difference in this test. For good measure, here's the same test with sec=3Dkrb5p: kB reclen write rewrite read reread 131072 1 5982 5881 6137 6218 131072 2 10216 10252 10850 10932 131072 4 12236 12575 15375 15526 131072 8 15461 15462 23821 22351 131072 16 25677 25811 27529 27640 131072 32 31903 32354 34063 33857 131072 64 42989 43188 45635 45561 131072 128 52848 53210 56144 56141 131072 256 59123 59214 62691 62933 131072 512 63140 63277 66887 67025 131072 1024 65255 65299 69213 69140 131072 2048 76454 76555 133767 133862 131072 4096 84726 84883 251925 250702 131072 8192 89491 89482 270821 276085 131072 16384 91572 91597 361768 336868 BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=3D307 Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin --- net/sunrpc/auth_gss/svcauth_gss.c | 8 ++++++++ net/sunrpc/svc.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcaut= h_gss.c index 6a08bc451247..7897e1ef3f20 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -839,6 +839,14 @@ unwrap_integ_data(struct svc_rqst *rqstp, struct xdr_b= uf *buf, u32 seq, struct g struct xdr_netobj mic; struct xdr_buf integ_buf; =20 + /* NFS READ normally uses splice to send data in-place. However + * the data in cache can change after the reply's MIC is computed + * but before the RPC reply is sent. To prevent the client from + * rejecting the server-computed MIC in this somewhat rare case, + * do not use splice with the GSS integrity service. + */ + clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags); + /* Did we already verify the signature on the original pass through? */ if (rqstp->rq_deferred) return 0; diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 272c34551979..3e1d677276c1 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1159,7 +1159,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kve= c *argv, struct kvec *resv) if (argv->iov_len < 6*4) goto err_short_len; =20 - /* Will be turned off only in gss privacy case: */ + /* Will be turned off by GSS integrity and privacy services */ set_bit(RQ_SPLICE_OK, &rqstp->rq_flags); /* Will be turned off only when NFSv4 Sessions are used */ set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags); --=20 2.15.1