From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 788CC3164B8 for ; Sun, 25 Jan 2026 14:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769350608; cv=none; b=CLOL0m5tvhZlJZZKFdJU/taaN/I9nkCNWR/cpmf1hVK7hj74+v0NmPP0tl7rhAADFUifqwRyHPF5cIOVw/SzO1h0t4ujxlZlB5N4XXcNim0e29tFdwDgfhbQGxn+UK2a+P7Xyz4Cq8n/3X0yk64hfmA6WjdzOOJGe+tICE6AgVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769350608; c=relaxed/simple; bh=5jwbZukbJ3haIhe/4S7dFzNov0IdTCPoFe/yvHsnr5g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nq6Qv3GXTke/Yn+m4Qw9OhBxLrFSAIPkJmlyJxPa0XE9tmJ6dVb0NPLbwjC1LOyTmq19nImqukds+yFc83BGSnKdPYbR5AfsTyTsDwTTRRApfHIsenzT/t8KOXgSkj5KihUi3vVGdyIZnQVgCzfUXvbrCdqDWO8kMuDwniehNpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=npsBxcgl; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="npsBxcgl" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-45c958d480aso1096939b6e.1 for ; Sun, 25 Jan 2026 06:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1769350605; x=1769955405; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=y1RxQAAHw9tRpFPuhCeNDywtO5xFD3YInBr/d8D8Jxs=; b=npsBxcgl5jm4Zzrz+n0TA2BQpLzrQGgQhdgbAjydhpMk7SJFSftA6nDPc9l3JkEVMJ /1wbw8WP/yBsB8zSGaoWgf0YJM1ZJaYkPIhN3LY+Thf0C8PKIDSnkIlgJrLtJwVpvmo0 FjWBHhN8z7polaaLVSJ/i3D051gkUTlAtJDi7kwtHQDXcqjMDJ/odB582qpzeVjgKPtS excKb3sQ7xeoVSQpusp+V7zDQgrxMH4qPliLAcze8slg5nlU//+gtg8T/d32I5mBOyrs gWuy6WJ64DPV3e0Zsxrm4+La3KSXxyAS0/XBB/mSBLw86qE3o0RCMU4RKxhAWNe7URvl dLbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769350605; x=1769955405; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y1RxQAAHw9tRpFPuhCeNDywtO5xFD3YInBr/d8D8Jxs=; b=MVMzeeTmUUi8im3vYhRztxO8Yb1Mdj44fxdpGgjTA3/HZ0fZ+Eq5A784qRn5LlpwCF uSOnXESfOKrJoNqzTUv92BKkAGhybNMoukVM9BBDmznPkd0xdAT749wUq/z3QiZdK/L4 bggKCqm0GKk4W8bh1UAiH9dnfP4LxoGRVDMWqy1wRPU0B3Bcs8/xY8eOYjIA/ek3yDWV gUTxQAvwjZoQNPo7hrOgv5KPXERD3TrhBe6FBy/WyNofBg1IYWekjQ2rRvqxDagVR6oY hTZnkCseTtRsTJTNSkUPKLzADN8PNRchgLErdTeeeDKoGS91Q9lzfwZJrMBznlA2a9Z9 /WKQ== X-Forwarded-Encrypted: i=1; AJvYcCVD7WU0gL4m9wFAWamY1Rem8j/bz9db1qVycwGvIVCwc7woGg9xd0gztJYWc+W4uf55G/TVh4ce9A4dsbI=@vger.kernel.org X-Gm-Message-State: AOJu0YxMm1Y47kcGauV/eN/gvUT6Zey+yLk+psDbuHO680I14IOgB4jW NdRNUHpZI+F0XOPBfdgsAOw423//6xU9r2aA1s68eMYAMxhyPNmpjJJtFst6emRkLlunE+QzCfT fzYd6c3U= X-Gm-Gg: AZuq6aJnLAWQF8FXF565KjW7nMjO7tZariVNw3J0Pb9/HS5+maI1tgiIJuZHPopkixl PU4h+g3vpCUE2alLfV6W4RXxMh4jds0ZEk3zIWYnfjUu2gW/hLjKRVK0K83MWr2J1ToS3BbN7/K kTsLS09FFSopn0sYXLlTV9BqDVDpZOdOOKDAjST7LzEGBoGvsJ72Lfsa4Z2IbpsOoymSikio0DE iPMTtHHhjCv7t0ZSvzjqOvKCuVBV2cmj4OXYXu2aibPDut2tHJs+bFeG/d4C3nTiajz2JKoz/Ts AuDdO84NnbGX5rJi1p0orwW8uUdSVifbwfVc3NB0bwqpJfWlmoZW0vupgd7iWLtq7QwRGemm8/E wmjSyLmxFCP7WrKQKpJG6Y7uUGu7/DTpCOdaIS1cObz4AnykWronsxW6IuezKdz+llinRO12whi /2tEQw65cmpX/dWRQYaoYIOQ60qz7G8mI99MlG1za9Pq88hErRim5RF4RYS5027Av+JC9ZKA== X-Received: by 2002:a05:6808:191c:b0:43f:7e97:3983 with SMTP id 5614622812f47-45ed9a0af8emr653061b6e.41.1769350605114; Sun, 25 Jan 2026 06:16:45 -0800 (PST) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45eb411ffeasm4401728b6e.8.2026.01.25.06.16.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Jan 2026 06:16:44 -0800 (PST) Message-ID: Date: Sun, 25 Jan 2026 07:16:43 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] io_uring: gate personality per opcode to fix TOCTOU check in io_msg_ring_prep To: clingfei Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260125075302.621785-1-1599101385@qq.com> Content-Language: en-US From: Jens Axboe In-Reply-To: <20260125075302.621785-1-1599101385@qq.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/25/26 12:53 AM, clingfei wrote: > From: Cheng Lingfei > > Add allow_personality io_issue_def and reject personality use in > io_init_req for opcodes that do not permit it. This fixes a TOCTOU > window in the prior implementation: userspace could race-update > sqe->personality and bypass the __io_msg_ring_prep personality check. Please do detail what the bug is here, this looks like some kind of AI hallucination. The check in msg_ring prep exists just to reject commands with it set, for future expansion. The only thing that matters is the ordering and use in io_init_req(), which is fine. -- Jens Axboe