Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3666286ybl; Tue, 21 Jan 2020 05:04:50 -0800 (PST) X-Google-Smtp-Source: APXvYqx/hc2E50flDtorVqfJQx8c1giuPtatcYePcZp+s/yo/4NdUlKkrZCzI5AGverBrmOG09Ms X-Received: by 2002:a05:6830:9a:: with SMTP id a26mr3548748oto.131.1579611889918; Tue, 21 Jan 2020 05:04:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579611889; cv=none; d=google.com; s=arc-20160816; b=Irv76Uc8emtFcHdc6jMh1UTkeeufdq7tW3TkKVYqeoO1SAfACwkYVd5egBJgb50T2D 1eVtcL4FJ1UN43EA9A15x+w1HrLihWDxECpb2hU0jXCzHdDKdo631K0QZhqyTD4hb40B OHG7P8STYVN/b+v3VWx8oTzXEPqb3Na6LDOr88pga58Mjh5Hd+b5SHIW8DGSCC9Pngin 0TEeiElM8oFbnohd4zC88/nP3SSz4wF1efoqLfMuOxFyYGJy5/qRpyjVVIZcwZ6U7eFo oQGBtR3KWTETRJs8pyFqvIN3KXpgmV8UlEe1qjf+hA+OkLn5je9XE8DW4CbiRhY3chJ6 XO4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MIW1a1CzdzcRBKcD9gTvgSedoGDPOuKCDCTKx1yi8/I=; b=C+AptJHSGNbrmx4+UnEggB5+/T9NNeWpHyceKlwajQUH0AUafo0Hl7qLRI3XUoHykv 43brVa227TKTtwb0t8H81BsN3ODbqvy5NUscoQlNmvP7uj5TbvLL03O4xee0gdj9DK/Y HF9p3FnXQfZzLGDI/2a13RMB3oWnC6FWpYpcXZ+mssvFhsU4Ng0tmWfmXQ5XGDhYcegE xFQFumu+PTkKnPf3QNgYKOu42j659Of8YdRkhHO8tuLONsaJQrMwdodJUWMB9zLD+tLe 2uLo0n+xB6RRbLgYJlNIVGS3BfLUXA5MbQUBrZdTkETx6c5ork3f5m+kTXhwyDMv8ftN V6lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tQtN4Ide; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si20108162oih.154.2020.01.21.05.04.35; Tue, 21 Jan 2020 05:04:49 -0800 (PST) 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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=tQtN4Ide; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728680AbgAUNDQ (ORCPT + 99 others); Tue, 21 Jan 2020 08:03:16 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:51310 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgAUNDQ (ORCPT ); Tue, 21 Jan 2020 08:03:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MIW1a1CzdzcRBKcD9gTvgSedoGDPOuKCDCTKx1yi8/I=; b=tQtN4IdeDDjJluRJEDxx6qRjy aKKTYwoJ8e/flf0xfU9SX2MxmDxP4hyzo/wN4btmpSwSh2FWxqjT4yQLV2lP/ofnd7UsuXJpf7MxV by72E3J1keyyZ0e7pzurn9uXxSyHoEiSSPAyPKkegrxFHbLUyq6KBpoh8qsFN/BpuakdXG/FaqfON NL87FSdLt12y0mxnnFcXhhbMgNjsD7GVWeaV/HqICX0vYeOQxxkZTdlzMq4UQYbhwQsvWq0zESjKU LR3z0e1oMV+DQDDFRfd1c+mh+hIvqm2y/h8zPXXswSBb6mk/h1hmbAFOWR/7HZmA6dyTBvIgigr7D c1Lm4Qy/Q==; Received: from shell.armlinux.org.uk ([2001:4d48:ad52:3201:5054:ff:fe00:4ec]:57886) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ittB9-0004iM-8Q; Tue, 21 Jan 2020 13:02:47 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1ittB4-0003qO-3m; Tue, 21 Jan 2020 13:02:42 +0000 Date: Tue, 21 Jan 2020 13:02:42 +0000 From: Russell King - ARM Linux admin To: Guido =?iso-8859-1?Q?G=FCnther?= Cc: Arnd Bergmann , Lucas Stach , Christian Gmeiner , David Airlie , Daniel Vetter , Philipp Zabel , Sam Ravnborg , Rob Herring , Emil Velikov , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/etnaviv: only reject timeouts with tv_nsec >= 2 seconds Message-ID: <20200121130241.GG25745@shell.armlinux.org.uk> References: <20200121114553.2667556-1-arnd@arndb.de> <20200121125546.GA71415@bogon.m.sigxcpu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200121125546.GA71415@bogon.m.sigxcpu.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 21, 2020 at 01:55:46PM +0100, Guido G?nther wrote: > Hi, > On Tue, Jan 21, 2020 at 12:45:25PM +0100, Arnd Bergmann wrote: > > As Guido G?nther reported, get_abs_timeout() in the etnaviv user space > > sometimes passes timeouts with nanosecond values larger than 1000000000, > > which gets rejected after my first patch. > > > > To avoid breaking this, while also not allowing completely arbitrary > > values, set the limit to 1999999999 and use set_normalized_timespec64() > > to get the correct format before comparing it. > > I'm seeing values up to 5 seconds so I need > > if (args->timeout.tv_nsec > (5 * NSEC_PER_SEC)) I assume you're looking at 64-bit, but I suspect userspace needs looking at considering 32-bit. If userspace uses a 32-bit tv_nsec anywhere in the path that it attempts to pass up to 5 seconds in tv_nsec, then this will fail to pass the correct timeout. If that is the case, userspace is buggy, and needs fixing not to pass such large values through tv_nsec irrespective of this issue. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up