Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2931495ybc; Thu, 14 Nov 2019 01:09:14 -0800 (PST) X-Google-Smtp-Source: APXvYqytFP4SSKd+weiudkV+O38Ch9G8WbH+pq2I6COxjV5OEVsCi0RcmYLOCcxvoTExWewnyhb5 X-Received: by 2002:aa7:d7d7:: with SMTP id e23mr8333659eds.236.1573722554443; Thu, 14 Nov 2019 01:09:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573722554; cv=none; d=google.com; s=arc-20160816; b=LKAIdXmi3IJdhInUGDTEMu3HHnnior8vlG3MbCkvHd4N+7g3L57Fjw0AqsQakXEraG btHEF0a47NEnyHKfPkgSsNV2s0fLAA9M8QpT8aYPo9BbeVCIQM6WmEl/QLlAbj3+SNeP TMCOgSGhnSjAj9tvhrkkJuzKsauQEgShtm2/kvV/5T6Yt4pb77GYsNfVB+DkmWW78ODw mozsL4V7trT32ShDVJlVPNKCMy7kM2eSZ6pEi5iXqowNTx1csTI8yRe64SPTZu1HSunk F+3gBrQ8HC0tYzJqleLdu6W8TlvIarNm1/3a89ewDoSW1e5BoCvxGE+/Wz1TQO/9bgTS gJBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to; bh=wnebgQJ/f9W+I4ezoWisoMyOt5UMzUu6D8tiAZ4iJQ8=; b=ZgQKYLvSPN4isvsPG3prl2Vcg+5Gk/lXgB/8Ia/MicX8/mlSjLwKUnh3BCRRC3Ce+P EX9LB34mq4XtznmBy+2USlrSMcpnRawn0Wy0FoQLGSPcnnHPxuVgQFyQdhBzLiU5GwXg YCeqn9J/cmqziz1GKWonDvzRhSp91xp4LD+anVG1F+aufhLzDwigQLRnI0Wg0I9mbkbn w1DKB4TRfVIvUBAX0mRVysZIT085NxuuxYXtZ00vgIEUu32K5GNk7gji8r/1EoeTSi1W uDfYwxj/fDS9vuBEIH8URMdC1hmDmYzj6m4bxo0KaD1gfjsfEdQyBroyHJJiqTBc9vjE zSuQ== ARC-Authentication-Results: i=1; mx.google.com; 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 la4si3040755ejb.297.2019.11.14.01.08.50; Thu, 14 Nov 2019 01:09:14 -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; 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 S1727064AbfKNJH7 (ORCPT + 99 others); Thu, 14 Nov 2019 04:07:59 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:40377 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbfKNJH5 (ORCPT ); Thu, 14 Nov 2019 04:07:57 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 47DFxk6wMPz9sRs; Thu, 14 Nov 2019 20:07:54 +1100 (AEDT) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 3b05a1e517e1a8cfda4866ec31d28b2bc4fee4c4 In-Reply-To: <20191021142309.28105-1-geert+renesas@glider.be> To: Geert Uytterhoeven , Benjamin Herrenschmidt , Paul Mackerras From: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, Joel Stanley , Geert Uytterhoeven , linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/security: Fix debugfs data leak on 32-bit Message-Id: <47DFxk6wMPz9sRs@ozlabs.org> Date: Thu, 14 Nov 2019 20:07:54 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-10-21 at 14:23:09 UTC, Geert Uytterhoeven wrote: > "powerpc_security_features" is "unsigned long", i.e. 32-bit or 64-bit, > depending on the platform (PPC_FSL_BOOK3E or PPC_BOOK3S_64). Hence > casting its address to "u64 *", and calling debugfs_create_x64() is > wrong, and leaks 32-bit of nearby data to userspace on 32-bit platforms. > > While all currently defined SEC_FTR_* security feature flags fit in > 32-bit, they all have "ULL" suffixes to make them 64-bit constants. > Hence fix the leak by changing the type of "powerpc_security_features" > (and the parameter types of its accessors) to "u64". This also allows > to drop the cast. > > Fixes: 398af571128fe75f ("powerpc/security: Show powerpc_security_features in debugfs") > Signed-off-by: Geert Uytterhoeven Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/3b05a1e517e1a8cfda4866ec31d28b2bc4fee4c4 cheers