Bug#1054607: btrfs-progs: btrfs prop set causing system to reboot

2023-12-31 Thread Alexey Kuznetsov


cat /proc/asound/cards
 0 [PCH]: HDA-Intel - HDA Intel PCH
  HDA Intel PCH at 0x5121 irq 140
 1 [HDMI   ]: HDA-Intel - HDA ATI HDMI
  HDA ATI HDMI at 0x50e2 irq 141



sudo setfattr -n compression -v zstd /dev/snd/pcm*
setfattr: /dev/snd/pcmC0D0c: Operation not supported
setfattr: /dev/snd/pcmC0D0p: Operation not supported
setfattr: /dev/snd/pcmC0D2c: Operation not supported
setfattr: /dev/snd/pcmC1D10p: Operation not supported
setfattr: /dev/snd/pcmC1D3p: Operation not supported
setfattr: /dev/snd/pcmC1D7p: Operation not supported
setfattr: /dev/snd/pcmC1D8p: Operation not supported
setfattr: /dev/snd/pcmC1D9p: Operation not supported


seems fine, no reboot.



Bug#1054607: btrfs-progs: btrfs prop set causing system to reboot

2023-12-29 Thread Alexey Kuznetsov
It have been fixed in https://github.com/kdave/btrfs-progs/issues/699

I can answer you later about kernel / driver related solution.



Bug#1054607: btrfs-progs: btrfs prop set causing system to reboot

2023-12-29 Thread Adam Borowski
On Thu, Oct 26, 2023 at 08:00:20PM +0300, a...@me.com wrote:
> Package: btrfs-progs

The bug in question is in the kernel, not in btrfs-progs (but see below).

> sudo find "/dev/snd" -exec btrfs prop set {} compression zstd \;
> Causing stuck on /dev/snd/pcmC1D0p file and insta reboots in 5 mins.
> ls -al /dev/snd/pcmC1D0p
> crw-rw+ 1 root audio 116, 5 окт 26 19:37 /dev/snd/pcmC1D0p

This is very clearly not a btrfs filesystem.  The driver associated with
the device in question (ie, your sound card) should either accept the
request or cleanly reject it, not crash the whole machine.

If you could say what driver is responsible for the sound card in your
machine, it'd be possible to fix the crash.  This information can be found
eg. in /proc/asound/cards or other files there.

What btrfs-progs are doing here is setting an xattr named btrfs.compression
(with a value that you provide); unlike ioctls which are at risk of having
a different meaning for an unrelated device, that xattr is cleanly
namespaced.  Thus, my guess is that your sound card's driver will crash
for any xattr whose name it doesn't understand.

You don't need btrfs-progs to reproduce that, you could set the xattr
directly (via the setfattr command), copy it via some backup tool (rsync
in particular teaches people to use -X or lose the ability to use /bin/ping
etc), etc.  And this is (kind of) an unprivileged operation...


The real bug aside, there's a question whether btrfs-progs should protect
the user and fstatfs() every file it processes.  That could be reasonable
but could break remote filesystems from transporting this setting (I don't
know if they do).


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Packager's rule #1: upstream _always_ screws something up.  This
⢿⡄⠘⠷⠚⠋⠀ is true especially if you're packaging your own project.
⠈⠳⣄



Bug#1054607: btrfs-progs: btrfs prop set causing system to reboot

2023-10-26 Thread axet
Package: btrfs-progs
Version: 6.2-1
Severity: normal

Dear Maintainer,

sudo find "/dev/snd" -exec btrfs prop set {} compression zstd \;

Causing stuck on /dev/snd/pcmC1D0p file and insta reboots in 5 mins.

ls -al /dev/snd/pcmC1D0p
crw-rw+ 1 root audio 116, 5 окт 26 19:37 /dev/snd/pcmC1D0p


-- System Information:
Debian Release: 12.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-13-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages btrfs-progs depends on:
ii  libblkid12.38.1-5+b1
ii  libc62.36-9+deb12u2
ii  libcom-err2  1.47.0-2
ii  libext2fs2   1.47.0-2
ii  liblzo2-22.10-2
ii  libudev1 252.17-1~deb12u1
ii  libuuid1 2.38.1-5+b1
ii  libzstd1 1.5.4+dfsg2-5
ii  zlib1g   1:1.2.13.dfsg-1

btrfs-progs recommends no packages.

Versions of packages btrfs-progs suggests:
ii  duperemove  0.11.2-3

-- debconf-show failed