Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4820589ybl; Tue, 4 Feb 2020 02:34:00 -0800 (PST) X-Google-Smtp-Source: APXvYqy36VeRiRBMtILJlh18Kw1Elq9EPoqs5TGrNa7a1Z2hup/qsVAs8oGIixPRwZhsVIGj2ATq X-Received: by 2002:a9d:7e90:: with SMTP id m16mr15125490otp.227.1580812440307; Tue, 04 Feb 2020 02:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580812440; cv=none; d=google.com; s=arc-20160816; b=m7m8zW1MeoGtlhDKSHpo1TDOTCWeT0fKhKP28YZ4MKEeA6ZR9j12N8Yo7FQt1jALIw fk94Q8HA1wvETL2w3+OhSefXs4/cvexmZoLnj6tCXaj5XSzsghs7UxhFaxnP0ik99dtB 7RMOcvCalmol+cdDzR+mvoxCT4v1YUnuPP/Y5e0pfSPg0PrgVGzFaXuCLfaw/BACOTr7 2RfL4Az0I8Ou3l35tAxonp7UwmsOJQw9gnSKSm90iu7cx2sO2LXJWNS1dVJ1fAsJz1BN JljYTdNh7G/bqc7Yij+0tYq2g3WFM69yutxVcszoeiNEr56QAzxCpGBeuPZHX9Ap+72R VAbg== 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=w81XveLRIk07zYgCspgiGg6WMrOtuh9MOpXguHaH4po=; b=VbcsLBGvEMyFIc9Mw6JkC7V0JyaL08nUgBP7nwoug5Sm0ysY4lWs3HxfatQbvNl6S2 k49NI3tWL3TFPewRxufpr0puubbRCGEw3x1lDGEKddNlhKG4yHR0PgyV4/syLgZpzH4M EzplzmZWUxr82cxxLmqAFGOR/VbSCztI6k+N0salq8WBg7LsLq4AR51oy6hA56431vA7 ls1FFAZop1T6F6PiikEXTcdm7Ww3VsS8R+0lmZKdmx/WXIOMrMAdAj/R7ic/rDzZluAO eNLlF2gl/6d094B2fAYZx6MNmf1Qu9S77MYn5hmw+kUgbd8bDVIVjt9c1ArZAAyBD3GR smUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DePJKMfg; 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 u1si11919569otg.113.2020.02.04.02.33.37; Tue, 04 Feb 2020 02:34:00 -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=DePJKMfg; 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 S1726864AbgBDKdE (ORCPT + 99 others); Tue, 4 Feb 2020 05:33:04 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43729 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726631AbgBDKdE (ORCPT ); Tue, 4 Feb 2020 05:33:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580812383; 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=w81XveLRIk07zYgCspgiGg6WMrOtuh9MOpXguHaH4po=; b=DePJKMfgVS5+p+8oCG7LhNTLIxwPAa4t6fwr1vLGRafT3F/+3NtumiKvfyaz74It+LRIah hNteX3nZ6BhU2r04BKb6vAkK/zzXfcpygpH7rnLcTtlPVe7wMCdz2MmnoE4FuUI3Hu9iNt YiFxshIarOAaYT6ZLu+CuifO7Eng6DU= 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-283-GiT5QarXPL-pHKIcdz25VA-1; Tue, 04 Feb 2020 05:33:01 -0500 X-MC-Unique: GiT5QarXPL-pHKIcdz25VA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04CCB1083E80; Tue, 4 Feb 2020 10:32:59 +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 E5992171EB; Tue, 4 Feb 2020 10:32:57 +0000 (UTC) From: Roberto Bergantinos Corpas To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, arnd@arndb.de Subject: [PATCH] sunrpc: expiry_time should be seconds not timeval Date: Tue, 4 Feb 2020 11:32:56 +0100 Message-Id: <20200204103256.16131-1-rbergant@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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. Using 64 bit variants of getboottime/timespec 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 7511a68aadf0..65b67b257302 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1248,6 +1248,7 @@ static int gss_proxy_save_rsc(struct cache_detail *= cd, dprintk("RPC: No creds found!\n"); goto out; } else { + struct timespec64 boot; =20 /* steal creds */ rsci.cred =3D ud->creds; @@ -1268,6 +1269,9 @@ static int gss_proxy_save_rsc(struct cache_detail *= cd, &expiry, GFP_KERNEL); if (status) goto out; + + getboottime64(&boot); + expiry -=3D boot.tv_sec; } =20 rsci.h.expiry_time =3D expiry; --=20 2.21.0