From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6DF548A2CE for ; Tue, 5 May 2026 15:52:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777996329; cv=none; b=kXjt0dqkVOadZx00DWRmeap0VX/ZFEg7Nbot7bi60rntvaF249zCuPtvVA54WM+QoKa9k/TO+NCH3hobiyeMrqrDUwfxIZuC5pI1Mh2Er4yd4vEEs+zqDxnhdV7aOof8EjNIHqnwYYk1LWWv+/X4R9qLfuPNbjfgNyHnJJKeb7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777996329; c=relaxed/simple; bh=cOFYjOWZPOQi4PeWsU2WykKvgDAIhMD6gzzfUil46v8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GVsOYCHyAr5JXardKz0LfTvQKj6EXIfrmv2xsSBrBeZ+HTNsAG1VPmp4BjqrT2xVqhhKbkhAy4bq7+6Od7Qk97zo8fa60KLRqtL1n9iL86F1OXGddCee0Y/C3WHA57A3v5b1PNQBsEHqGc6zeDh25oNAtx3jVOOADb3YatOnFPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=FCkwxhuy; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="FCkwxhuy" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-8ef45a6d9dfso593567685a.0 for ; Tue, 05 May 2026 08:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1777996327; x=1778601127; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wLO+oFX+VEmAp0NkxBY3iUrTp6rCqh1ePNe0pTi1JJ0=; b=FCkwxhuyOTsyZB6EZjVzRU0BmvmoxUPAr5LwbgHicm0oMbEKdq9TPRTBsXxiZewx0N UbiLEAcGyNq1sM4VEKbEn2quj+RUoLcPZT43oLCo9VHTA6vpjo6f7TVdeN5b98CYmg8N tsXYuw7hsieKCRu9bLSHR7vaHD+vVUz0M96XcZdcxRlUEoABn1DOew8YXpYShvSbrdTo fTBtzmIpQ6MK+VL8aFBu3CVJRxxhrgQJDtQeeX/qGQiToxm5v/AJNFh/XANgEia8DFPI 3UJnJhXqV7GMnRkdw5EYphSI5ioJYyfqUJZHiUZCN2+SrsctLLTszrlnPXqwFBI9cyvu paow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777996327; x=1778601127; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wLO+oFX+VEmAp0NkxBY3iUrTp6rCqh1ePNe0pTi1JJ0=; b=ndP9rDyKfdBU6isajpwjFk86Bbuq28LitzmW0jgm5jyl7SaHo0tNGkct7gA/gWFfTb 0MwlnLmVEhi6dnUQXRIP+TpiWDeL2GaJUjbV2/+xyPfj5fpgfeasbcRgULHVbIYZcmUS le3tDC50F55sO0RTSk4I6YNcuQ9Vxqpl4p8axp2vLYCQhekRF8WrqOsVVNmBJJteDKYX WZTts9iAIN4jZn0V4s/piX10dSK93Z7S2K2LKWNxOiCiN7MIJ9gv8kqA7E4sBdtUF1Rw BpiVaqmvtRrLCUlYC8vheqWwl1BOmuHeDImrbmR6X51CCogEaaV7+Jx0s53/dW1MyHyO nX/Q== X-Forwarded-Encrypted: i=1; AFNElJ/0DrEQ45GdUmh4MIh3uHAItI8QvmS3yKogLpQfzGsRkYrvjf+J9oTZs8DMAoW1zqngxt28zYVGGg0ClZo=@vger.kernel.org X-Gm-Message-State: AOJu0Yxg3QcwHB60odEpxoqFvf8ur1+CoM+rVeDuSLdwY6C56TrDAS/x kUr8sM3vrLbv5TWLxEPoPRi5NNc51q023WSTu0NYsj9FbsU9y6lyoJ2xLMgkkP+z1rs= X-Gm-Gg: AeBDies8jtjWKJu+yV7MIyKa4ZUAvq6Lk0eplQmVX9Xwk2Vu3wNTS8cslZppsXzNre8 XAlzFQqeT99+KwdEDfBSk617sWXsc5QSGNVuCplVY/TI9b5ePl78ePQ17Gu9GiHXswOFnlA8Vnx 1wmX8DA+I1CJKp7FlFdBrZ1lFMXazsoCY+PzDJMczsTdzQF1AV/NlxSG0H47dFpSTR9eExrpb5L bEmyynp4i+dPBQr5xCSQ6Ay/QiqNfWZc1+XkMVhXurffdE/OvU6dFS2bIAosX3kfv+7cJOP4q/+ su4RReqXTpwoGGIOYFLhpnsBI5A6vpp2PNKkxFjRVFNUAz2vxguzlI8g0f5z7aqcNtOrqHoJgZU cUnsgJwaoCdxEGHf89gDF0KLpGbldYFsgFcZrG7T2akMMjbI6RJA1chJDyPpunvmDq31xSB5aje CuOaobSGEYwTQ7QHsX5dx7Pf5QbgvaoF2FiJNvS6PXlGVVmoLD0cjoiU9ZLzOyBx2FeduJbe9W X-Received: by 2002:a05:620a:1981:b0:8f8:5905:8291 with SMTP id af79cd13be357-902e4cbc8c7mr616480185a.47.1777996326739; Tue, 05 May 2026 08:52:06 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8fc2c91fb3bsm1353612585a.41.2026.05.05.08.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 08:52:06 -0700 (PDT) Date: Tue, 5 May 2026 15:52:05 +0000 From: Pasha Tatashin To: Hugh Dickins , Baolin Wang , Andrew Morton , Jeff Xu , Kees Cook , Pratyush Yadav Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Brendan Jackman , Greg Thelen , stable@vger.kernel.org Subject: Re: [PATCH] memfd: deny writeable mappings when implying SEAL_WRITE Message-ID: References: <20260505133922.797635-1-pratyush@kernel.org> <177799542165.635180.17809433268620237886.b4-ty@soleen.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <177799542165.635180.17809433268620237886.b4-ty@soleen.com> On 05-05 15:37, Pasha Tatashin wrote: > > On Tue, 05 May 2026 15:39:20 +0200, Pratyush Yadav wrote: > > When SEAL_EXEC is added, SEAL_WRITE is implied to make W^X. But the > > implied seal is set after the check that makes sure the memfd can not > > have any writable mappings. This means one can use SEAL_EXEC to apply > > SEAL_WRITE while having writeable mappings. > > > > This breaks the contract that SEAL_WRITE provides and can be used by an > > attacker to pass a memfd that appears to be write sealed but can still > > be modified arbitrarily. > > > > [...] > > Applied, thanks! > > [1/1] memfd: deny writeable mappings when implying SEAL_WRITE > commit: 73f496662a9848021e75742a69a3239ea850c3ee ^^^ Please ignore, this should be Applied to MM tree. Pasha > > Best regards, > -- > Pasha Tatashin >