Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1945697imm; Thu, 12 Jul 2018 10:21:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdvhHEt+ndwbOcTR14L0qdk/0Y/x2Wl10sECFrE2ZOe2wcgB22K9Ug+d8zHLfgl8mKcr30i X-Received: by 2002:a63:6e0a:: with SMTP id j10-v6mr2902779pgc.321.1531416105316; Thu, 12 Jul 2018 10:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531416105; cv=none; d=google.com; s=arc-20160816; b=F/Vxa3cgRYRq5mJYAs57uursI9oX0nEAJrVjyVzX0bwc0Ey1T7l7iLkfSVGqKKMLCd U7jPS9cSejePxT3q2gpedkKCrbM3COHbNwwjW8UsnCox4iTLHuE+BFx27v5Vd7GCbFKc zfN0Z6tnMyEWmCg1CQzpeFOXnaWwqTcLt0y/dFiA0NpF1Nv+UJtJ0pH6IhVLBWA0fdf2 Cyn6wZLYd8TfEeU9i9ajcJNbIKKFf8OQY5A6EdGrW9C1TRa25SirqftpKWvWE7pKS1ER 3Hatr7IDz+0X18Wqj/lPXvncKnVInck/6k2RpaHo57spSCcZYfCVAfzu84k8dC6+5X6d mbQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Vtg6o/E9q0d2E8ZKqqxujdhdEM2yl9Ty/CfV3vfSnVk=; b=mC61LyM8FFQd3lfOpkKpHmYLtxVL/oQFNVDLAnAJgRpEinJ0uFOW/1kbXLlZuiwiaj QaMTjyKMD7Um4sL/K5gjYXrzKjYfvyhCO7YQ7znfNDZQOPisic3Q+CKE3bSEFc8HmRPy gHAvgW2R2TK4fsUttv97u7o5tzjQa/PktzfHqB8jYLaW0CPufQce7cTZ6vL5+P/sQoaR 57U+bt7a6Hgg8L4earWDEr24J5Ak9B86kAlpnW9llODNJxJGRFRnl5DzUm0RSejFzD/Z IWosHk6rDSWTeQRwIrOhMsaVreOTAuMhODotTBi9qV5WGiWyqfKbnhVdkT2Dnk+d64MD bQPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=WK7HxILb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l81-v6si24217533pfa.368.2018.07.12.10.21.30; Thu, 12 Jul 2018 10:21:45 -0700 (PDT) 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=@oracle.com header.s=corp-2018-07-02 header.b=WK7HxILb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732556AbeGLR3y (ORCPT + 99 others); Thu, 12 Jul 2018 13:29:54 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:50548 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727136AbeGLR3y (ORCPT ); Thu, 12 Jul 2018 13:29:54 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6CHE0nW010062; Thu, 12 Jul 2018 17:19:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=Vtg6o/E9q0d2E8ZKqqxujdhdEM2yl9Ty/CfV3vfSnVk=; b=WK7HxILb7qWHFo6hrAzXQm6e8KWbccBTccMEhVp0Iduo6ABKIvck87GARY0Tgij1A0vD lt51cVfhFHke/O+G2zKDmdqybt7ZvMhvhMb60sNkxc514QW+mgGlNFV7dTIovnpm+AU+ qdBRgud9EAyZ7dmpkHmtW2x822ibDSZQJaWaicoyeR3pKg9FFzj4jWAIhTHtAdQ69cz2 gnoliJRQCBHiDSYz/xC2jpkjV3H7M3dyC2Sa0FjvtxhDUc45bWP8NwPUaS9/MU9bV4jF 8RzbP8DHXPeDnwG3NyV38vYUB6Ylwfl0CM8sIl0cncR1Gk7QTNf0WTQrsjUnhdJKNb5H tw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2k2p76crq9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jul 2018 17:19:17 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6CHJHwN009654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jul 2018 17:19:17 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6CHJGqM022505; Thu, 12 Jul 2018 17:19:16 GMT Received: from ovs104.us.oracle.com (/10.149.224.204) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 Jul 2018 10:19:16 -0700 From: Boris Ostrovsky To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: mark.rutland@arm.com, jgross@suse.com, Boris Ostrovsky , stable@vger.kernel.org Subject: [PATCH] xen/x86/vpmu: Zero struct pt_regs before calling into sample handling code Date: Thu, 12 Jul 2018 13:27:00 -0400 Message-Id: <1531416420-3580-1-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8951 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=538 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807120182 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Otherwise we may leak kernel stack for events that sample user registers. Reported-by: Mark Rutland Signed-off-by: Boris Ostrovsky Cc: stable@vger.kernel.org --- arch/x86/xen/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c index 7d00d4a..95997e6 100644 --- a/arch/x86/xen/pmu.c +++ b/arch/x86/xen/pmu.c @@ -478,7 +478,7 @@ static void xen_convert_regs(const struct xen_pmu_regs *xen_regs, irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id) { int err, ret = IRQ_NONE; - struct pt_regs regs; + struct pt_regs regs = {0}; const struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); uint8_t xenpmu_flags = get_xenpmu_flags(); -- 1.8.3.1