From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (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 D03BC279358 for ; Thu, 2 Apr 2026 13:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775137878; cv=none; b=Y6Qm6s/b1mZL8E/inUayVTmxbmNC9gCZSMXsX41jYeDLpiHs8S1yazmzPSJORGm/d1LpNgmd6H+uTDE+CkgpAQa71sVxTmkrMguATMvom3DEh/n0Tw4RCtVKneQGJx/WL1UCMvzntRqxTkvVOm2H5/HL3Ytaigcr/REDs0QucGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775137878; c=relaxed/simple; bh=fVw4E5pMlW7YLFj6rKjJpIxFsz5CcZWhGAYC/AIsCUY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WaLsO1mSVZTMYY9FruO8R7KdVJ2Y24Z+e/EMqjFJLQr5i7Dzx8AqxeeVKkeic1m2UUbGuXEb+tL5TmWG5PLXripVjHLos3d6F/hbEyowfiOpJou3SC2BJEDV9XHWPMRpptzw9Ojv3/KQCw5Q47TxoPVrgj93aP6FrcS+w6cEA6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jeNo2lZn; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jeNo2lZn" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-35d9749c26dso705156a91.2 for ; Thu, 02 Apr 2026 06:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775137876; x=1775742676; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fVw4E5pMlW7YLFj6rKjJpIxFsz5CcZWhGAYC/AIsCUY=; b=jeNo2lZny+Ou0hTRd49DH/vqOcqkgDIcmwoe1EOK8EC+6RMuFL6FWOxeABvppHk8Uu +FViBb36Tjq6KCz/oI48EIYat2zT5jhx/J9LeIgZW9zPgKbA6FVWBwiCplCSJZqPKDnX jLXmotO4dQqQqeDO6ttqxYy7g/yAPhPY9Vdsr+VVzaNRseoPvquVrUEyGjsKABdK9BTG pulx71g7qtOQWm3aa5dqOimFgpNSLaNX9/Yg7pnfDOYN2ABhdKU3DtyTxpLY5JtquCP2 V1pYQjSj63oyhfEScG5Scni0HxKfIxGG9KQuRhabW6wQ1fvDUQE27ydQwaHvAZIgVqcg zYRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775137876; x=1775742676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fVw4E5pMlW7YLFj6rKjJpIxFsz5CcZWhGAYC/AIsCUY=; b=Kkmskdsb1k0Q0Nl6kE5BUzsMqg46LN1zKFNZZGO/8n+ui2aHyFQHjyMX8dl8EJFO90 E3LUDNNgisLT1LQUJO87VJkFgjQTXPqOJpFgpVC1NLt8X6t7gubGoBJ++ZhZ37Ww85T7 ZtgWHv3O4m5ME6aOHOh2go5IvinnwOG0Lz353oNfVaFza4YLHEv5ntarYE9EEhXwMHEJ ubaYhNgKZnuIYGqGu5WF1ez09Uwxol7la1ASBATb8jgujB8MTM+QaDlblAXeDXJ1dLeo o0JoKvpS7DlqdS7EXayEfEjCQaCCGOceZpylEmuyPkXun5rcEChLVi6qN+tuhkGnOnR3 IUwA== X-Forwarded-Encrypted: i=1; AJvYcCXMQk039ocAcDuoOIHhryNQCAUXKXvHW6W3CvKYU5g8tdzzcdpdtxZmCuBUftYa22VEnb0y8UgvhvWj13M=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/96sKw4jmRUJWg5FKpxIwtZpW287GBxSGJj4FuRipBYxDW8H5 dE7vPhMA+C5iDfnx4beVu2ch+Ti+P12n1yWvi0FkGqg0VAc5BcxoagjX X-Gm-Gg: AeBDiev+JK5+HVXN/EF9lASCFX5vtfPgmGaR+yJXs84inKAKcaun2JyYedPOM9bCMoO Q7EdpP/RDOHSgd6V5Gf/CmXzUJKTUxZEGClVR5a8jEt11Z3dEf/ri96yhHMNC6HxWPeaGYIIseB g2WrsnOcp1ymmaQKsnXnD6oapsgAuRKUah61TndYv5k+80bXb9ZCDnRvP8oqJbAUtPAxFaPhSTO yWWWxnC06p5xqNUdIM3psiQ7DX+TOZ83FsGTWtCqqF3zQvwVA0TBXJ9GDPL+mmpp901c1iOP+o0 tWN7K+rplBBcswc7Ps+VHqXni+Op6OiO6bFMeWllOProeWNxjOaDbA1+rEA4tyO7GlEmxwXLJJG Bco/nn0qw8N1Fax5Ysy12IpTVGZIVhbQuxFyU+LhTfPLJn7Y7ILFowFAD6ZbdqE9dKwu2l+ebV/ N8/qX1PiR19+o/ocJi1n678orgHB9vJBQ8JBI= X-Received: by 2002:a17:90b:4b09:b0:359:3426:c60a with SMTP id 98e67ed59e1d1-35dc6e77ec8mr7364672a91.4.1775137875847; Thu, 02 Apr 2026 06:51:15 -0700 (PDT) Received: from localhost.localdomain ([47.236.127.140]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35dbb9abc28sm2840001a91.11.2026.04.02.06.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2026 06:51:15 -0700 (PDT) From: Qi Tang To: Lorenzo Stoakes Cc: Andrew Morton , Cyrill Gorcunov , David Hildenbrand , Oleg Nesterov , linux-kernel@vger.kernel.org, Qi Tang Subject: Re: [PATCH] prctl: require checkpoint_restore_ns_capable for PR_SET_MM_MAP Date: Thu, 2 Apr 2026 21:51:07 +0800 Message-ID: <20260402135107.80152-1-tpluszz77@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260402111332.55957-1-tpluszz77@gmail.com> References: <20260402111332.55957-1-tpluszz77@gmail.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=UTF-8 Content-Transfer-Encoding: 8bit Thanks for the detailed review, and sorry for the noise on the SELinux angle. file_map_prot_check() still enforces PROCESS__EXECMEM, so that bypass doesn't work. You're right that gating the entire PR_SET_MM_MAP call is too broad and could break existing users that only update harmless fields like arg_start/arg_end. The intent was to address the case where exe_fd is -1: the existing checkpoint_restore_ns_capable() check only fires when exe_fd != (u32)-1, so updating mm boundaries alone has no permission check. As noted in this thread, the man page also states PR_SET_MM requires CAP_SYS_RESOURCE, and the individual field path enforces that, but the MAP path does not. Is this inconsistency intentional? Qi Tang