From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 EDAE9246326; Sat, 8 Feb 2025 12:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739017536; cv=none; b=EUmSc8jrSGDvAA/gmVeNt2tBo/LUB9oMnpwWCNhZ1hC8ZLt9ePzF0urHDFyARGsrae6UC7sDlN8Q5Dk9ZYmBMb6jjucKBa8h/t8HaDB1SESTa4h5gAwf3OmWev4FdtjzyzkZO5Ngtocn0DEfweNjel86Q5IBlCR/EsUPGDs1hwI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739017536; c=relaxed/simple; bh=AadnZ0j7VcIZfdYKH0NEkcDMx/JDq/nGC7nAGgB0Tzw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=m92oJ8c3qjKlwFodSMp924PK4RldhBE82CrdpF1SInTHcPguvq2xObYJSPkjowsDEmSNvfdWs1hklTQpHHKNPCpjj9ytmAD9dym6cYtImU7gSp66rk/LVrMvm40iSwCdgHbVtQpIOeyXTQZxsCFlhuWAtTcN/8TuCKi8bTUtAuM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Cnk4DnjM; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cnk4DnjM" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5450622b325so296325e87.1; Sat, 08 Feb 2025 04:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739017533; x=1739622333; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=Vf7UCe2+gJ/ZwuZ0utuOhvytI5Khd0c+ZEq76ketdUc=; b=Cnk4DnjMWPjrh84owDDjMi44/X6PXi7+Bm9y6XKP4gXangjCi0Ewt6JyDhtWwqR/9X BTFBwZpsfnmTes/iWNH1ojdRF8rq5ZbjPiWl/k3TXnyOd1QO+QCiD92d7RKuKZoPRv0d YR9FI/ieIv8lNUoNfWoeUy2HsdQzkH/fPEi6sLNmumXaiS1gb0KP/x+bhK/GE3XCl9oR WxnznFbgiT/Cib1B5ajqUrQSeDw4rNyNTseqI/2hggOcco+YBMUDTOdiET1Fg5LQryrv KGu8rTMAdu5KmhBoD23ReU0IXgQ/TiACQ0CmuVShPhOw21C5G3bZ6W9Qvtk63NxbIxVA 0uYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739017533; x=1739622333; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Vf7UCe2+gJ/ZwuZ0utuOhvytI5Khd0c+ZEq76ketdUc=; b=cXvcU9ct4ZSmFt6HJfbuZSuSyiW0exc2mH/gJPRGiHx609eI9+EmAMwX7C+7uaPZNg CKVteZxgFnVD83qXBJs2hNG+6Qo5+maqxKhTfaAR8lWnjDGk0mlkM5pz41wlUBQXPlqb UGmaBXtN3XN7rgpLIGIQzfWjjb4bsd0yCADzPyCpRw0XI6yBY0BBKNc2L2VfarGfyG8x ZWQ2qBfRfptfPGDLxxRPHZ5qx1Q1+JMOelImdfiBgu7TUnGsSR5V1mxYJKkYQ9QwPqhM 1i9CJ0EmMSV38grCf2nQHWvgy8qTR67zykcQNFopOb9KFona+n/gZxa1zkAdVxX5C6fC IaXw== X-Forwarded-Encrypted: i=1; AJvYcCV7rQ+i7rv14oWqLDzX39JMqIKK3IYo1/DsuBm/Za/DAyjCbVjCTXTx14Xmfom3lh/2AhOEsmf3i0MGlXGf@vger.kernel.org, AJvYcCXhaASxh/iQ6OazskDMFpbZS3j74+4coqdrR80WIyfAv+p2HXu1DUiU7ufiZnIIyMPy+Twio5qXk4urGYI3@vger.kernel.org X-Gm-Message-State: AOJu0Yzzn0Ye2J34OGaGEG1F9RkdVWa4LTkMqVvPckRg2tXb8SrILmY1 eJeKbUzAd66haxyNGZKr5XsxeKT37L8ib6+QaqE8BTfoqBPG4S3y X-Gm-Gg: ASbGnct9IASYy6AexFNWmnXP7oSF3YuZGf8xMYSfBKXgQ/tJqU0Vi3xOMIcabGLMJVT yhInqzJCN00GF64bQ5/jE/qifJ7qEsSNefzBODyMp6O75oFf+vhmsZ6MN7yyh34VFCsh+J61uJy ka8HBbdqYq4SrjxWb7QhRDMzfJY9JVYeMvdaTxb62ViPde98kOOl14B39SZRtwQXujIA0sj2CLp ujSTmuL+LuhyTowdW6L4OJZnxX2fVSsTBwE45xGsEthS2IV2MkMFC4whFyrMOIvUttIve+aqK6+ QwEYg+stRVSm2D512X/MQjjSuGQvv72f6ozTPdtj X-Google-Smtp-Source: AGHT+IEKSXFs+VKuDDwV+S1yCbrtaX4ioZyasHRW6SDx+XrDhvhm7KyK69cSIttc8f/uOAOsSAabZQ== X-Received: by 2002:a05:6512:3988:b0:545:58e:e543 with SMTP id 2adb3069b0e04-545058ef015mr489528e87.21.1739017532610; Sat, 08 Feb 2025 04:25:32 -0800 (PST) Received: from [10.147.2.13] ([85.206.91.33]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54410554276sm705168e87.67.2025.02.08.04.25.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Feb 2025 04:25:32 -0800 (PST) Message-ID: Date: Sat, 8 Feb 2025 14:25:30 +0200 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [REGRESSION][BISECTED] Crash with Bad page state for FUSE/Flatpak related applications since v6.13 To: Bernd Schubert , Joanne Koong Cc: Vlastimil Babka , Miklos Szeredi , Matthew Wilcox , Christian Heusel , Josef Bacik , Miklos Szeredi , regressions@lists.linux.dev, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm References: <2f681f48-00f5-4e09-8431-2b3dbfaa881e@heusel.eu> <03eb13ad-03a2-4982-9545-0a5506e043d0@suse.cz> <94df7323-4ded-416a-b850-41e7ba034fdc@bsbernd.com> Content-Language: en-US, lt From: =?UTF-8?Q?Mantas_Mikul=C4=97nas?= Autocrypt: addr=grawity@gmail.com; keydata= xsFNBErsM2sBEACY4zLqEsnJ0r9vrjKrrVtbEsJe5Pe1dopj91UekdDzSNhJx5wgOZ4G7Zw2 Xm0w4JGPLqwTJ/0k4qJVcEKLnDfCxVlGEZLej7OSjcOI8ecRD8eZSez/n4+7C9pY+1+G0qFX AYAVfehVlAUaxRDWRpA1VMH7sCH5l6aXKOHLHc2fdrCK0vPCNVYxhqeXC00kasappbeM3YtE WtBrletWiWFv80ivy6OMXc2p/v1ke3HQnOaIN6exFimHdoz7tosyxevKvDSh44nZ/k1m7m4G 7V7jVFJYjqk0l+6ExB/behKPREP3bQcoa7OvkupTE1gK4p6PnTI7vozQgrYPjTfv70uRB5cY gIhtix71EgT3vpwpnkLNSCo1abuTbqibiOlLA8aoW2U3qcY6850RG9eYt/GFBJFgD76vwbiL NyOwnOtntY+JsUR2Lxx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YJyWGhKspSjCIBfzBHliSsO647AOf8NAhMfJoYAUcB73oio/+SmedqQwH jKSZ0ujgPRaA1BzwJq2KFAEt78GWdi3+QJVLSY7qwmdJhQIM6tpLHjQZDkJ3t3WS9mQLXdo3 yjXbhu32fHP+D9wxj5zUSMGw6IXYwL3/0dSjjp7kCbz4WDCjY9VVJQXVqsATBFzj1h3e6DRi sUnXsKPg5dMb2/y57Eu+0uEYT+UDjUKsCrSv2fqL70GxsdM6GAnDOKjOZAKiAq7yIGFea172 YI5Vn8mvHV5B2d1d0C9b9BYq0ciZGchz+uvB6RHa4C+dvVDUIyhYqoaVgUopBBTqzUavkwuy aETxZy4lQ+jpsbG/q9fvS/sAZA== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025-02-08 2:02, Bernd Schubert wrote: > > > On 2/7/25 19:40, Joanne Koong wrote: >> On Fri, Feb 7, 2025 at 3:16 AM Bernd Schubert wrote: >>> >>> >>> >>> On 2/7/25 11:55, Vlastimil Babka wrote: >>>> On 2/7/25 11:43, Miklos Szeredi wrote: >>>>> On Fri, 7 Feb 2025 at 11:25, Vlastimil Babka wrote: >>>>> >>>>>> Could be a use-after free of the page, which sets PG_lru again. The list >>>>>> corruptions in __rmqueue_pcplist also suggest some page manipulation after >>>>>> free. The -1 refcount suggests somebody was using the page while it was >>>>>> freed due to refcount dropping to 0 and then did a put_page()? >>>>> >>>>> Can you suggest any debug options that could help pinpoint the offender? >>>> >>>> CONFIG_DEBUG_VM enables a check in put_page_testzero() that would catch the >>>> underflow (modulo a tiny race window where it wouldn't). Worth trying. >>> >>> I typically run all of my tests with these options enabled >>> >>> https://github.com/bsbernd/tiny-qemu-virtio-kernel-config >>> >>> >>> If Christian or Mantas could tell me what I need to install and run, I >>> could probably quickly give it a try. >>> >> >> Copying/pasting from [1], these are the repro steps that's listed: >> >> 1) Install Bottles: flatpak install flathub com.usebottles.bottles >> 2) Open Bottles and create a bottle >> 3) In a terminal open the kernel log using dmesg/journalctl in follow mode >> 4) Once the bottle has been initialized, open it, select "Run >> Executable" and point it at any Windows executable >> Note that at that same moment a BUG: Bad page state in process fuse >> mainloop error message will appear and the system will become >> unresponsive (keyboard and mouse might still work but you'll be unable >> to actually do anything, open or close any application, or even reboot >> or shutdown; you are able to ping the device and initiate an SSH >> connection but all it does is just display the banner) >> > > Thanks Joanne! Hmm, I found "wmplayer" in a c drive, but there doesn't > happen much > > 5241 pts/0 Ss 0:00 -bash > 5317 pts/1 S+ 0:00 /home/bernd/.var/app/com.usebottles.bottles/data/bottles/runners/soda-9.0-1/bin/wi > 5319 ? Ss 0:01 /home/bernd/.var/app/com.usebottles.bottles/data/bottles/runners/soda-9.0-1/bin/wi > 5321 pts/1 S+ 0:01 C:\windows\system32\wineboot.exe --init > 5345 ? Ssl 0:01 C:\windows\system32\services.exe > 5348 ? Ssl 0:00 C:\windows\system32\winedevice.exe > 5359 ? Ssl 0:01 C:\windows\system32\winedevice.exe > 5360 ? I 0:00 [kworker/u130:0-rpciod] > > It runs it, but no system issue. I had also tried "Obfuscate", but didn't > manage to feed it a file - it runs in the sandbox and no access to > my $HOME. That is the point -- the bug is triggered by using Flatpak's FUSE-based "sandboxed file access" mechanism. The sandboxed app is supposed to ask 'xdg-desktop-portal' to give it some file, which then lets you select a file and exposes it through its FUSE mount inside the sandbox (which is also visible at /run/user/1000/doc outside the sandbox). So the specific app probably doesn't matter, as long as it *is* in fact sandboxed without direct access to your $HOME, and as long as you have xdg-desktop-portal installed. I had suggested "Obfuscate" both because it was what originally led to the crash in my case, and because it's a fairly basic app where opening a file happens to be step 1 of its usual workflow so it's quick to test. Other similar ones might be: https://flathub.org/apps/com.belmoussaoui.ashpd.demo ("File chooser") The actual FUSE code is at: https://github.com/flatpak/xdg-desktop-portal/blob/main/document-portal/document-portal-fuse.c#L2041 I guess any other filesystem that relies on libfuse's direct splice support would also be able to repro? I don't know if there are any.