Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261654AbUKXBIx (ORCPT ); Tue, 23 Nov 2004 20:08:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261385AbUKXBIv (ORCPT ); Tue, 23 Nov 2004 20:08:51 -0500 Received: from fmr17.intel.com ([134.134.136.16]:51930 "EHLO orsfmr002.jf.intel.com") by vger.kernel.org with ESMTP id S261666AbUKXBEt (ORCPT ); Tue, 23 Nov 2004 20:04:49 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C4D1C1.8C2FFD87" Subject: RE: [PATCH 1/2] setup_arg_pages can insert overlapping vma Date: Wed, 24 Nov 2004 09:04:28 +0800 Message-ID: <894E37DECA393E4D9374E0ACBBE7427013C9AB@pdsmsx402.ccr.corp.intel.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH 1/2] setup_arg_pages can insert overlapping vma Thread-Index: AcTNl5rA76rARnfyT+SOqXzq8myPLgEJ46LA From: "Zou, Nanhai" To: "Hugh Dickins" , "Chris Wright" Cc: "Andrew Morton" , "Linus Torvalds" , "Luck, Tony" , "Martin Schwidefsky" , "Andi Kleen" , , X-OriginalArrivalTime: 24 Nov 2004 01:04:29.0256 (UTC) FILETIME=[8CB19C80:01C4D1C1] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 20235 Lines: 354 This is a multi-part message in MIME format. ------_=_NextPart_001_01C4D1C1.8C2FFD87 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <> <> I think ia64 ia32 subsystem is not vulnerable to this kind of overlapping vm problem, because it does not support a.out binary format,=20 X84_64 is vulnerable to this.=20 just do a=20 perl -e'print"\x07\x01".("\x00"x10)."\x00\xe0\xff\xff".("\x00"x16)'> evilaout you will get it. =20 and IA64 is also vulnerable to this kind of bug in 64 bit elf support, it just insert a vma of zero page without checking overlap, so user can construct a elf with section begin from 0x0 to trigger this BUGON().I attach a testcase to trigger this bug I don't know what about s390. However, I think it's safe to check overlap before we actually insert a vma into vma list. =20 And I also feel check vma overlap everywhere is unnecessary, because invert_vm_struct will check it again, so the check is duplicated. It's better to have invert_vm_struct return a value then let caller check if it successes. Here is a patch against 2.6.10.rc2-mm3 I have tested it on i386, x86_64 and ia64 machines. Signed-off-by: Tony Luck Signed-off-by: Zou Nan hai -----Original Message----- From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Hugh Dickins Sent: Friday, November 19, 2004 1:40 AM To: Chris Wright Cc: Andrew Morton; Linus Torvalds; Luck, Tony; Martin Schwidefsky; Andi Kleen; linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] setup_arg_pages can insert overlapping vma On Tue, 16 Nov 2004, Chris Wright wrote: > Florian Heinz built an a.out binary that could map bss from 0x0 to > 0xc0000000, and setup_arg_pages() would BUG() in insert_vma_struct > because the arg pages overlapped. This just checks before inserting, > and bails out if it would overlap. Chris, shouldn't your patch also cover the setup_arg_pages clones for 32-bit support on 64-bit architectures, with something - uncompiled, untested - like the below? I'm not sure how necessary the additional vma->vm_start < mpnt->vm_end test is, but suspect ia64 might need it. Signed-off-by: Hugh Dickins --- 2.6.10-rc2-bk2/arch/ia64/ia32/binfmt_elf32.c 2004-10-18 22:57:03.000000000 +0100 +++ linux/arch/ia64/ia32/binfmt_elf32.c 2004-11-18 17:17:57.000000000 +0000 @@ -214,6 +214,8 @@ ia32_setup_arg_pages (struct linux_binpr =20 down_write(¤t->mm->mmap_sem); { + struct vm_area_struct *vma; + mpnt->vm_mm =3D current->mm; mpnt->vm_start =3D PAGE_MASK & (unsigned long) bprm->p; mpnt->vm_end =3D IA32_STACK_TOP; @@ -225,6 +227,12 @@ ia32_setup_arg_pages (struct linux_binpr mpnt->vm_flags =3D VM_STACK_FLAGS; mpnt->vm_page_prot =3D (mpnt->vm_flags & VM_EXEC)? PAGE_COPY_EXEC: PAGE_COPY; + vma =3D find_vma(current->mm, mpnt->vm_start); + if (vma && vma->vm_start < mpnt->vm_end) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, mpnt); + return -ENOMEM; + } insert_vm_struct(current->mm, mpnt); current->mm->stack_vm =3D current->mm->total_vm =3D vma_pages(mpnt); } --- 2.6.10-rc2-bk2/arch/s390/kernel/compat_exec.c 2004-10-18 22:56:50.000000000 +0100 +++ linux/arch/s390/kernel/compat_exec.c 2004-11-18 17:17:57.000000000 +0000 @@ -62,12 +62,20 @@ int setup_arg_pages32(struct linux_binpr =20 down_write(&mm->mmap_sem); { + struct vm_area_struct *vma; + mpnt->vm_mm =3D mm; mpnt->vm_start =3D PAGE_MASK & (unsigned long) bprm->p; mpnt->vm_end =3D STACK_TOP; /* executable stack setting would be applied here */ mpnt->vm_page_prot =3D PAGE_COPY; mpnt->vm_flags =3D VM_STACK_FLAGS; + vma =3D find_vma(mm, mpnt->vm_start); + if (vma && vma->vm_start < mpnt->vm_end) { + up_write(&mm->mmap_sem); + kmem_cache_free(vm_area_cachep, mpnt); + return -ENOMEM; + } insert_vm_struct(mm, mpnt); mm->stack_vm =3D mm->total_vm =3D vma_pages(mpnt); }=20 --- 2.6.10-rc2-bk2/arch/x86_64/ia32/ia32_binfmt.c 2004-11-15 16:20:34.000000000 +0000 +++ linux/arch/x86_64/ia32/ia32_binfmt.c 2004-11-18 17:17:57.000000000 +0000 @@ -357,6 +357,8 @@ int setup_arg_pages(struct linux_binprm=20 =20 down_write(&mm->mmap_sem); { + struct vm_area_struct *vma; + mpnt->vm_mm =3D mm; mpnt->vm_start =3D PAGE_MASK & (unsigned long) bprm->p; mpnt->vm_end =3D IA32_STACK_TOP; @@ -368,6 +370,12 @@ int setup_arg_pages(struct linux_binprm=20 mpnt->vm_flags =3D VM_STACK_FLAGS; mpnt->vm_page_prot =3D (mpnt->vm_flags & VM_EXEC) ?=20 PAGE_COPY_EXEC : PAGE_COPY; + vma =3D find_vma(mm, mpnt->vm_start); + if (vma && vma->vm_start < mpnt->vm_end) { + up_write(&mm->mmap_sem); + kmem_cache_free(vm_area_cachep, mpnt); + return -ENOMEM; + } insert_vm_struct(mm, mpnt); mm->stack_vm =3D mm->total_vm =3D vma_pages(mpnt); }=20 - 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/ ------_=_NextPart_001_01C4D1C1.8C2FFD87 Content-Type: application/x-gzip; name="ia64-vm-overlap.tar.gz" Content-Transfer-Encoding: base64 Content-Description: ia64-vm-overlap.tar.gz Content-Disposition: attachment; filename="ia64-vm-overlap.tar.gz" H4sIAGfrokEAA+0a72/burFf67+C6IfNzmLHdhJ3aFAMWeL2Ga+JC9tdX/dFoCXa1ossGhKVxC36 v++OFClKohu8Le8Nw3QoGul4v3i8Ox5phXR01r3fdvk9SyK6O3nxO0C/f9Z/fX4OfyVU/8rnQX9w 3j8fnZ8PRy/6g+HZYPSCnP8exlQhSwVNCHmRcC5+RPfU+P8ohJX1j4JeFKTPq6M/6PdHZ2cH1n/w ejQ6U+s/OB2dDwA/OD0fvH5B+s9rhhv+z9f/5IjM/STcCbLiCel+JT7fLhMWcf+NfAxjRmgckJQn gkg8SZkvQh6n5OikNf20+Php4b2bzm4uF+1XLFpBOMmYikIhIvbqmLiQrZdEgmOso2Vezq5+auNI pzW+Xcy+tD1cKdFpzcc45F1PZu1XJ1manJxI/iy+i/lDDHLi7LG7jrOTKFy+6lyQOv2hAZgdjZyj BzkkvgVevObkgZGYsQD8tSd8RcSGpUy6FWb5txZM1/Ouv9xe3kyuyFvSv0AHgAvn46vFZHo7b30D EhA0YzTo8jjaG0cfky1L1iA4jAUngj0KGFpvWSzeoABCPs6m/5hcj0nb89gj8zNBlxFT7kJNj/0K wEx6zgHyFzKf/HM8fef9NL68Hs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Kk+wmKGyT5sHb9I4l23atCPIgJub6a18 wW4f2zoCISZ3Jqb7QqpiUsrT1Zj7frYLYV9Md9Rndq9P0GKIBSVMlXnJWoj0eYLbk2ojZfzohq4o 4yVtEGt0t2MUaujS7OZoJh7nY9yPdpkwmWL2NmeX9/1Q+6c9XQ44y/v44xJ09in0s8tsvbbvFYrY B4Jibfrm7ApofbhFEeaHgRJF8csAvvXgMBHViSS6SiYF1skqAqGxYo91gRJdo0ORDrpCJMY0rl1l IjnalLXrz5ezd8plhbvUIs/32yWPsB2RAWZRrmuXNniLJcJ7GZlILLdLvJhRotQPVCZgVGMoafL6 J0hfL5IxapAvmjKuvmoSn882wp8OHTSIN3N9f/vJiIajLIS7/mVRa/HSxFdXDmUtGq+3QoVbwfYI OVajVfiKiwe9gazw6m1Y0koTGq8dknJ8SesuWyq1FVqNr6gtK8qvU2qKJL5chaxLlNyY5TJh93Ve hS+RmtWokBarkSPMab9CqI73JWfrnKw62wR8roL7TjrAl+i21L3QOd54cf5+cnIz+Tg37jwQOA+M 3jnXxQyUJ57FvpPcDJTIxX7HnORmoER+TxN3aOqBfHrXk/nV5ez6RBPBKYr1IEu6UFD8OyT63nrO 3/+r33/cwNEQDwrPqePH33/gne2p9f0Pfv9x1j9tvv/4Q0CwVLzB/3p+6yXeL3R/yQ/g3QVRHwMR NUy6XD61/AhO1W9aL5Otev9vT6GB/wCq+a/W+nl1PJX/kPrF91+np/L7r+Gwyf8/AsIYL8LCuN35 9rwbSwMNNNBAAw000EADDTTQQAMNNNBAAw000EADDTTQQAMNNNBAAw000EADDTTQQAO/K/wL0mBX UgBQAAA= ------_=_NextPart_001_01C4D1C1.8C2FFD87 Content-Type: application/octet-stream; name="vma-overlap-fix.patch" Content-Transfer-Encoding: base64 Content-Description: vma-overlap-fix.patch Content-Disposition: attachment; filename="vma-overlap-fix.patch" ZGlmZiAtTnJhdXAgYS9hcmNoL2lhNjQvaWEzMi9iaW5mbXRfZWxmMzIuYyBiL2FyY2gvaWE2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3N0cnVjdCAqbW0pCiAgKiBhbmQgaW50byB0aGUgaW5vZGUncyBpX21tYXAgdHJlZS4gIElmIHZt X2ZpbGUgaXMgbm9uLU5VTEwKICAqIHRoZW4gaV9tbWFwX2xvY2sgaXMgdGFrZW4gaGVyZS4KICAq Lwotdm9pZCBpbnNlcnRfdm1fc3RydWN0KHN0cnVjdCBtbV9zdHJ1Y3QgKiBtbSwgc3RydWN0IHZt X2FyZWFfc3RydWN0ICogdm1hKQoraW50IGluc2VydF92bV9zdHJ1Y3Qoc3RydWN0IG1tX3N0cnVj dCAqIG1tLCBzdHJ1Y3Qgdm1fYXJlYV9zdHJ1Y3QgKiB2bWEpCiB7CiAJc3RydWN0IHZtX2FyZWFf c3RydWN0ICogX192bWEsICogcHJldjsKIAlzdHJ1Y3QgcmJfbm9kZSAqKiByYl9saW5rLCAqIHJi X3BhcmVudDsKQEAgLTE5MzYsOCArMTkzNiw5IEBAIHZvaWQgaW5zZXJ0X3ZtX3N0cnVjdChzdHJ1 Y3QgbW1fc3RydWN0ICoKIAl9CiAJX192bWEgPSBmaW5kX3ZtYV9wcmVwYXJlKG1tLHZtYS0+dm1f c3RhcnQsJnByZXYsJnJiX2xpbmssJnJiX3BhcmVudCk7CiAJaWYgKF9fdm1hICYmIF9fdm1hLT52 bV9zdGFydCA8IHZtYS0+dm1fZW5kKQotCQlCVUcoKTsKKwkJcmV0dXJuIC1FTk9NRU07CiAJdm1h X2xpbmsobW0sIHZtYSwgcHJldiwgcmJfbGluaywgcmJfcGFyZW50KTsKKwlyZXR1cm4gMDsKIH0K IAogLyoK ------_=_NextPart_001_01C4D1C1.8C2FFD87-- - 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/