Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1029194pxu; Wed, 16 Dec 2020 23:45:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpFCu9kSo5jHHvZGKSEJCobtpox4wzoj07RBsnV4h6LoCwF0S86NRLIBpHlwseFkjrC5vT X-Received: by 2002:a50:d4d9:: with SMTP id e25mr37664485edj.243.1608191110633; Wed, 16 Dec 2020 23:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608191110; cv=none; d=google.com; s=arc-20160816; b=cwAqAcLHk9MwJUzr3xz0H3NQxRMumuCCqPpx38gdNqPjt1DVAxf/Wz+nrq9lCZDkPW 4gAUskd/HcyyaAmG8b55Rr4OC+o5JsUuHoHNEKqtNdblIAJAwYCuH0wFp5qyCGyNapMc L0RuA+hGaUvQbuB4LMxxweVrgXTi9Ze7u4I8joZUMBTHKmU6RwgfyrzJrzHpdofr5noH lCc6Km8QKCl7lottfsCvvDeK/1FYi6kIyBOhzdhiTK13qvsBVjkmIE9fg9xu4Abxaklg +xCwE+lI43P9hHBl7LP2Ii/3Y78Abl5UwQuGUZBHk+8X3qncRkiQtCbFgEAPdOlA8e+p yFkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=TWzHdyMfc0thY5qkjgUIgtxlJpXx+ozEUZmoTQ+ig14=; b=H/gU0MiSL6Tpz699F+2grMtb5PUNdWDZyZ9HIEasAmaupRoZR72JgwHyvN6UzmDOpJ 9qpg5uNwttzG0WslPgmzybMebXGuQZ9QnEJtNJftb40O6L+UQkTML23TyrKRefcRROxa Izvd0ZRK9sWjSQ+p25KWRluBr51dOYbUWImApnmCKVaXLeUw5AvrPRw68XLLNeH9Dptk tezSHAdajThjvIkExGWAwFDvFoAes7YghdDJqM8JYCDdzNB7oNAG/dEOAzGv4d5A792s JOLcqL6tixFAS1a65ObnMWKRKafM560KcT8u4vArio5IbfNcNJp3P9nJ9KdYfDA1J7j5 dYVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=naSuP99y; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp13si2276420ejc.376.2020.12.16.23.44.47; Wed, 16 Dec 2020 23:45:10 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=naSuP99y; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726416AbgLQHmq (ORCPT + 99 others); Thu, 17 Dec 2020 02:42:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbgLQHmq (ORCPT ); Thu, 17 Dec 2020 02:42:46 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A040C061794 for ; Wed, 16 Dec 2020 23:42:05 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id o19so29313835lfo.1 for ; Wed, 16 Dec 2020 23:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TWzHdyMfc0thY5qkjgUIgtxlJpXx+ozEUZmoTQ+ig14=; b=naSuP99ytzw3v3MSWnPwWl/cQ2eBIEyTX3UfovKp7yGGybv45FyW14ol8oPypiqyFa IDRU+UO4PnZg7gs6KZ1qjv0MiDuKNqapooOEA9neTyT5qzhXoXVgHKPKQcgFeT3S48yA YI3n2i/ydfCeckTFmIpfQF2xIRUIIyEfUB3CYx7ypqLxK19XuDxJc0z+GF4c/eGNbrBI HaXLMt0JrPOLuemsuBgikr9jlqjEMuabzlPMBvGICzd725rb8VZ8mr6mRoUn0uqL0O1J sPN4lK/sRETvFReW3GszDEIxzHyuMyPGe6H1dq8oGZpGiUGYvkqIxMevOPcGFR6cr1n3 7YyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TWzHdyMfc0thY5qkjgUIgtxlJpXx+ozEUZmoTQ+ig14=; b=J23U3J8g3dvJVnH4+MAtulIK8q0cFhKX2CgyDbTSDGApEDKCDfVpfpGbFpWpx2jtCy Ce8z6Y9imLSoIr3k8PoimyW6QqLIjKxSdBqQepTUfz4nJ/u3poK6Z2MW0uJeXR2ugOzd L3oZNnHD3SI1jfCRD4H/YYpPSKwK0HQayQsG6PBkHwcum3uTVdGlcUyVUeE3mqI8yag9 iNOMJ7MYJ1Sj4jxfUfrHADIf7BeAkVvBcdie5gXDRYWsvSI3boUwdfYd4g9uMue8Dz7w DyX/GXFzp70hzTpJ4B26sxureCyZ5UDS6MZBsadQVVTw9Z0k/bg/NIuvV2TxCUHDvMrD MPJg== X-Gm-Message-State: AOAM533NDEj8JA13RmPxVRQVyxKZTRq4YQN6+gPN4HCkPcW/5rtP3Z8M EbU8aKHZ+SFvfVW7dBiO0j0= X-Received: by 2002:a05:6512:248:: with SMTP id b8mr9749590lfo.371.1608190923996; Wed, 16 Dec 2020 23:42:03 -0800 (PST) Received: from grain.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id o21sm495160lfc.153.2020.12.16.23.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 23:42:03 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 248B61A020B; Thu, 17 Dec 2020 10:42:02 +0300 (MSK) Date: Thu, 17 Dec 2020 10:42:02 +0300 From: Cyrill Gorcunov To: Keno Fischer Cc: Linux Kernel Mailing List , Andrew Morton , mkoutny@suse.com, ktkhai@virtuozzo.com Subject: Re: brk checks in PR_SET_MM code Message-ID: <20201217074202.GD14556@grain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.6 (2020-07-11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 16, 2020 at 08:29:30PM -0500, Keno Fischer wrote: > Hi all, > > The code in prctl(PR_SET_MM, ...) performs a number of sanity checks, > among them > > ``` > /* > * @brk should be after @end_data in traditional maps. > */ > if (prctl_map->start_brk <= prctl_map->end_data || > prctl_map->brk <= prctl_map->end_data) > goto out; > ``` > Thanks for pointing, Keno! I don't remember the details right now, gimme some time and once I refresh my memory I'll reply with details.