Received: by 10.223.185.116 with SMTP id b49csp3205262wrg; Mon, 5 Mar 2018 16:30:33 -0800 (PST) X-Google-Smtp-Source: AG47ELu7uS/JE2RoJsr4RgKjlhAnkBM0DPSqiXzUWWCZ9yArlrN1E1WxFlQ6k9GD6gbvp75OZsTt X-Received: by 10.167.129.67 with SMTP id d3mr17042535pfn.108.1520296233191; Mon, 05 Mar 2018 16:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296233; cv=none; d=google.com; s=arc-20160816; b=GNn/xXpnBc3NxccFOXACCwk43QsZH+cZRSTi08//7QqZ5tBMfgn/JHWSp0VnJMQmCN 3TAAxtepbjknmvaWhalKWt7bMzetYsKO0bGUyRzuzKoxrrMQvcodgO9OuF8uAKhhwzTE 9Ls6srk8xgr+Mg3pwCykSihYBeXxbEiEsVPQxh/WSiZ4GHmCIcTQBC25XIG4hpnmg+D8 aAs6s0fvR5AabEcjykq1ZY05oNvRbqMc0cMMwnsld0UrMiB2rdMfIftyzITmb1uBw8yX zIJv+dmxz3h21ZlxVSmpGJoI7X0uyTf110yzla1LE2tzQUHTHfx+QvN7fagvCHIGKaY0 D/Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=9w2ZhzNj+BSBYHWvaUeOSUgZyCZn0EaR/dYzmm6LKMM=; b=EjAeG9s94hcpOfXKBh9oTE4vjkgZsi+RzqffaUD3zfUuD/xTbSKrEKAKVMv35cajNE FpzTc4FF5krmgELckx0P52nj7bszfTxb491tmcdljwXPUyXreBtA1V1rwCKoUMcYfAh3 Q6eP5LCWmSDreO6lxzDoN8w7dh/mRfFrcWSojPrZ8K3JSsPDfD58G/SVdNaESh9dh8Lu lSUxKPc8P0GFfuyypiofbE4vi7PfCb4pVyIt+HsPOdkxWzXaUQxmF/8IvbiWSQT0kf3x 11J21aP6llTpW4bS2dOApoJTjUfKzc21f4lTRZK3lrAi8CM8DJ1F+n6EaMz441qN2XsF jNpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=g0gDT7Yo; 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 m24si9029997pgd.763.2018.03.05.16.30.18; Mon, 05 Mar 2018 16:30:33 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=g0gDT7Yo; 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 S933736AbeCFA2r (ORCPT + 99 others); Mon, 5 Mar 2018 19:28:47 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56670 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933336AbeCFA07 (ORCPT ); Mon, 5 Mar 2018 19:26:59 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260QtZ0038126; Tue, 6 Mar 2018 00:26:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=9w2ZhzNj+BSBYHWvaUeOSUgZyCZn0EaR/dYzmm6LKMM=; b=g0gDT7YoYo+AywjZzvcbKg65RYxTlxADYUAPrVyEy6+MfU4X02ZSgP85t5V1J6HmUS8o R93FlhWwk4h5rxLNCa/1+XIo4c5f2rnyQg+e2k0WCAZBX7EtNgFrRO3s+qrxFuPoOmR/ 2K4BQwzneFkgSchpmsQ4C4kZkf6LHa1YfymhxHdhVxdJfeSFhVHkUx/nNaeT19xxHCwc 9GFCK29ldlVpH86bYhnSBcPl+oonVq1VtcYfvVBpaw/7rsCxpL/YjLOURLXOF1ZTZZgv jXq7ukNvfMy7I5npuFyyE4oKQ9iOtEfKgHJeR8/ZIv0fhBVgRzOJNaXVN8J1JITu0kCb eg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2ghe3kgg4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:55 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w260Qs5B031455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:54 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w260Qru5025307; Tue, 6 Mar 2018 00:26:54 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:53 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 61/65] x86/ldt: fix crash in ldt freeing. Date: Mon, 5 Mar 2018 19:25:34 -0500 Message-Id: <20180306002538.1761-62-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=888 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060005 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jamie Iles 94b1f3e2c4b7 (kaiser: merged update) factored out __free_ldt_struct() to use vfree/free_page, but in the page allocation case it is actually allocated with kmalloc so needs to be freed with kfree and not free_page(). Reported-by: Vegard Nossum Signed-off-by: Jamie Iles Signed-off-by: Pavel Tatashin --- arch/x86/kernel/ldt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 5797d437710d..5de9fbc4ab50 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -39,7 +39,7 @@ static void __free_ldt_struct(struct ldt_struct *ldt) if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE) vfree(ldt->entries); else - free_page((unsigned long)ldt->entries); + kfree(ldt->entries); kfree(ldt); } -- 2.16.2