From linux-kernel-owner+andrea=40suse.de@vger.kernel.org Thu May 23 22:55:27 2002 Return-Path: Received: from Hermes.suse.de (Hermes.suse.de [10.10.96.4]) by wotan.suse.de (Postfix) with ESMTP id 76C90C2214 for ; Thu, 23 May 2002 22:55:27 +0200 (CEST) Received: by Hermes.suse.de (Postfix) id 7199AD81F; Thu, 23 May 2002 22:55:27 +0200 (MEST) Received: from Cantor.suse.de (ns.suse.de [213.95.15.193]) by Hermes.suse.de (Postfix) with ESMTP id 6C3D6D81D for ; Thu, 23 May 2002 22:55:27 +0200 (MEST) Received: from vger.kernel.org (vger.kernel.org [209.116.70.75]) by Cantor.suse.de (Postfix) with ESMTP id 48B4D14A4C for ; Thu, 23 May 2002 22:55:27 +0200 (MEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 23 May 2002 16:51:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 23 May 2002 16:51:05 -0400 Received: from to-velocet.redhat.com ([216.138.202.10]:65267 "EHLO touchme.toronto.redhat.com") by vger.kernel.org with ESMTP id ; Thu, 23 May 2002 16:51:05 -0400 Received: from toomuch.toronto.redhat.com (unknown [172.16.14.22]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 9D136B8036; Thu, 23 May 2002 16:51:05 -0400 (EDT) Received: (from bcrl@localhost) by toomuch.toronto.redhat.com (8.11.6/8.11.2) id g4NKp5Y28990; Thu, 23 May 2002 16:51:05 -0400 Date: Thu, 23 May 2002 16:51:05 -0400 From: Benjamin LaHaise To: Linux Kernel , linux-mm@redhat.com Subject: [PATCH] 2.4.19-pre8 vm86 smp locking fix Message-ID: <20020523165105.A27881@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org arch/i386/kernel/vm86.c performs page table operations without obtaining any locks. This patch obtains page_table_lock around the the table walk and modification. -ben -- "You will be reincarnated as a toad; and you will be much happier." diff -urN v2.4.19-pre8/arch/i386/kernel/vm86.c work/arch/i386/kernel/vm86.c --- v2.4.19-pre8/arch/i386/kernel/vm86.c Thu Mar 7 16:39:56 2002 +++ work/arch/i386/kernel/vm86.c Thu May 23 16:21:38 2002 @@ -97,21 +97,22 @@ pte_t *pte; int i; + spin_lock(&tsk->mm->page_table_lock); pgd = pgd_offset(tsk->mm, 0xA0000); if (pgd_none(*pgd)) - return; + goto out; if (pgd_bad(*pgd)) { pgd_ERROR(*pgd); pgd_clear(pgd); - return; + goto out; } pmd = pmd_offset(pgd, 0xA0000); if (pmd_none(*pmd)) - return; + goto out; if (pmd_bad(*pmd)) { pmd_ERROR(*pmd); pmd_clear(pmd); - return; + goto out; } pte = pte_offset(pmd, 0xA0000); for (i = 0; i < 32; i++) { @@ -119,6 +120,8 @@ set_pte(pte, pte_wrprotect(*pte)); pte++; } +out: + spin_unlock(&tsk->mm->page_table_lock); flush_tlb(); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/