Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp386725ybl; Fri, 24 Jan 2020 02:12:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwB4QmG0IjAXbYAGFYcPpLsv4YwaVgxixFvr5R4c+9Iufwsie+DK0vr/T4mTY2GMgq7hJ5N X-Received: by 2002:a05:6830:1257:: with SMTP id s23mr2137458otp.241.1579860765966; Fri, 24 Jan 2020 02:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579860765; cv=none; d=google.com; s=arc-20160816; b=UvoMmPbg/Mz2rXvWTaMtbg0AZ4O1VavpZ/PG/8UiM5l2XLfV/j2y2YOjIT3AGFR8Y4 16+ewkBKaGmcqezck77Y/GOVirbWGZDIatVe4w0PwlOwaieR1Ac1iVW9PqfxnB2gUMvv /FbJczJOyLMgtzCxcWVFpxx+dNJgEDot4/iL1tgoClAcRZOnaXK69lSXQd2UtzQQlRZs RVwMBZL337rxhZcfAQt3rY6tuWv6VjnfM7aKbCAcGqRx/K92K3jl+5K52nN2NGNCmZ3F 5LC5T3eWz3MXeX5LFSicMT3eiH9vlT4oEFRbCigPhGH8Q7+2Q21dsS/OMLsF6Xn6F7Dp CBxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pMjOSZK58N7M6Rhz2Q0zLJbK9wOAIHwivc/jQo31Ecg=; b=bbVlL8n3GiijpjG83Tvxu07m7SPSMqo6ujjhOKgfXDjm4kAZsOu1erHT8pzuNSZzrT kYNwGWo7kB1SE09dTUvAYz5AvQOc6Azu7liTa9O0aRThNbjNEb7tgZp/x7kpHZoj6si1 xvsWoc03Bz1+yNEVezKt4uC3Thn36HalHd/4zLSCI4iCeykpqeUBU4VB56jf3qwt+/5e i6mKdbPtUxW7AZhc0JbDNd3dK6MVohQdgEvoJ4Ldz8ddZEH8wU/5zM1vnhSDvebNE5PM r5qOyqCmnly03CD6XXy8MLZ5anROGUPxnm9roQFpOj7icAcNxPgvhrnh2HNHC2M8Lz6S Te4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ejlzaLX6; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si2267509oic.245.2020.01.24.02.12.21; Fri, 24 Jan 2020 02:12:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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=@redhat.com header.s=mimecast20190719 header.b=ejlzaLX6; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 S2389081AbgAXKMB (ORCPT + 99 others); Fri, 24 Jan 2020 05:12:01 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29410 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387509AbgAXKMA (ORCPT ); Fri, 24 Jan 2020 05:12:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579860720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pMjOSZK58N7M6Rhz2Q0zLJbK9wOAIHwivc/jQo31Ecg=; b=ejlzaLX68r6XqyXu1e3sjK36xew6tEE7/kN4FUasqClhzhOjjRW1UxCAlfODLG+9qIh7hZ z/WKEplZWVq8K0XTQsHmrBnmdJAopeOG6m73olus4+bL4W1PpZ4olRck1nPVbgdpRw40vX AeRXrVU0wmGbbs/VrujK1Egtdw7c7ZE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-42-8SFVgEeCM9OIiyyyXZdlaQ-1; Fri, 24 Jan 2020 05:11:58 -0500 X-MC-Unique: 8SFVgEeCM9OIiyyyXZdlaQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E13A18A8C86; Fri, 24 Jan 2020 10:11:57 +0000 (UTC) Received: from idlethread.redhat.com (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1F99A4B60; Fri, 24 Jan 2020 10:11:55 +0000 (UTC) From: Roberto Bergantinos Corpas To: bfields@fieldses.org Cc: chuck.lever@oracle.com, trond.myklebust@hammerspace.com, linux-nfs@vger.kernel.org Subject: [PATCH] sunrpc: expiry_time should be seconds not timeval Date: Fri, 24 Jan 2020 11:11:54 +0100 Message-Id: <20200124101154.22760-1-rbergant@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org When upcalling gssproxy, cache_head.expiry_time is set as a timeval, not seconds since boot. As such, RPC cache expiry logic will not clean expired objects created under auth.rpcsec.context cache. This has proven to cause kernel memory leaks on field. Signed-off-by: Roberto Bergantinos Corpas --- net/sunrpc/auth_gss/svcauth_gss.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svca= uth_gss.c index 8be2f209982b..725cf5b5ae40 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1211,6 +1211,7 @@ static int gss_proxy_save_rsc(struct cache_detail *= cd, dprintk("RPC: No creds found!\n"); goto out; } else { + struct timespec boot; =20 /* steal creds */ rsci.cred =3D ud->creds; @@ -1231,6 +1232,9 @@ static int gss_proxy_save_rsc(struct cache_detail *= cd, &expiry, GFP_KERNEL); if (status) goto out; + + getboottime(&boot); + expiry -=3D boot.tv_sec; } =20 rsci.h.expiry_time =3D expiry; --=20 2.21.0