From patchwork Fri Nov 8 20:34:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 178958 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3246005ilf; Fri, 8 Nov 2019 12:36:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxSsc7L1CIVNNkZ9vv2TZWuXxwS67GVO+IAKGTe1yhne3pFVs9HTxq0UADfcjZmts7xGY8v X-Received: by 2002:aa7:c756:: with SMTP id c22mr12417581eds.25.1573245417271; Fri, 08 Nov 2019 12:36:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573245417; cv=none; d=google.com; s=arc-20160816; b=Krb3p//5gXV6sF//x6p1UXfXoASEy2K7BWTgRfhdF1zcyCqhjjw1Tl91Y2OqI/9U4F bVASLiXeXA1oK8Cm/BNEe57HsYa1F93sfI6lyCeDBWunfVprf+hbc9S2ezoLEbO/tfR6 xMFb3KGNtVkPXUb7zlEwlXnjofpHRf0UlYGMbbgLvG8Mk+Tl/zIANDRAFz3ktDSekKLp jDY7FxrNfggp5uzNZ/6V7pYEBZhw++waZXqr9+cF390i9hbKaGOaaU5UsVoQY+IRDX4W ZNjk7cLhaTCQ0GLQnPlhN8baK8U8ToTLqFN0mbmCJ5ZvK3K1UuZdvdBRiBzozGxi7PX/ /NBg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=P/3UP4dZnBceb+NXJGC1dhtLKolcNk24y2sM1lQ0uYk=; b=MrkcWjQwzxDPOIbYz5sVOTBR4lvDIBZPoABsyq2g1bQpi3KguKQ/F0VsYfl+X+r1de RJsmGWo2XaZeZQOs6MdMDUIFGxnbB3J3YikL7NOa6ZFpYnu8ZzhvlruLozpTufDPBDxm XrNP7ngCOgTkO4nRBnBnEGNHWeSXMcXwJUd4zdaZ+oMXUXe7PKonIV07ykzM0Zb0sPLT nk+5yYWk3BdcBc0UD8ej8CPZBoX6r04nXJ7s6Fa9yAfNV0VsL3scatCjtgm/w/ld0ke9 Z6fyEjjKzdZ995UohbE+WCo9zaW8AoBhrYZ5ASJToj+ufTgj5T/ABByXmKpMB1uzCszg 6zsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 93si5751743edo.408.2019.11.08.12.36.57; Fri, 08 Nov 2019 12:36:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730509AbfKHUg4 (ORCPT + 14 others); Fri, 8 Nov 2019 15:36:56 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:50269 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729683AbfKHUg4 (ORCPT ); Fri, 8 Nov 2019 15:36:56 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mi23L-1hxwm536Mz-00e7qK; Fri, 08 Nov 2019 21:36:36 +0100 From: Arnd Bergmann To: y2038@lists.linaro.org, Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , stable@vger.kernel.org, Bamvor Jian Zhang , Sudip Mukherjee , "Gustavo A. R. Silva" , Thomas Gleixner Subject: [PATCH 6/8] lp: fix sparc64 LPSETTIMEOUT ioctl Date: Fri, 8 Nov 2019 21:34:29 +0100 Message-Id: <20191108203435.112759-7-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191108203435.112759-1-arnd@arndb.de> References: <20191108203435.112759-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:AdGIzk8C/keCLr5gehPESKcLmoKBfAibkexFmJLNk/J2fjrWvfQ 8MAcq+hyhFCKe2NGkMCKC8E6hOh4EiIOzxoFMQpf3a/A02gkKmMm67Uoa2gD8xG2+2utJwY cYeiQr+CRTPH4nv3P5X2WlQL+CA52ot2f9Dezuje1gFc+nbrE7YWv6SVCXd9j58mgdTJ/N8 lsNRivF1GfWhv/gGAwK9w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:mRuBUasDfOU=:flVrvYp7E8yox4TyMBaI4z UYkgcoF1o+2SBVnju+MHHn+yfHpZAqQtuXlQTecwl9wHeKYJ5TKKRtsJp+MjU/UBX2Flde831 vQ2JCT18G9LprQqZvqVuf4UDC1voQ0EBV3a9CMXWylrhmSp9RSs22NgQ81ZP3En5UQHevX3mk LmMHcii40IfdAJYmPPAazrcqMu+GOhqXbxRvAYh0UHNbOnRr/zEoYrS0GICHJyCQY0ZpHYC50 rm3Uh1TN7AMYsv25mgUOHlLrPKvHTMb8TSbGpEUmp0Uz9loju/Brl6fG8quDJdD1XkmjrnC5X AZjfBYqEYRsezTHUDuV/xGgkauUXMNS2dh/lgVOnOeWi2A6BPFhKhZnIvbFIlP4rFkEN2MuCM sZINyLUT0UxJxOm4t+9chCQOxmB9bMYXbQNdzGSUQ5EVgxrX/dNuZpw7+OACH3P6K1VZNjMIM HA4Amu8XFQR/oU90pQiRRVgXIGt5tqM4AFVweZxqfIeRkHDXdyK3QiayQWG/sI/sfKTB12JuY LKVpokywzACi1TaoB//PcySul25uWn2O8/yv37Xm5tLRfiEU3xu8jUWNWW5MeFPrwdT/rDVsT e3BdROHlQi0tIIxlCkCRArDCICN+wi3VseR+UOMgHdhHilaRIzzHsJYju2NcpnYBkOyyya92t wgt9ECTg4ig1UujjAKyOIHbwkWtrk6/mLA+UqilOT6OIQYbiw5CF+VZdRBUth6InGsEZPEqtp jrbEV7NDpXtGm/2uEgZ3AmDrcNhNFCDb0ZGuoldCn9CkMD7AFX2HLt1ZCHDsq0mE0t41Yvkfr XbC093GVzuzGlrvVN1hd96kwe2m/Yu6WzqFkb7QBzmbK/8bDu4Ct3AJ3cwGn+Ye31SkWwYQte 0v+0lW0dTx0/GuOAc8Ow== Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- drivers/char/lp.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.20.0 diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 7c9269e3477a..bd95aba1f9fe 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -713,6 +713,10 @@ static int lp_set_timeout64(unsigned int minor, void __user *arg) 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]); }