From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 9119E3D34A8 for ; Thu, 9 Apr 2026 15:28:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775748497; cv=none; b=WVuqDkJ78MXGEA4/SNBEPVNMl8GNJ5MJaMFh/FX00V2LIAE0U8P/lxNSd58vpo5WsmGDvcA5e2WG3g83Y/fNsjde6ZlktLffszQhMzK0gqfvJj8Dl4eMtwWdrY0FH2vg66XsIEdjLJIs4tVDWEQh3asQgqC7Di5DUkj4aZkesH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775748497; c=relaxed/simple; bh=5YEaSmY8unY1Fmy0wRi20aCnsCHSnS5xE/HbmAyT62E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=emZtBvX2xE2h4qsPhwlcvLX/1pB2CsFhnB+rgg/KKmMAVZ80AEPfUomV7MY8v7Lwx7fjwu+q9R6Zi0Tzkuv/OBdpWoS4dSIjvBms6dd9Ip5aGsqmQq6IovwTb8hP5Nb5oJrvcy1BO0FKbHmrjaYBuli/qGm0EWtHIdMNv9W6neo= 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=WZFzMhJf; arc=none smtp.client-ip=209.85.167.173 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="WZFzMhJf" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-464bba3a9easo503899b6e.0 for ; Thu, 09 Apr 2026 08:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1775748494; x=1776353294; 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=YOp8ak3FTEDXUJLajTWVJy0e9bkw0VrTeICwr/8Uur4=; b=WZFzMhJfk0j4TTalnUg3l0TqsEy9xK9aGulImpJD4Z+gCntaW4sQeAS9MlQlZXZGKZ nUOJ78uyOKqqbVnnAfwYGbNbT2Pu8EmemwXN14NfIwo+O8LVBB6yOljgolWxcU73kyrZ mjzxxKKKyJpLnyLTmuo/pWOyU1gSFGSD7esnyJ+NHA4MJ1C6cYbiFpZoaI3gE/YGzYbN 3nTIJVmb7Zfpq+WkEn9yeTp3QZ7gyiaQa3ccHZGPsYmGrAe4FF66aJswBmua6GCIj83l rKSz/HL0aEh/FPA/0oNDyms8Oodd8uj/xorKO8m7wDlnKHo6OqBrtYLJFYaUEWcXl6p7 NBmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775748494; x=1776353294; 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=YOp8ak3FTEDXUJLajTWVJy0e9bkw0VrTeICwr/8Uur4=; b=apJPXuC6b+JHqVLvm2VElDZk5hSsZfRyEdPrFNepeUkigQFrbyvBC5lvxZ6kF7xrAV vqDCtc/60I1V/8LsgHSTjt4Y+N92889BgHopdnf/IpCJVXp2RUN6DYZvgWNSCK8WSvSe C0uDz7Gd6W4nYwhWo2rrvjfOWWv4eMIBpXEKT0Vj3RuJRZJK2hmoQ8POOkco+YkYQvPI mSK4SF9T5NBB3Goim3v/2CwP1fBzd1LXZC193Gd4o52DnFGLQ+GMm3AgAISF3iwbdL5T vrpY+YzV56L+MTJSoxu4v4qoQKGFJu2b1rtdF/LCM2a4oNuVrF5akgl9cwI01rqhzE69 AGYQ== X-Gm-Message-State: AOJu0Yyw29qmM7+vV3i12HQh2XBcKIqGqHBfYu4md0LelyQor5D490xe U3Hb0J/9ALeC49nsl8fD8xHzwM16+P/cbthtMjjH+d4Xw28WxAP3K0W1oaDY62VduJk= X-Gm-Gg: AeBDies+X/g4z+oKYf6feXDzcqq5UoDkDznsAEdaa9G2b79XfcLVlc/F3/GYv84ynPk uFU1bYjYVbCFaU8FKUa8BbRIUmkYKbgjRAGsDciuXs/ey4IB0JIDsA9+my7VjsefYNC2xUKX8bV p18jjHwi5TiNru8mvFLh5tq6zQ0hSLGOh4oN9AVgOJzds7EtLqXtBC7ml4JMl+n+tCCN30JKJGO 7fSecNBESS4QP9YeRc75z7kzhp6J95DaxHXj9XuSXNqUZpTs9rBk8epMRToa1mpiiEkWRz0EnAr BhNWaqFBMZCtfswxflZ4g2VjF6evDnpcX1wnNVPohuh0qUuObA/VMpjmAmeKeBedqPb2pyZVPeA bh0LS7Xjcq6/czuEUhxhUkkaP7599FaobRnr5pRU8NP/rJSSGnRKWbid0/1WcGIRmlTFGoMNj5i mFI1VKkL3AuNHDYXrr1QSffdGNf+JrVHcMG+zDHAUgZ1meLxpPpfFWUgmZxuVXxT/sJXXecgdmj LbMcENw3Q== X-Received: by 2002:a05:6808:6718:b0:467:272e:87d with SMTP id 5614622812f47-46ef60f5440mr13320054b6e.14.1775748494136; Thu, 09 Apr 2026 08:28:14 -0700 (PDT) Received: from [10.21.14.152] ([65.132.165.41]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-422eb25ad44sm18302216fac.12.2026.04.09.08.28.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2026 08:28:13 -0700 (PDT) Message-ID: Date: Thu, 9 Apr 2026 09:28:12 -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] io_uring: fix null-ptr-deref in io_uring_poll To: l1zao@zju.edu.cn, io-uring@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20260409145525.36194-1-l1zao@zju.edu.cn> Content-Language: en-US From: Jens Axboe In-Reply-To: <20260409145525.36194-1-l1zao@zju.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/9/26 8:55 AM, l1zao@zju.edu.cn wrote: > From: Haocheng Yu > > A general protection fault in io_uring_poll is reported by a > modified Syzkaller-based kernel fuzzing tool we developed. The > crash occurs due to KASAN: null-ptr-deref. > > This issue is likely caused by a race condition between > `io_uring_register` and `poll`. Specifically, in > io_uring/register.c/io_register_resize_rings(), ctx->rings is > set to NULL. Although this step is protected by a mutex lock > and a spin lock, io_uring/io_uring.c/io_uring_poll() calls > io_sqring_full and __io_cqring_events_user without holding the > lock, in which ctx->rings is accessed. > > To fix this vulnerability, I moved the two function calls in > io_uring_poll() that might access ctx->rings under the protection > of spin_lock(&ctx->completion_lock). Fixed a month ago, what tree are you running? commit 96189080265e6bb5dde3a4afbaf947af493e3f82 Author: Jens Axboe Date: Mon Mar 9 14:21:37 2026 -0600 io_uring: ensure ctx->rings is stable for task work flags manipulation -- Jens Axboe