From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) (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 3F6B4434E42 for ; Mon, 6 Jul 2026 18:06:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783361213; cv=none; b=CGfmuqgwxznop+EIPfvQg6UgWnuCLSf6WkFVQbFL6RWUXhcRH1FUw2sv+ILX6AmyDr1I4yOmhMCjLfh5AeEt/uKkWjKWazwB6xP153aK/ymiY7ygcp8fsljbz5dXt8k31ce+c5ki/pLaqv+pzUbBoG5AQABhRaUqo6YCMkrQDwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783361213; c=relaxed/simple; bh=FHNE4Rr13QpicQ2BOguSldKfvwLiqktREZMUSyCQUhM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=f6SS2xl05cqe3JZ6vFtBP64WNc/sFWklKcLT/oBTY+Nzo75bw31SnrNP0Oh9M2CggvuID2JEXTpVZuLHUEBEX3uLMZYUHtpqRyIFeQzOyMSj9IY5UK7fI/cHK+DM5f9DaeDRJGqKUAPlW0OQQwxLRXaxCGmGuueWkg0Celb2lUE= 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=o08eiW6c; arc=none smtp.client-ip=209.85.161.51 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="o08eiW6c" Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-69eb8b6bea8so1402298eaf.3 for ; Mon, 06 Jul 2026 11:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1783361207; x=1783966007; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=+wOhom3Ia3T2p7xfHnwpv96AaUoUVr6T4F3Q4Bb9GK0=; b=o08eiW6cHATeazIZrK56MzaaRQmu2T78/ukSMILogzW+/mBQdpW14xu2RvJDDa2R92 KqTNuGZJlZr4mEWsNZ6N5AJ2VfuZqMvbnP1VnydOKBUPVu9ss/VmYTnfQhn552rN18c4 2cl4h0z0bgYtLiSTr6mARtxKSj81CZwAobrFapzCa6q/hQH7iyshzYS+dGhiua43TeWD 5SijWneOu/fbuPeG+B8E2DHb1RkAc2zy6u6QlLZenDTMGft+jHqhx3lHyOUmHQwG/O3T hdPgy+8sOViVcqnCbBImESZsKvU4dAezb/0c2BassCO8d6izFffNhTIcmWwd773eSIIr x/UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783361207; x=1783966007; h=content-transfer-encoding:content-type: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:content-type; bh=+wOhom3Ia3T2p7xfHnwpv96AaUoUVr6T4F3Q4Bb9GK0=; b=pJdbpbHKzTSH+LJZZmwHluJdOtLABgQ1j7wDUyFx0VlB7ow95s9sGc7X7H6mPyOCPX 9lsqxdCD6DUlFFahYzT+11w9zycrmk32J+PenBl54tsyt2rEIk6Jrx8UEixyXIek8xYj NCc5/CWBLDuDwfJFeSV2WQoRu6fLXwtau+a10quq1ttbiVbKJCbfQkJNA1OHSb+0Gso+ 049nFyaoyuAipzngyqnyaT4ZcDYyvAlR8hgczqJ+9lWY4V0o8AGSlpeqvvp3I8rHgQDk GY1Dj+eoWTRqtz3hF4y0xiRV09RxKheSx7pZNu0hLeZ1Dac7IN6knMthXuQ/2LoAxdWk fLWQ== X-Gm-Message-State: AOJu0YxrRzjUP4on+ckUJmkUcNTYVDb2b8iddsQlyztHeKVd3LEbMSHb TIyCbyLwEewEGK0sGErEI4YNSNZGXaEMt0CRLpfgZPANaol3lQ4bqF0x+R0cbGaIZaY= X-Gm-Gg: AfdE7clAth2ts9SzpPrbqkBHYTqSJgC8bz0oSxTahBO/5pT1ddQQS0jcD9/cm4LHLtV y7heyf23w/VDYibIR/u4EGYiOBdaRpvaTU1s9sh1WjS91HyNswyusKXOVNd/lEQhImMDgob5+HQ hbTCaoNFGDqGzN6kt2MQ+HkTENKsstFT3kZfHZ1YWQ1xvLnlvho7SnOzUiwuOt/E9ZcSB9srRL3 QlnQdv/jjdqsAlxOLfBBB1mt7L1zYlOoQenBpIvsNZ3cXi7rj5sBUX41Y92QIOQDMHCGYPXYk0k 0VNhOYfEnkd4N1DKz8Q1N6As4IGeqBHxjNUT/lOn3yChVXgQmJkhkKMk/evBF+7V+LTt96A+j2O Yxvkg/WIocm7rTrMRN/Sg4joYqdUFLI9/bvvGejEGgt5Blp6P5z7zUJvbid2pxIjKlIK6gWI8EJ lD1GzO36XREIVBbvCoQD+1O1l+jgKkGJi8XRoUqGl6oEkJtHTAxkZaX2nimI7dDV4tCZKPFro= X-Received: by 2002:a05:6820:6aea:b0:6a1:8192:4d89 with SMTP id 006d021491bc7-6a3552ae6d8mr1096869eaf.29.1783361207152; Mon, 06 Jul 2026 11:06:47 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-44cfb1c8092sm10961841fac.6.2026.07.06.11.06.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2026 11:06:46 -0700 (PDT) Message-ID: <12f15437-4bfe-43ea-af9a-c10d20fe3e3b@kernel.dk> Date: Mon, 6 Jul 2026 12:06:45 -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> <92f036c0-2759-417c-b912-8b6f003bc390@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:46 AM, Hao-Yu Yang wrote: > On Mon, Jul 06, 2026 at 11:39:14AM -0600, Jens Axboe wrote: >> 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 > > OK, I will send v2 patch first when i wake up. And I now my PoC to > trigger this KASAN have became a exploit can use to priviledge > escalation. I think i should send this script to your email? (not > included any public gmail?) Like I said in my original reply, there's no security concerns here, as the code in question is NOT IN A RELEASED kernel. It only exists in the 7.2-rc kernels, and the kernel documentation will tell you that unless it's in a released kernel, it's not a security issue. -- Jens Axboe