From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE504C433E1 for ; Tue, 28 Jul 2020 14:31:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9EB49206D8 for ; Tue, 28 Jul 2020 14:31:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="vkMbbZV/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EB49206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 287106B008C; Tue, 28 Jul 2020 10:31:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 211586B0092; Tue, 28 Jul 2020 10:31:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D9406B0093; Tue, 28 Jul 2020 10:31:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by kanga.kvack.org (Postfix) with ESMTP id E79706B008C for ; Tue, 28 Jul 2020 10:31:31 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6B7B0180AD822 for ; Tue, 28 Jul 2020 14:31:31 +0000 (UTC) X-FDA: 77087722782.10.berry49_4201aec26f6a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id DC84916A1C3 for ; Tue, 28 Jul 2020 14:31:22 +0000 (UTC) X-HE-Tag: berry49_4201aec26f6a X-Filterd-Recvd-Size: 5378 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Jul 2020 14:31:18 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06SERiHc170671; Tue, 28 Jul 2020 14:30:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=y8nRRhLN76Gwdv6TWjBbydsC8jIHLobFpUQt86BWPsY=; b=vkMbbZV/fcuVoPAdAm2bnVKwhjUpJrQeuFup74jUcdeMFSVB6NMvDDvMHSKYXPSlQuGZ q+vnDlQQJonIJRLOWE5PZnxfEEw+fM6A0EQ19EYLT30r5asL+xwE/rzdNesWu91snpuh akKWpVib71YeaHKh35MBFpSpdWbJj3ZAopIy+4wGvcxopkcl5uE4lpMgdA8KrOCwHXD2 j9NbZ3FCXMY0jAlu8w5KVQTJxwUR+PHUm99l0NsvT/xbqPXPHTy4ufinvEW5t1IEdm5H BstCBqpoE9y27OkfC6IbL0I9zMs9oRopKmCtuxJjqoPC9HARM4JkdEh6Uw3Ky9KWgjpK Bw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 32hu1jfucq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 28 Jul 2020 14:30:55 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06SETMwu090377; Tue, 28 Jul 2020 14:30:55 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 32hu5st7n0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Jul 2020 14:30:54 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 06SEUkvZ012418; Tue, 28 Jul 2020 14:30:46 GMT Received: from [10.39.227.185] (/10.39.227.185) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Jul 2020 07:30:46 -0700 Subject: Re: [RFC PATCH 0/5] madvise MADV_DOEXEC To: Andy Lutomirski , Anthony Yznaga Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, mhocko@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, arnd@arndb.de, ebiederm@xmission.com, keescook@chromium.org, gerg@linux-m68k.org, ktkhai@virtuozzo.com, christian.brauner@ubuntu.com, peterz@infradead.org, esyr@redhat.com, jgg@ziepe.ca, christian@kellner.me, areber@redhat.com, cyphar@cyphar.com References: <1595869887-23307-1-git-send-email-anthony.yznaga@oracle.com> <1764B08C-CC1E-4636-944A-DB95B81C7A8E@amacapital.net> From: Steven Sistare Organization: Oracle Corporation Message-ID: <54599ed9-99f1-378e-bccf-ba41ef1f8217@oracle.com> Date: Tue, 28 Jul 2020 10:30:41 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1764B08C-CC1E-4636-944A-DB95B81C7A8E@amacapital.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9695 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007280111 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9695 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1011 mlxlogscore=999 malwarescore=0 impostorscore=0 priorityscore=1501 spamscore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007280111 X-Rspamd-Queue-Id: DC84916A1C3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 7/28/2020 10:23 AM, Andy Lutomirski wrote: >> On Jul 27, 2020, at 10:02 AM, Anthony Yznaga wrote: >> >> =EF=BB=BFThis patchset adds support for preserving an anonymous memory= range across >> exec(3) using a new madvise MADV_DOEXEC argument. The primary benefit= for >> sharing memory in this manner, as opposed to re-attaching to a named s= hared >> memory segment, is to ensure it is mapped at the same virtual address = in >> the new process as it was in the old one. An intended use for this is= to >> preserve guest memory for guests using vfio while qemu exec's an updat= ed >> version of itself. By ensuring the memory is preserved at a fixed add= ress, >> vfio mappings and their associated kernel data structures can remain v= alid. >> In addition, for the qemu use case, qemu instances that back guest RAM= with >> anonymous memory can be updated. >=20 > This will be an amazing attack surface. Perhaps use of this flag should= require no_new_privs? Arguably it should also require a special flag to= execve() to honor it. Otherwise library helpers that do vfork()+exec() = or posix_spawn() could be quite surprised. Preservation is disabled across fork, so fork/exec combo's are not affect= ed. We forgot to document that. - Steve