Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3666777pxb; Tue, 7 Sep 2021 05:06:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytLIpvrfsOBSMo6m7ZTf0zFzUx6jBHjt0iTnZmU72ySf1f3URMgREcvyOY+QpD+ydV1sXM X-Received: by 2002:a17:906:49ce:: with SMTP id w14mr18974073ejv.273.1631016407833; Tue, 07 Sep 2021 05:06:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631016407; cv=pass; d=google.com; s=arc-20160816; b=ZPUfXyPNoRuWKqCvwy3K/k7sGUPWSITd/OEr2vjkTUpXTXKm9wqvw9kBsjsEmnoTj8 pB+/MWmc0pPIeWYK9jeVZt8latrWz9CRCoTbRPsb9yu93BV3ZmImRTlhOaJK16IsJrVw NOG0bAbevwYkIKDLixMXJQ7ewtlFLAS8fjjKUvUH5soC+nVXi0TJrjchJ1h5jj8NB/5v 0u0bUgv5wTUO/+f2NmKLADqlIO0ATDLT2sjeItrCv+0AMBZXwQnHEaCJl8aXeOqNhScE SzBfnsGpZEq9wSzzMr2ROPNYF37fFX0QFIwU2WzsksszHaMPUhpeavFvxQgyDCz33aHI f0yw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:references :cc:to:from:subject:dkim-signature; bh=YUjiZ+FcARWZPfFdze9B3FWeG4LoDQIbpj7UKsZHujs=; b=QIPaBI1dPWDVd4mLinsz5WdzyvY3A2fU7hZ+eA1blyBaXWwA/ul3kJSwuf19E31VqQ VjR0WvhuSNIwv5mQL7k3No2yN3oywz5CwI8LYYRUsaIRx5h/Y4MZGl44VJGb9b9Ev5Ox SC8Xc6ia69Ho7YtQjdg6XGJfq8cQpHfrNXC+uF+/KG3wA0qS5qpV1y5UZHJQPcMlZRJy Jo/9ZT4LWuA9y+6Lm+VFzOQHfAOlKm9o4T0Ur/zIqFwpYTWixtEvbxr2VsrX5wLhrbnw yLMW4XwvAeCQ1wL+WFCnPJRZc7QKHZoP+h0/WNhtDjOfca6iW47WUzY3ZGQ0XPct6gdj 9tUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b="Qg/AlsS5"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si11659388edx.466.2021.09.07.05.06.22; Tue, 07 Sep 2021 05:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b="Qg/AlsS5"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245639AbhIGMFh (ORCPT + 99 others); Tue, 7 Sep 2021 08:05:37 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.109.102]:45528 "EHLO de-smtp-delivery-102.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233864AbhIGMFg (ORCPT ); Tue, 7 Sep 2021 08:05:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631016269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YUjiZ+FcARWZPfFdze9B3FWeG4LoDQIbpj7UKsZHujs=; b=Qg/AlsS5lskTedWM7PBZtc1T9M3UnlHNgaXHI5xEZiSzMq4mgEMA/4Tfkd06ub5k7A1nym EzneuDDEenGhF9w9DpmDJBZcWb8yfhEUN98MKruMkhMVJIy3IRs/85Zohq4lhwj2fpqFCn qq0gYMMRPR/L0MyPW66A9eFqRyNkYRI= Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03lp2055.outbound.protection.outlook.com [104.47.8.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-15-1WTDrmR2MLyfRnbNaWU5jw-1; Tue, 07 Sep 2021 14:04:28 +0200 X-MC-Unique: 1WTDrmR2MLyfRnbNaWU5jw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hWqVnRoSMtkkKoLxFIHeXIgiaJovVpi2T/C6/AsZB7qDEw+xtIrewTpygFBpQZZoseK8rv/oXPeqB/Kza9pJ90bRay4WbZJj7ouIFUIA8vcb/6Q9ZGxjOThcrIIGWqZGjuqEo7RoLMYwhGcZbyvUu28tXdCKByKfWxZMD8a0CTqjWYKz1pu1b4r42ZD4nZOJy9EdJv+9mAK18zwcpqqbMkYXrwHVoY90wnTudnjsEwyz7cCtferfkASLjI4MFjnMq6vxo7WfJr4FgGcQ+vZyfr0D1iJZv01FvTd2ko959+vhmP6sUAuO3C8hIc/CZB81u+pTlRYutm4XWuZzGmkDJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YUjiZ+FcARWZPfFdze9B3FWeG4LoDQIbpj7UKsZHujs=; b=P/sUORgtT+v0e8U6tOn4IUxrHCYqaVhHrluOs2tQ+UpS42gjQBgVMNtpDnx9DGQHxpUC0onhjzDLvMQMEXKU4ytjm6SUeW8tcXIEF0azjIWi4sDVwQU67lYxbLsF+m0DrXo5T+8fltnBWNvJzwcnOwroomHg9EGY81/Ygjgb9tWq7BJiXssn3FFbywMjF9Jl7u+BBnrECVbegyPrEUE9vtXVBZzJqDvQmik+bI5pP4wcbvWeNdWKLYnyim7nJTGIbZq+I8lJI1vQ1pz27lm+AnxS6LJ5TO3IRV/dqLadTHtTLOjFwN/Ktxs0sBXMmLdH2IKAUmXxYSYzAmv1NyBeNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB3120.eurprd04.prod.outlook.com (2603:10a6:802:e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.25; Tue, 7 Sep 2021 12:04:27 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4500.014; Tue, 7 Sep 2021 12:04:27 +0000 Subject: [PATCH 01/12] swiotlb-xen: avoid double free From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <588b3e6d-2682-160c-468e-44ca4867a570@suse.com> Message-ID: Date: Tue, 7 Sep 2021 14:04:25 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <588b3e6d-2682-160c-468e-44ca4867a570@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM0PR04CA0096.eurprd04.prod.outlook.com (2603:10a6:208:be::37) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.156.60.236] (37.24.206.209) by AM0PR04CA0096.eurprd04.prod.outlook.com (2603:10a6:208:be::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Tue, 7 Sep 2021 12:04:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 921de9e7-79f6-4e70-1d37-08d971f7a410 X-MS-TrafficTypeDiagnostic: VI1PR04MB3120: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cTKXp63JMT+BOej5u6mmIeFwoZz5HLopoCNNDmsPAfAJMiZxsA7fw2XDuaefcIvO/z9fhrHpmzco/sPf+qbyEWQg2kNkrv2VEjOuVlrroyMfcvfE2I072EhTZ1sYwOAc1jeqdzuboiL5weYhMRsPIXWe+DIR2ju2+eV2gX4NzVHEYcxK8AkcxTiQh3EWAWkNO8R8vcTAQL/f2fMwEKP4lGofC0XzX/eIOLDHvw/pRPFI2ActBVdpN3zwUA82e26DNpRS8NrPCkA7DK00nB9WbruRgOrp51QMku8GZG1lx0MhjqfqrJKVaQ3b+rTLsh5EoKVGfmNYXAVg2gHNsrHNi0qshYakSNwtE8mIYZxNvmtXSIqEIFYN+/gP9sHzd5Ww0lctLsRQaCuKlXMqNpPC663xQC9eXQstM2YVJ+W4J/Z6n3UbLvecHEpc0gBz/2gOKgBt97MEmkrGnDeIXhlKq6QIKAwxWBJmE0apSNBNLGqGHbfkdTSfJHN9vBPz3LHEg4NhZ5vwOF1+SoOybfIeL4a9wXdbtQUJP7s0WxoU7yHZlpmA/KAvYbnxx4rOJDOh8QTU+NxyXwnN0xWQemY7TAslj8ZaxC+dVtzeDeRk8wBSeKHml5NqiBusXJpiUX5VjwvtW9/D2f01BHWq9iRGvuBywI4/e3nz4tikmbBjWksPB+xjrhKgnvo6msIQwlogf8IsKWSeMjRmMhRHvCFrj/JYibGZmYHfIFLdDz5BGHI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(136003)(396003)(376002)(366004)(346002)(6486002)(956004)(38100700002)(2616005)(86362001)(316002)(16576012)(83380400001)(26005)(186003)(36756003)(4326008)(2906002)(66946007)(66476007)(478600001)(66556008)(5660300002)(8676002)(31686004)(110136005)(54906003)(8936002)(4744005)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d3FudDlzTVc5RUZZeWhhMWJyUEx6Rm5IaXAzWUZ0MmgrMUcrYjJNK1VMYUJS?= =?utf-8?B?U3paOGsxT2llZDNNMVBaakdUMEtNTzBzNmJzMTJKNlZmUm5oeXZhS05hWEhk?= =?utf-8?B?VnFZdGNHK1o3cmtIR3pIRzRFQVdjUzc2d0VkdWtIQlpLbDFWOE1WTENQMnRi?= =?utf-8?B?b2pUR3pQc1p1MUpGZ2lZRklKRjliRWdEYkZCZGhuQmpYdVc3SysvQ253aG9P?= =?utf-8?B?d1lHNDdTMXIxVGdOZXIxWUE2STluVjRPTVhoYnQxcnNtUWYzU0N5OWhqTE1a?= =?utf-8?B?V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VJiYnZkcUY5VHhhV2sr?= =?utf-8?B?MFV0L213TXZncU52KzZJeTVncjZHQUtqbWFPdFN6TnVEVTRvQUdBQmh1MFo0?= =?utf-8?B?WmpQdEdOYmM1dE4xMy9OTW5FbVYwTU4yRllvakJvR1B4b29La2dya2FrSUJC?= =?utf-8?B?cjcyZlpVZnB1bVVaVzQ0Nm1rL3QrS0FxbFp6MEpWQ2pOWlA1Q2hkeHNoTVZu?= =?utf-8?B?QzJjQlNJZGZMMU41UUREdTZNalRlRnJycU1IdFVHZFl0MzR0d2ZReEdTTGRa?= =?utf-8?B?L0xpaUJjdDlhQTk3bkE2MkkwMUF2Zm9DMXR2eFZsVFNGVHN5K3dPdTdaQko3?= =?utf-8?B?WDFzTjQ5Z0JOMEZtc25KQnRzZ3BOZUdjTlp1WkZjM1FQSnpoSFhqUGUyVkRs?= =?utf-8?B?YVhObzRQMDV3eTZsRXdsTHE0R255SWtVdVRKbTVNYjQxa2VheTIybXpTM3Y3?= =?utf-8?B?VVNnOWNsRDY5OENWVU8yckxqVVBrY0E0ZUVQUXNDSzdCeU5sNVFwV1JrbjJH?= =?utf-8?B?NWE2TldNR21oVm8yV0R4SHdubTRqZ3RRVEtuR3FOelJBbnlHRkh5MFdFTmpW?= =?utf-8?Q?WAG8SzkZU1bnjyZ9mtOD9I9rNAZYcDqmM+yfsrP?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 921de9e7-79f6-4e70-1d37-08d971f7a410 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 12:04:27.4045 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fxmyLLc2/qK2sEN83kbQC4/qg3WM3+6UGQu1CSP/kkah2+uudkIas1308gmuLjq4QwRWerOTYZ0iL0+NKi/ObQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3120 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Of the two paths leading to the "error" label in xen_swiotlb_init() one didn't allocate anything, while the other did already free what was allocated. Fixes: b82776005369 ("xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used") Signed-off-by: Jan Beulich Cc: stable@vger.kernel.org --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -216,7 +216,6 @@ error: goto retry; } pr_err("%s (rc:%d)\n", xen_swiotlb_error(m_ret), rc); - free_pages((unsigned long)start, order); return rc; }