Comment 15 for bug 1795659

Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Hi Guillaume and all involved, it seems this bug still can occur even with the backported fix [0]. I found an upstream new fix that is quite promising, it addresses this specific oops. In the past it was thought by maintainers that other fix [0] could reduce the likelihood of those crashes in smb2_push_mandatory_locks (and it may worked, reducing the occurrence), but the fact is a proper fix was never worked until kernel 5.5.

The commit is 6f582b273ec2 ("CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks") [1]. The reasoning about the fix is that the struct cifsFileInfo is initialized and ready for usage before all members are initialized, like cifs->tlink (the one being dereferenced in most oops reports). The maintainer then enforced full struct initialization before it gets used.

I've built a 4.15 Bionic kernel with this fix, available in the following PPA:
launchpad.net/~gpiccoli/+archive/ubuntu/test1795659

To use this kernel, one just needs to run:
sudo add-apt-repository ppa:gpiccoli/test1795659
sudo apt-get update
sudo apt install linux-image-unsigned-4.15.0-74-generic linux-modules-4.15.0-74-generic linux-modules-extra-4.15.0-74-generic

Then reboot the machine and check if the right kernel is running; to verify that,
just run "uname -rv" and the output should be:
4.15.0-74-generic #84+TEST256303v20191229b1-Ubuntu <...>

In case anybody reproducing this issue can test the PPA kernel, I'd strongly appreciate it.
Cheers,

Guilherme

[0] http://git.kernel.org/linus/b98749cac4a6
[1] http://git.kernel.org/linus/6f582b273ec2