From patchwork Wed Dec 11 15:02:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181282 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp714461ile; Wed, 11 Dec 2019 07:55:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwYcDVByAcD5JTLDC5KOpGA62+y4RzuTadEZ5WAVxx6IvKPhr6T1Eg9NL029mtnXQoApvBp X-Received: by 2002:aca:1903:: with SMTP id l3mr3393738oii.16.1576079707345; Wed, 11 Dec 2019 07:55:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079707; cv=none; d=google.com; s=arc-20160816; b=eGPYJ58GSUS+unDR7wBBphOEGQmtzvRPc9FZJDanhZ75o7WAGaAbry5kbZQtuV5DyH RG6+9Z1doWsor6ZVv3K5r8FTc84zcT2qq1ge10DJAQCT4MMRWyz5cUznNn1F8ywtsfrO Ujk8eL1a+5OUY/W0qmJEEvNPojx8jc1opOKwKwbX6RTPiqa5c6EIzr19QwO0laGTfkRc IycZNzjM9WQUigkOAPh6QP2x5ZmHquLfiijR0ufNjxr0sr/chO3iw4jbRDiM+BBwitEU HQKwJTlhoCp3UfoLxJHSZqEreiz/uHIAuWfzEmCSYWwPugLaA03lacz0zSKePCKvLuRB Y9qg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LRjMzX9HvJe5uVdlatlHgf77MPDmm7N8GZ/8+N7d8YY=; b=LpebXiZjMNqKgTMqVVbX6P4pjRff96HFoXEcKfnW/UUsWhF2hdpPOdMSTImbKloWuf TIy1E+dY78uboq93KyZ+YEOO9f3BqkDBt92Ni2cEVitYhSWFLU2lbBHg892v2yHZUzdP w9oqXXgklgw8KCjZDl3Fr8XyH5ihclR/ky6N26hCOznbiNXRa/2JnEogWx1MywCufuKk ngWJdkDOYmmueEZoNV8p1Mt0Po86LgtnGRagRq1QJRg5VKCzUUjjdrY+ae0ectPzSEhd Gmlq2aBrmTnaLufSDi4IgWa/LzdMyMpXUqYD5xPyLzC1xPqoxLxS44/nfn+I1BJR4khY iZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gm5KqiyM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10si1405935otk.195.2019.12.11.07.55.07; Wed, 11 Dec 2019 07:55:07 -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=pass header.i=@kernel.org header.s=default header.b=gm5KqiyM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732241AbfLKPzE (ORCPT + 27 others); Wed, 11 Dec 2019 10:55:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:44098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730329AbfLKPQu (ORCPT ); Wed, 11 Dec 2019 10:16:50 -0500 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 4A484208C3; Wed, 11 Dec 2019 15:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077409; bh=Kxa5WyMgQit6kjaJNFOCMh1jYPWLabPyHMg/gJX4mmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gm5KqiyM5lw4zfD/o0azoFnXFVMWvQeWGyrlvHX8x8XaidnW2o9Ntd7qNSR2AuWdZ oirSiAOH+c1BeRzVoebgKs4//PLLCnbQGQJfI7qdnEdXBIurfEQDJpIeO10ieaoxJI 8KztWUxes8akT0FPlLlTQo4LiQg3sJwHXU6WnsWM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 4.19 004/243] lp: fix sparc64 LPSETTIMEOUT ioctl Date: Wed, 11 Dec 2019 16:02:46 +0100 Message-Id: <20191211150339.449307512@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 45a2d64696b11913bcf1087b041740edbade3e21 upstream. The layout of struct timeval is different on sparc64 from anything else, and the patch I did long ago failed to take this into account. Change it now to handle sparc64 user space correctly again. Quite likely nobody cares about parallel ports on sparc64, but there is no reason not to fix it. Cc: stable@vger.kernel.org Fixes: 9a450484089d ("lp: support 64-bit time_t user space") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20191108203435.112759-7-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman --- drivers/char/lp.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -708,6 +708,10 @@ static int lp_set_timeout64(unsigned int if (copy_from_user(karg, arg, sizeof(karg))) return -EFAULT; + /* sparc64 suseconds_t is 32-bit only */ + if (IS_ENABLED(CONFIG_SPARC64) && !in_compat_syscall()) + karg[1] >>= 32; + return lp_set_timeout(minor, karg[0], karg[1]); }