From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 1DEE53DDDC5 for ; Tue, 31 Mar 2026 14:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774966882; cv=none; b=pJMqUkmR6Yem81R5m9Ha2XyeTTFnWaikD7FI805sInH0Q8X0bOREJapaakiT47SjXOLNiv1yc0jsXx98nrZFjPRBZSW/gw7NXXVIjhzv58GPP9kAJer3goDRuRxh4UB6cKGYu69w9s8lYYSzsjSVqSdRcWaAMdsmA7G9cc52o3k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774966882; c=relaxed/simple; bh=SOSRtPDNSO8JH8QIMZ/LnU++kds61yIh+oeojl7bWpc=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=g33PxsXXQBK7VuD4Qz07qmM0aDW1YAWVyFQrdFPlDlMNVhVpnnVStKoGCgvGOwKw+6gmeOusgxgCIaq30Ue49xJJSrbxvIZM4iIcrO09UoEFTo4Kgj16VWloDuhJ1pFi6ruDx2hylwirIVnvBAYT9LwjV3Y2UCCTOFNOzeft6Sg= 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=irmZG6KO; arc=none smtp.client-ip=209.85.210.47 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="irmZG6KO" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-7d7f592b8beso4860734a34.1 for ; Tue, 31 Mar 2026 07:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1774966880; x=1775571680; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=9KMM5K3KSx836ZMreWjO549fXqRM3bm95gx4gAnhC9o=; b=irmZG6KO9K4bC6NWekDoyfRJd+RgN/J8Ebq5p8LSzAdjTLywNpntSPezRJWL5YmjjL 4syaRCRQ1+Ow1o3PjKOQO8XO+66mS4bF2OhP15GY/zkpTVEn8y4GjOSetm4S2pkQzejY a8rn3DGFYuqF9QRwT7MFSs8OsGOwOwtXwSKGBWnCd15q0ReCIaHmx58YmhAvfH3BrKqs HLfIhc6ZfsQiENElH7APxVXgyiVbf+OYPFRXZPceJuXxMS134ZGQHszrIT0uFs1UFr3/ yx0yuNeusVWQUSMMhjcSO7qNSECAHjCT+cKTWrLUhNwqXcQ+iD4Rjn1j1wExWbpldYFs fhmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774966880; x=1775571680; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from: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=9KMM5K3KSx836ZMreWjO549fXqRM3bm95gx4gAnhC9o=; b=BxxAXx+MisymYTraCUp1xtf+8n8XDqtdQgOgCvMK+dGAHEhL+jZOTki4aZpfqQ2TmH WenbdwsaV1yg8TPzC7d1U05XbtL9DMS5ck/oY4gCJUcU+Nx6FzEQnXNS49C4XXdT2gZz hUwkQdSNd0BUuFm2/8M3JxjGlPgFN30tiXV47DWnCUV8l+sQQX6bMvr/fmF4RyvIJ6N3 NtvO/rK/hTLIj1vhfojGmW7mc9EUxh5XQtfzmyKZ5ZIKMCXJRnQMTosuywMF2IqKwezZ peQwU5S5dHOsGEE0IyofksMZEnKMs9L/VNKI4KiX1QsLqFWilEhNkeoPdwsunZGPAfv+ WfoA== X-Forwarded-Encrypted: i=1; AJvYcCVxWOP7kLfoqtgV9p7P9GQ5xV4Bdn4n4UWsNTe3GA61zE8Gg5xrIjcNN29e4OVar8D1k9fhz2FEgndORkE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/FQYlj3N2a8tV/TuH5kge2CW0BhIcCBqHabtVObxxgdrSKmEs FTj61phpl7KMuXCrnxKyiu2P7QMOImVCtD2IzadPLb72H4ADnx7iGBIHQvHd0RC8MeQ= X-Gm-Gg: ATEYQzwPHcmOhlgM0QpXPaRcFDxBwaMy1zFhROQX4LQxyZWrQ1ftcoUuXfJcCFRKjJN seEXRy0g8aWQINJQH731n6lAxqL5nucdvrJM4DQE6cjd6hQVTRauY+5HOzFWpumKQcnzlD7RfI6 RmBUbnxQ82YfnrKa9vLDQcGzvMEiglNXEPnQAiQV1+BQMGOp2OFMvI97s4PwW9hYCRKh8W3osFE 6H7b7dGiSDvs93iNU/2OKVB1y0OgzvyApp7QKW+yOwz/4NSNcLmA0Yqk9GUdNRzEvScnOIJtU+1 Lf7PevlgTugkHqgPP4elmL4VD5guHmznHiME/55XXmorryUxIzhLbLNgWGQSiERw9533x8vMaYB QLIx/5q+r6qoz21nbEHN/rybHgqUlEJwnZPaVwYXx6b2uspWVX/2anp5rOlend33I9Q9V2xzwgI GYAdJT8gJhfib/MrGts3JNoG+HhoBQBENmn3mNB/TQCRkF+lG4ytV72IuzHvS275Dj5nX0yz2AK ngX4SH2YWaBLMzk0AEL X-Received: by 2002:a05:6830:6509:b0:7d7:5959:946f with SMTP id 46e09a7af769-7d9fad710d4mr8964047a34.7.1774966880061; Tue, 31 Mar 2026 07:21:20 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7da0a821746sm8842974a34.24.2026.03.31.07.21.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2026 07:21:19 -0700 (PDT) Message-ID: <8e452521-4186-42bd-b1c9-b83c22c1660c@kernel.dk> Date: Tue, 31 Mar 2026 08:21:18 -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: =?UTF-8?Q?Re=3A_=5BBUG=5D_WARNING_in_io=5Fring=5Fexit=5Fwork_=28io?= =?UTF-8?B?X3VyaW5nLmM6MjE4NykgdmlhIElPUklOR19SRUdJU1RFUl9CUEZfRklMVEVSIA==?= =?UTF-8?Q?=E2=80=94_confirmed_on_7=2E0-rc5_and_rc6?= From: Jens Axboe To: antonius , io-uring@vger.kernel.org Cc: asml.silence@gmail.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/31/26 7:39 AM, Jens Axboe wrote: > On 3/31/26 7:32 AM, antonius wrote: >> Hello, >> >> I am reporting a kernel WARNING discovered via Syzkaller fuzzing of Linux >> 7.0-rc5, targeting the new IORING_REGISTER_BPF_FILTER subsystem (new in 7.0). >> >> The bug is confirmed on both 7.0-rc5 and 7.0-rc6. It is NOT fixed in rc6. >> In rc6, the WARNING appears to have changed from WARN_ON to WARN_ON_ONCE >> (fires only once per boot), which may explain why it was initially missed. > > Interesting, that's why I added those WARN_ON's. I'll take a look > at this. > > And yes, they would only fire once, because are WARN_ON_ONCE()... diff --git a/io_uring/register.c b/io_uring/register.c index 5f3eb018fb32..837324bf0223 100644 --- a/io_uring/register.c +++ b/io_uring/register.c @@ -178,9 +178,17 @@ static __cold int io_register_restrictions(struct io_ring_ctx *ctx, return -EBUSY; ret = io_parse_restrictions(arg, nr_args, &ctx->restrictions); - /* Reset all restrictions if an error happened */ + /* + * Reset all restrictions if an error happened, but retain any COW'ed + * settings. + */ if (ret < 0) { + struct io_bpf_filters *bpf = ctx->restrictions.bpf_filters; + bool cowed = ctx->restrictions.bpf_filters_cow; + memset(&ctx->restrictions, 0, sizeof(ctx->restrictions)); + ctx->restrictions.bpf_filters = bpf; + ctx->restrictions.bpf_filters_cow = cowed; return ret; } if (ctx->restrictions.op_registered) -- Jens Axboe