From patchwork Wed Dec 11 15:04:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181229 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp902093och; Wed, 11 Dec 2019 07:11:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzptu3cPm1hjs8YZKZggX3plUKNtRfXJpq6R6eFryGAvjg9ZDqa/J8A0j/qBkYuAPmk9fuc X-Received: by 2002:a54:4117:: with SMTP id l23mr2991503oic.140.1576077092730; Wed, 11 Dec 2019 07:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077092; cv=none; d=google.com; s=arc-20160816; b=JJsK8UNnODrsSXAGd9sYtR1w5SdQsIuuLfSD41Qh/vZiJ+KvH8sUQF8m0heo4mP1zx bZ0Wa6V0ZdkcEHrU/nNtaTcc7VLmanFb4hPMTbsXrJLqU+kiyRzHv++ImMkZ6yvyfIW0 Qq3ribnDbECReHsTNeGm18wFBbIWIq1ksqLYY+/a/evasZhUZhcnfj2A8cU64EwQbAFf dBBJjWukCU3vKaDzebWfzB9/2dyySp898M06NHUFPPxyswmYRvbrOsQ7fRiAYryLxk2+ dHkqJDY/CPz0ILwbPP3+cV0QlhFNG94hhZOsu6MHfKbTRrGyLxrQx+VZAaGEgY7yEjyj 9zoA== 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=ahFPof/eP5/Mbydk7UDpCMp1ABtv2fEMHVgLmyBl6KI=; b=clj2u8mMOk6ahytwySWYIDZCyCtReo6Pv+A/c4NxmzQFYZoy2Saj7lPEAHwXr9oTSN ag31sZ/euedvrmvvOkcfrQ88R6/uLMMA2Qf0uWSbtkYKj6UP6v8qsKLwMI7TQ9cpuh2S Zj834sv07hc2mMJblQnYLuFD+Q1RDOoo688FjMigavA7fkzOAEOX65sG7/TV72NBuaV7 tvaLCizWcLijYYzvUEOcOzhWsL7fWjtvEWaPm2z3NhqKMX9Nh+VqFmIUWzzEPRq9VWHV RIuHBjJBmYRJZ8V7qTcysAfX5sV1QumFJs5DOoVxf0MwYcjNYqoyrRoXEL3kfHccXFpf anvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sBwBWzoH; 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 f187si1347270oia.218.2019.12.11.07.11.32; Wed, 11 Dec 2019 07:11:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=sBwBWzoH; 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 S1730942AbfLKPLb (ORCPT + 14 others); Wed, 11 Dec 2019 10:11:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:60100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730938AbfLKPLa (ORCPT ); Wed, 11 Dec 2019 10:11:30 -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 4DB38222C4; Wed, 11 Dec 2019 15:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077089; bh=cRi5G9C0XWPPCnV+02MMDB3bXkRsVGf0Rh3K1z24W0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sBwBWzoH9HnRyItramGwexQoNaqYoeDO+57KUGWDv6Tae04H4g5QOBYm5aZaciATB +tefbQRKspJVbAB2arhrsB3z2tTNnB8LlEEnTmZTtoD7Na/o+2zjW0grl/uY9fsBCZ 2XKAGWMLnRHet6uUC5p71EDxzUt8RJMkbL0sSQCo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 5.3 005/105] lp: fix sparc64 LPSETTIMEOUT ioctl Date: Wed, 11 Dec 2019 16:04:54 +0100 Message-Id: <20191211150222.701178959@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -713,6 +713,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]); } From patchwork Wed Dec 11 15:06:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181231 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp905879och; Wed, 11 Dec 2019 07:14:21 -0800 (PST) X-Google-Smtp-Source: APXvYqz8JMuKMLU3pFmG682bTpXHSm5M3yOx2FhnUKI3J3FCJf0K7OhchN9CfI34s+IOM3ULNuK2 X-Received: by 2002:aca:dc04:: with SMTP id t4mr3011455oig.51.1576077261178; Wed, 11 Dec 2019 07:14:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077261; cv=none; d=google.com; s=arc-20160816; b=cxUYj4B5/B6CDK+A+1pPZVzaN4AE35foCwB7IAJE/bhztkiFQ0Za3YWNjsY3TIJDxX 7gNR0GlzJwrduaxVZBCVS1MvXqzejgCztnXtcEiy8m4iF0UJt46XDDE7HJjNseUMGvpC 2ESe/+1RB/p7ycDDNKF1+C2As3bgWlwR0dReJoqae7ZPE2kQuyYQhm02f7PcNG4GHUhk JJCa9Q4CbfwLzLfYA+8yCpKBi1DpgeiU6Gb6X42XQf/LdVFPIKWkwHr5WnAb6DI7s9m7 MDVpnfxd3K2/tBQNk2EzWKtjS/lIerWZJ1RB6CbNeB5eICchhGgfEtv7wYAg0ckmJBka GqoA== 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=6P8OpsLBXVHpLA4zdv2eSAP8aKy4Kgl3aINFEeAC4L4=; b=G249adbqBI/lJgxXm3T8JvFAkHHfCS4qT7dtGqxUiTMwOyqa65+rpUlSv9yTOsoQ0q P1uxJ46PRePrP2Dh+pO3y+krzXrWyTpgsRCz7A36OYOorVZh6K7YyC6Jqdezx8F8DGW4 GSQgfT1yOCvpOxHJyvmrebvAjcUTjH6MYacuZvRF/bKAxEzDc+cgKUAVvbo+I8z0P3pU d7kY/FxYmnx+skgpluKFQ96C5tCejQ+zMNzQcf1dET5kufUpxb6cem9C75eHvlN6tpHs v7TJekYXBbiFRbtd9mVfsIWWVa//dJELlbLFxxDnaLZhtzPivjAbsNNGCbDOAF/TUltL R+OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LDB38Z+H; 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 17si1268768oix.71.2019.12.11.07.14.20; Wed, 11 Dec 2019 07:14:21 -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; dkim=pass header.i=@kernel.org header.s=default header.b=LDB38Z+H; 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 S1731610AbfLKPOT (ORCPT + 14 others); Wed, 11 Dec 2019 10:14:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:39502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730534AbfLKPOS (ORCPT ); Wed, 11 Dec 2019 10:14:18 -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 835942465B; Wed, 11 Dec 2019 15:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077258; bh=ATBWun4wWF0hfWPoCuDAJUpd6PpKWorGF7fWEHv5zi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LDB38Z+H8y9cFq6GBgIjtkvw0ekc8yXfBr/5Oqopq36CGvP9Aj3QrOoyHP/hyGaRI fli3aoSz4Y1cECluJSffgNvlW8P1nd/Ha4N10UkU+Y1Bzfov6hN44rYBiSZuslv1MY gmZtIByaYyYJXNg8LPC3ArqS5Vq0A5JDng/mPxdA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alim Akhtar , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH 5.3 075/105] arm64: dts: exynos: Revert "Remove unneeded address space mapping for soc node" Date: Wed, 11 Dec 2019 16:06:04 +0100 Message-Id: <20191211150253.971364995@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marek Szyprowski commit bed903167ae5b5532eda5d7db26de451bd232da5 upstream. Commit ef72171b3621 ("arm64: dts: exynos: Remove unneeded address space mapping for soc node") changed the address and size cells in root node from 2 to 1, but /memory nodes for the affected boards were not updated. This went unnoticed on Exynos5433-based TM2(e) boards, because they use u-boot, which updates /memory node to the correct values. On the other hand, the mentioned commit broke boot on Exynos7-based Espresso board, which bootloader doesn't touch /memory node at all. This patch reverts commit ef72171b3621 ("arm64: dts: exynos: Remove unneeded address space mapping for soc node"), so Exynos5433 and Exynos7 SoCs again matches other ARM64 platforms with 64bit mappings in root node. Reported-by: Alim Akhtar Fixes: ef72171b3621 ("arm64: dts: exynos: Remove unneeded address space mapping for soc node") Signed-off-by: Marek Szyprowski Cc: # 5.3.x: 72ddcf6aa224 arm64: dts: exynos: Move GPU under /soc node for Exynos5433 Cc: # 5.3.x: ede87c3a2bdb arm64: dts: exynos: Move GPU under /soc node for Exynos7 Cc: # 4.18.x Tested-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 6 +++--- arch/arm64/boot/dts/exynos/exynos7.dtsi | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) --- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi @@ -18,8 +18,8 @@ / { compatible = "samsung,exynos5433"; - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; interrupt-parent = <&gic>; @@ -311,7 +311,7 @@ compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges; + ranges = <0x0 0x0 0x0 0x18000000>; chipid@10000000 { compatible = "samsung,exynos4210-chipid"; --- a/arch/arm64/boot/dts/exynos/exynos7.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi @@ -12,8 +12,8 @@ / { compatible = "samsung,exynos7"; interrupt-parent = <&gic>; - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; aliases { pinctrl0 = &pinctrl_alive; @@ -98,7 +98,7 @@ compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges; + ranges = <0 0 0 0x18000000>; chipid@10000000 { compatible = "samsung,exynos4210-chipid"; From patchwork Wed Dec 11 15:06:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181284 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp716547ile; Wed, 11 Dec 2019 07:57:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyqhYe1u0bugUnDkAPA4QvPeX+QYVZ30NfdqiN6uh/kL3wrn9oWdsF9SxNp91gsuJiZks3u X-Received: by 2002:a05:6830:145:: with SMTP id j5mr2666308otp.242.1576079825610; Wed, 11 Dec 2019 07:57:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079825; cv=none; d=google.com; s=arc-20160816; b=OW4Ui98GYe3/rTyqoveXw4Q9RxI6ckh7qwynQPtCbyEPWKi/Jmi4wSpxsKViJ3qMfl ki5EiAElnxOTUYgEQwMNariPJuHug7YDbelBQXBwSGHjQDsju+Ft+04jV3FN4j1S2tUO t+8Idn0v+A0ORONlGNjz8RNNOay//yseaI6nws9XKMfFfcdi39Zw3Cv5Kw5aTbOHvBmn kQICPEJpwLYxz6G7ETzV3drdMvJkpaHc3yg/L95Mqbjqa6OIOcKtlB6q/IIWNZH6Yti7 xF9lyYD7vc/UpfGxlPbpmJTxpoVsGwQD4gzd7X+NOCn3PBSARdWU12cYjAW54lYPDNMe 83tA== 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=UhOp/l3ujFqz6RAm/8VTdFIsvCu9tVGgETC5hzpHcUo=; b=UAl7HVD+Vl+04QZBzX6UeGNtDYiFS36eRl7w0KLEacnPzQdfiDPWVnnoaAGblT804N O18dlyjuFUeNV/HdJgRanVFo8PHMcSo2PI1kbwdH8H23WBD+L82Y1q7vGcEYTCntNFXL bRhoDsJ4BEwvzqByiM6uHfv15kRFF1Tu/Ql1RXi1lBVZeePVi2xVTDhDPbAkBPrq8Cec 3PlgG9fwqLdFFtfnQDOlXuDCtYI65ASV5N53qORjcHmDUSbGdg1eArVgbLD0yZH8rVlW 0za1gLdFAHqIHYJXpQnQj0c3x3ehUnYtvR8nvAb5gp03oX2EGh60b0fWk1KmmAqCeYA7 cvcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fVzuyl3Q; 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 u20si1586844otg.193.2019.12.11.07.57.05; Wed, 11 Dec 2019 07:57:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fVzuyl3Q; 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 S1730284AbfLKP5E (ORCPT + 14 others); Wed, 11 Dec 2019 10:57:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:41284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730821AbfLKPPR (ORCPT ); Wed, 11 Dec 2019 10:15:17 -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 E0E4424654; Wed, 11 Dec 2019 15:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077316; bh=bMEM8CgX/6uIErmN9B5ttGlNi4wBwVVcAmuXfFf4Z8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fVzuyl3QbVp58nLw8ZDixxTGDWA0rigQ6sGrlPXl6MVMhpQn5FcW1V3rrDCPUsnyk k71hVPWyYOfdU8rdACZp0dAeDhjMN2QqiG/6/sMcm9jTDqfPlqcaE3GC4H8wNdUVPt Ask8T1Vrk/8nW3pNt/MCnNqHuIhStHdzo04xVQEQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Viresh Kumar , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.3 099/105] RDMA/qib: Validate ->show()/store() callbacks before calling them Date: Wed, 11 Dec 2019 16:06:28 +0100 Message-Id: <20191211150303.441176134@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Viresh Kumar commit 7ee23491b39259ae83899dd93b2a29ef0f22f0a7 upstream. The permissions of the read-only or write-only sysfs files can be changed (as root) and the user can then try to read a write-only file or write to a read-only file which will lead to kernel crash here. Protect against that by always validating the show/store callbacks. Link: https://lore.kernel.org/r/d45cc26361a174ae12dbb86c994ef334d257924b.1573096807.git.viresh.kumar@linaro.org Signed-off-by: Viresh Kumar Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/qib/qib_sysfs.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/infiniband/hw/qib/qib_sysfs.c +++ b/drivers/infiniband/hw/qib/qib_sysfs.c @@ -301,6 +301,9 @@ static ssize_t qib_portattr_show(struct struct qib_pportdata *ppd = container_of(kobj, struct qib_pportdata, pport_kobj); + if (!pattr->show) + return -EIO; + return pattr->show(ppd, buf); } @@ -312,6 +315,9 @@ static ssize_t qib_portattr_store(struct struct qib_pportdata *ppd = container_of(kobj, struct qib_pportdata, pport_kobj); + if (!pattr->store) + return -EIO; + return pattr->store(ppd, buf, len); }