From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 CDC1C379C53 for ; Tue, 7 Jul 2026 19:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783451448; cv=none; b=HWiIkbNMtq/boAl6kRwXpUwR4jSWNeBl782Lvvg+qmE9aefvyeIrUtVF/Zbje05N1AFO8QJeodCGZjZhoMZUVR7UG/0LaGatCNyChI/YJ4Kp7zED8/lg0RDAAkWju+Gs52BffTfTbvBj8iCuxdEhnNxIWbexsfapv+HFF5mFiHc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783451448; c=relaxed/simple; bh=6QIPcqi/hr9Q5Mw00FYk5D293PSOJwYSWX9mfItRy44=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=IeIXavrQ/Pie2URawnz1DZkmzRpa5Kt8YRe9II5pkuYNa54yI5w+Q4MMZhH/gFiXssDdiG8ru74l0GCFjURcdEGnO7GefA/H8obLN3zrAd45sI7cKW6Z1ewH+MAweb9+6DSRP/G+nUyyCQlHcey0mQZqWn7bNYG2JIJVy2dD7YE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=c+BA9des; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="c+BA9des" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-8ef1dc934d1so9585986d6.0 for ; Tue, 07 Jul 2026 12:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1783451446; x=1784056246; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=2LUpyADyWOfmSP2Gd0K/OIW0oeVkcwDMQQoPjYwT+FQ=; b=c+BA9des1e1uFnmqACzRnsVP+9gsL0iFDlEeHo5Ts1RVfRBQDtDTENqR8mqNBFQjtb BjW9KVwtSLpakQSpiJ8C3+zMwD35VIFTdTDJyoGxalj2MswXSjTG6WnKquZTUS+bR59R Emtjkol631c5jbD0JWshZ84dOnr8UN2RdPSrKFnUbBj3snPZvFNrw9zfzgE7XFhiHZ17 CVLmIZauLKJo7Gic5PSOzGE+urEF9a8p/Yk/ZePgyP4Y3cyiGqL/ZZJPGAzWMJsGlBHr Kt6UmOpaPZBC3qc0PCdxWBlaAzfyAVwPVtLZNOxrdhDZVy1QW3CVR6xypPXyQSxetDMv NN4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783451446; x=1784056246; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2LUpyADyWOfmSP2Gd0K/OIW0oeVkcwDMQQoPjYwT+FQ=; b=Ru7MZJgf9LSiIUKNDIF26jcFucr6q4CyxZDWviDjEtL2OZDTkTWalWO8soCOSXWcCh XDXmyP1u93U99jqlG7ilDmfSS/hZWSACjcy0E9hY4DrCMZk8j16cgxfNRJJFW324UDUW eNdIic1v5sOV1JIC1kUxrT3VylLWPbLzAqG/RPND/2DHkmPsOic2gQmgfhWFG6fpfa0Q MHm/guETehUUSkuzdCuTh1sWqcuA1xeh6e0EQFofbFis69MLeYHrw5dJ7eUgiG64GEfc 5KKq0EtXKMI49wrlnNXdVULitGb8vzMDqWhQb4qZeLuqJtuawDIEZaSMQ+XpT4CT7AGV WMpw== X-Forwarded-Encrypted: i=1; AHgh+RqTS+AI48AgwdAL6F8AvwXnTHPLPoBqriHs18jLxrWN8Rp164MKjumk1tVj7wVUoWz6L0SqGp/mbqmVagU=@vger.kernel.org X-Gm-Message-State: AOJu0Yxmpy9xg/nptSitQnMEiuIzLSWMT7PGi3u45QdLBHXibxsceP+r PBS+QeKwYNYkHTLxQmx/dIYu6nH1TsSM2yGkRzfxa+L1vEaG6noqEpdv/o2FucS8Gw== X-Gm-Gg: AfdE7cm+Rgy8RDsduU90a95ne8kNF1/eO09QgxkG6p9yJd31iEa5KYvQRLc/5o6AHH2 eaknhxyig/ejq1i8MjNZmukvWy33rDHXGkoZm2R/lOjDl7etA3jZL8vTrKQyj0J0Ck4QFlRr17H yNfxWc6LErG8ab6Lm5SmoumtR0xocniTyhZfh7YDPJg6cfqsoZnkN8UHEsrS3WKYkTdDzbh3+tK V3NpFt2GPQGLaOlk+mrK1D7oQXCYPgN1plzn7/zIB2Udjk6MUiiYwMtYjuS//YvNQbeNivd8S6E nQF01rh49E+NTGrB4qnMjG7rUqee9LMGojJ3UnnLHMZrLEkVEhBdrkytnSgxCnUxdcVjZQEy5Eu n8Lg9biyFx4orBprVARUf5EayuMDxbUlpWO+kXX4ERbnkNqw/Lw9JPnNBBaUNqojpWgrGYX02Au /4/XdqdUDqkaoKSIIbv5GRfrgh7RHc/B0xtueqzBuKrViOyLPjtMD3atW/pm30LnIqsM78 X-Received: by 2002:ad4:5dec:0:b0:8f1:4bff:24dd with SMTP id 6a1803df08f44-8fd71be1e1cmr41525216d6.5.1783451445824; Tue, 07 Jul 2026 12:10:45 -0700 (PDT) Received: from localhost (pool-71-126-255-178.bstnma.fios.verizon.net. [71.126.255.178]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f4724ba6fesm165735406d6.41.2026.07.07.12.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 12:10:44 -0700 (PDT) Date: Tue, 07 Jul 2026 15:10:43 -0400 Message-ID: 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 X-Mailer: pstg-pwork:20260707_1504/pstg-lib:20260707_1258/pstg-pwork:20260707_1504 From: Paul Moore To: Alice Ryhl , Serge Hallyn , Jonathan Corbet , Greg Kroah-Hartman , Shuah Khan , Alex Shi , Yanteng Si , Dongliang Mu Cc: Miguel Ojeda , Boqun Feng , Gary Guo , "=?utf-8?q?Bj=C3=B6rn_Roy_Baron?=" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Jann Horn , linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Alice Ryhl Subject: Re: [PATCH v5 1/2] rust: task: clarify comments on task UID accessors References: <20260703-remove-task-euid-v5-1-c90c7e2ddf54@google.com> In-Reply-To: <20260703-remove-task-euid-v5-1-c90c7e2ddf54@google.com> On Jul 3, 2026 Alice Ryhl wrote: > > Linux has separate subjective and objective task credentials, see the > comment above `struct cred`. Clarify which accessor functions operate on > which set of credentials. > > Also document that Task::euid() is a very weird operation. You can see how > weird it is by grepping for task_euid() in the history - binder was its > only user. Task::euid() obtains the objective effective UID - it looks > at the credentials of the task for purposes of acting on it as an > object, but then accesses the effective UID (which the credentials.7 man > page describes as "[...] used by the kernel to determine the permissions > that the process will have when accessing shared resources [...]"). > > For context: > Arguably, binder's use of task_euid() is a theoretical security problem, > which only has no impact on Android because Android has no setuid binaries > executable by apps. > commit 29bc22ac5e5b ("binder: use euid from cred instead of using task") > originally fixed that by removing that only user of task_euid(), but the > fix got reverted in commit c21a80ca0684 ("binder: fix test regression > due to sender_euid change") because some Android test started failing. > It was since fixed again by commit 65b672152289 ("binder: use > current_euid() for transaction sender identity"), which uses > current_euid() instead. > > Signed-off-by: Jann Horn > Reviewed-by: Gary Guo > Signed-off-by: Alice Ryhl > --- > Originally sent as: > https://lore.kernel.org/r/20260212-rust-uid-v1-1-deff4214c766@google.com > --- > rust/kernel/task.rs | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) Merged into lsm/dev, thanks! -- paul-moore.com