From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id A19C068D1 for ; Mon, 3 Oct 2016 16:06:51 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id b201so83777622wmb.0 for ; Mon, 03 Oct 2016 07:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Qc9waBU8r+BtJth64n7Mqy06vCelbFTihxq+TsIwF0=; b=S0vvNwSSsIrFgeWVIBt6G5Z5IXM1b02Ht26UqpHhRIUJl55k4/jQEMXg1ektOS1dRd QXVxqr8em4tZ+KkJSG+tOSh0KXSZ+5tTsUyyamGW628arSxJCGnS0/aMRWcXoKPLLu8K raz+DhPTyExDlk4moDl/0kDPjFQ3QJVpJsX4lcZyOFiWXMK0EYnkHkTgycve9tA7x3Q8 3Z8uescuTemB7j6W5CEqZ0EPHl/2XvJ1AnryhY6FcAkQAb6rTJrwnAQFsCVQca4tCg/B gRinONbG4YGqMcglGlvLvQOich+k+dq8uyvM2XvuzL3yojzb2WM3/JgdLJHbElinaHdl kL4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=4Qc9waBU8r+BtJth64n7Mqy06vCelbFTihxq+TsIwF0=; b=Xw+J6HX+yh52/Tj78VB3esS43Xp/nJEyvQNX59ZJsS9LYVUTqiLGvUorde3F3k7b4+ cVNCOqvqkLFNX9f5sf2csJxCQPyOawl46xYajdHRXlqy/3ullkVnZ2Nf5PNxUyGkt7+C IiKVcnx6py1A86c0p2cqX2oslMJOA/+OA6g0NZ6NVF2w4Sx/y7xgyzLGNt6srxErPWmH 4J1aCELKGejugNkP7W+ZHmOh0TxUlyG1LIs/CEYdGo4iBQI7WNWUAzNsF/Nz7q6jHqQw CAGBoZfXLgOzz6RhfZE+lJ8BIGGsaGHnwivuUs0lKpPpxKx3lAlUc39rpa9+Lo3IX0CU jpTw== X-Gm-Message-State: AA6/9RmarV5/I5ZIYS2oyEQO8ln2VF1SFBp07izeJOWIkg9ogtaOWP+P6aRqRRajB06YRFXk X-Received: by 10.28.232.141 with SMTP id f13mr9095213wmi.69.1475503611435; Mon, 03 Oct 2016 07:06:51 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id n28sm19119042wmi.2.2016.10.03.07.06.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2016 07:06:50 -0700 (PDT) From: Thomas Monjalon To: maciej.czekaj@caviumnetworks.com Cc: dev@dpdk.org, Sergio Gonzalez Monroy , david.marchand@6wind.com Date: Mon, 03 Oct 2016 16:06:49 +0200 Message-ID: <12194979.gyyuPCJTAZ@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <6c2618d5-3f54-7c84-aa92-498461842f6a@intel.com> References: <1475059977-27370-1-git-send-email-maciej.czekaj@caviumnetworks.com> <6c2618d5-3f54-7c84-aa92-498461842f6a@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: fix crash on mmap error in rte_eal_hugepage_attach() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 14:06:51 -0000 2016-10-03 14:04, Sergio Gonzalez Monroy: > On 28/09/2016 11:52, maciej.czekaj@caviumnetworks.com wrote: > > From: Maciej Czekaj > > > > In ASLR-enabled system, it is possible that selected > > virtual space is occupied by program segments. Therefore, > > error path should not blindly unmap all memmory segments > > but only those already mapped. > > > > Steps that lead to crash: > > 1. memeseg 0 in secondary process overlaps > > with libc.so > > 2. mmap of /dev/zero fails for virtual space of memseg 0 > > 3. munmap of memseg 0 leads to unmapping libc.so itself > > 4. app gets SIGSEGV after returning from syscall to libc > > > > Fixes: ea329d7f8e34 ("mem: fix leak after mapping failure") > > > > Signed-off-by: Maciej Czekaj > > --- > > lib/librte_eal/linuxapp/eal/eal_memory.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > Acked-by: Sergio Gonzalez Monroy Applied, thanks