From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 0A088370D57 for ; Tue, 31 Mar 2026 15:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774970111; cv=none; b=IFOFno19QwGt4cUaHu01khjoRwcDvsOEc7zTc7M8qwB+VjPsa6XySv1D6oIto6OUu4fCQFK81KHEzurcXie1RjhA3PLamUG7uYQuRPolFoBeibOj5LR2ry+uWfOPGN2QSlFASSr7ry6BswVbALHhmb9I/0a4v8gvHm4ZWvyiUqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774970111; c=relaxed/simple; bh=0yXvBWHq43dtfBdz6S9QOEeNHyCE5HNgmXpZE9F+wfI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N3+abuKvezxcv9Wm3O0mo8RMaq8ZH0amuxBi5FXRIQFaLXWBNVIpr3Wgs/by9eXLHXQXvrpG3mHfjH7cWO0r41jLrVXLhtdOi881glxZRjFSkHNj05L9v+8LFt3R7GTZsg+WAE9Rv8t/dlXfHGvLZk/J3QKtsqFn7GzQXAgOzlE= 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=ePWJyPKI; arc=none smtp.client-ip=209.85.210.44 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="ePWJyPKI" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-7d9e22176a7so2970125a34.1 for ; Tue, 31 Mar 2026 08:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1774970109; x=1775574909; 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=1PruSnKTPY/OhI7fw68fclrLaOE6FaNrTFnXsBVLrYM=; b=ePWJyPKI57qE+Jw3kpqjcvLhwfCWxMrm+YBweCfgFN8IG2zVOd718/7EwlDYqkkvxy tbIO3mEAWjr/I/VLDCeIbKCtRIDsTC5ncjEm1lJoXGyHEaJPyVypkkL9lV8exaZMB5C/ K8csw/4fAmcFkfA3qeMoLujCTeFXe2IZsfCoIB0yZjrW+q4bKeoVpazKsjmU5u5nZfQc GyuotXHGhHIp70eCD+8ybgwsXxl+xogJdDskyChS5vXgcZ1MUdQWJc+hOWS9xcd7HSTb RjKZNc/BrgeBOnHHEAcxebGVudeh9zR2Zu2FByqWwrT/CWU4jpWtLHzEcA9/y8+zYeuC FNSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774970109; x=1775574909; 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=1PruSnKTPY/OhI7fw68fclrLaOE6FaNrTFnXsBVLrYM=; b=Q//xLvWhO8dI24NHAQa8fjr67nnkcJWne9uhzirO/y5mAWSyddSkiq4apVuRecqSQC UY7Gsmc2zOkQaERUPet2WqLyplr7HbPWfcz3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ba3 with SMTP id 46e09a7af769-7db9924e0b2mr8769a34.11.1774970108851; Tue, 31 Mar 2026 08:15:08 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7da3356d8c5sm2767632a34.14.2026.03.31.08.15.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2026 08:15:08 -0700 (PDT) Message-ID: Date: Tue, 31 Mar 2026 09:15:07 -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] splice: prevent deadlock when splicing a file to itself To: Christoph Hellwig , Deepanshu Kartikey Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+d31a3b77e5cba96b9f69@syzkaller.appspotmail.com References: <20260320130615.1109449-1-kartikey406@gmail.com> Content-Language: en-US From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/31/26 9:10 AM, Christoph Hellwig wrote: > On Fri, Mar 20, 2026 at 06:36:15PM +0530, Deepanshu Kartikey wrote: >> Fix this by checking if the input and output files share the >> same inode before proceeding, returning -EINVAL if they do. >> This mirrors the existing check in do_splice() for the >> pipe-to-pipe case where ipipe == opipe. > > While restricting splice to be between difference inodes sounds like a > nice simplification, I'm not sure we can add it 20 years after the > syscall was added. Well if we could break splice all over with: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") then surely this one would be OK too? -- Jens Axboe