From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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 996FA3B7B93 for ; Mon, 6 Jul 2026 17:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783359558; cv=none; b=nnBiKXPDAooJw18P4AUV6EwAKYwxrmbpw1VyBxQhijeBR1fgFvmCwZ2N0DW4bKGDBh2JzTTgukfIzWlA0K9Vkjx0JqeOHAuE2Rdagj9qkmyc8ajG7TF8OGjv6Pw/bhZkQTaKmT21zeoa7us6AgsaM4PktfVrBCgvZfBtq3YaYV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783359558; c=relaxed/simple; bh=uYzpmj22orIyaQQ3zp02L3VmOBVttpG5qJbjF0MQIyo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YgASNigX4iiZgfJmMM5omrsRMR7Rer1ha3/b0mqmul/e75zUipBuETTmI2TRLfmjxE2U7aPWb1Dc7tL+Ub96VGO1SmUnuKE1IepUDj9wJdRAI1oPsOBHI24Qdo4Qw3S7pFzc+NHGECOZf19peDuus8+bnGIZ25fjtjcQHSjOc0A= 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.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b=ka+TCsPw; arc=none smtp.client-ip=209.85.167.181 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.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b="ka+TCsPw" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-489f3611e0cso1838499b6e.1 for ; Mon, 06 Jul 2026 10:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1783359555; x=1783964355; 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=Q2LV9ZLj19EGpD+IaiTun7+wf1a9LAhJH+7cuwQb1oQ=; b=ka+TCsPwjivsnkU2dxUEpmRZ6JO73ixYrhFGj7ixyWS33a4zX1ZqJOXqAhEhSMngZv URYlZIr+SfpesdlWezDXkz0MJedSK8Isu/yxOnUgKtq5MVka9h0GYVflPtxhBqf9XCpz /5h7vZIDMwUbnAFV61gHY1bMHGp2YHqO/2rtOL5NnhyetgEqJ9l3Ki9jil3SaUptYhX3 /QBxJbNCd+mm+2W1k4/ubF+zWNEGaDTMYuC/Uz5uexHMiWcZ36CkxFY8wdZN8SoHF2YR tLe2wpoC4yiDw88LOLUk5vbgBQIv5jx2vhBwgdGPIjin1GsIpPJo7KpgZa3ZC0qju5UZ xweg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783359555; x=1783964355; 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=Q2LV9ZLj19EGpD+IaiTun7+wf1a9LAhJH+7cuwQb1oQ=; b=cctsVsvK4obPCSRml+v9SNDsQfFEoJs56JNOBwjq9eQ3Os7Rjt8KojbNSxAZg188hZ x8YHTkOIMz7/of0pJ5vhpiLNU2h9FvUG36PLh4RZaUDWK4Tr4rTSYW4nyT2rHmpZHMJL TU0PoYnuFta7hXR1+BnmM5iAfbNGktvgujuPNC3lH8pqZanriZCUmPjk5hJ2UAqg1aj9 G1sZaoBVEy0XWhHL+IdSdCGmy5hTScLfofyMc8gG8ewSeBVuQXgB/ntSJuMf1OdDG4Rc jFA2E7tNB2+N15mXTFtueNPVfa0sSU3tje0v+rGHXmxHSILkSoUduJmgElVQKA9zmMXu 5tCg== X-Gm-Message-State: AOJu0Ywz8LbOXx08Liuqy9NreHHdZp7WqfxHMySahMYB3SkUKrQ/VZgx 0/tGpbAWuOjURBuuX0cj2lZZtRuXA1DPIZBnmE01V5yN3zX/WY5VIrBz5bu2q4DEHg4= X-Gm-Gg: AfdE7cnR1m+dr9kTHKocVnVmdD4e6rPsedX896wMqzsn5NkxiUN2b0o/UEV3yEaq6+c K5VlbskunudbmrNtklmI//lEk838CK4EgqeYp9bVjiocnsKBgg9CK5W5gI5XQbx43pFTgyw+JnE D77N7u0TryCLV0DTTZ7mv58HqJyZeK4CezJP+Ad3Pfbh7P6Xm9G1gkNN89alNYh+Eozz/hw9Jib m9r+Msir83SqF41EM4WXZ/UnfwXCWRrJE286d7TW7QBbMy+P+V6WteG13Eg+U1esdzPlLXQXMYq fu9CAjnm7e8sw+C8NzcLaQah9u83oD04k/QkNpFNrhOVRkCCjnsHKYLh6Gn0nhf+D/UWJvHtufv gkZXwspmRQRR8CJrH2f/D8YkxidfEZf26ez9FjmfvBkr4jL16dEgsj6v2bYOqPMFcH2t9iQLeNa aDOCWe+WUSknI0t/RhjGi1OMrkpZvdG5ihGjRsgqUJg0EaXtQpyPbkyHK8g79WpHihy78UsQjt3 z6UoUKZIQ== X-Received: by 2002:a05:6808:6f93:b0:49a:8f0d:cdcf with SMTP id 5614622812f47-49fdc871dd2mr1317931b6e.19.1783359555652; Mon, 06 Jul 2026 10:39:15 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 5614622812f47-497d1853afbsm9484686b6e.8.2026.07.06.10.39.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2026 10:39:15 -0700 (PDT) Message-ID: <92f036c0-2759-417c-b912-8b6f003bc390@kernel.dk> Date: Mon, 6 Jul 2026 11:39:14 -0600 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 v1] io_uring: fix dangling iovec after provided-buffer bundle grow failure To: Hao-Yu Yang Cc: linux-kernel@vger.kernel.org, io-uring@vger.kernel.org References: <20260705234534.768138-1-naup96721@gmail.com> <0a370728-f8be-4aaa-bbc6-276376adc5ce@kernel.dk> Content-Language: en-US From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/6/26 11:34 AM, Hao-Yu Yang wrote: > On Mon, Jul 06, 2026 at 11:13:55AM -0600, Jens Axboe wrote: >> On 7/6/26 11:01 AM, Hao-Yu Yang wrote: >>> Sorry, i forgot to cc others mail >>> >>> I discovered and wrote the PoC myself. Trigger way is >>> send1: Submit an IORING_OP_SEND request with four valid >>> provided buffers. The system will allocate and cache an >>> iovec array (of size 4) for this request and store the >>> pointer in kmsg->vec.iovec. >>> >>> send2: Submit a second send request with 8, and I set >>> the fourth passed-in address to point to an invalid address. >>> Now kmsg still hold old iovec, but old iovec object have >>> been freed. >>> >>> So this will lead dangling pointer. >> >> Side note: please don't top post, linux mailing lists always reply >> under the text for better readability. Top posting turns any kind >> of threaded conversation into both a mess, and it's also wasteful. >> >> Great thanks! Want to turn this into a liburing test case? Then we can >> include it there as well, and it'd catch both UAF and memory leaks when >> run. >> >> -- >> Jens Axboe > > How to turn this into a liburing test case? Should this be included in > the v2 patch? Look at the tests in test/ in liburing. Or just send the reproducer and I can get it turned into a test case. Should be separate from a kernel patch, it's a patch for an entirely different repository. -- Jens Axboe