zfs: can't read /proc/sys/kernel/spl/hostid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zfs-linux (Ubuntu) |
Fix Released
|
Medium
|
Colin Ian King | ||
Hirsute |
Fix Released
|
Medium
|
Colin Ian King | ||
Impish |
Fix Released
|
Medium
|
Colin Ian King |
Bug Description
[Impact]
Reading /proc/sys/
The Fix:
commit 7de4c88b39473f3
Author: наб <email address hidden>
Date: Sun Apr 11 01:18:40 2021 +0200
linux/spl: base proc_dohostid() on proc_dostring()
This fixes /proc/sys/
32927393dc1
to ->proc_handler") ‒ 5.7-rc1 and up
The access_ok() check in copy_to_user() in proc_copyout_
always fail, so all userspace reads and writes would fail with EINVAL
proc_dostring() strips only the final new-line,
but simple_strtoul() doesn't actually need a back-trimmed string ‒
writing "012345678 \n" is still allowed, as is "012345678zupsko", &c.
This alters what happens when an invalid value is written ‒
previously it'd get set to what-ever simple_strtoul() returned
(probably 0, thereby resetting it to default), now it does nothing
Reviewed-by: Brian Behlendorf <email address hidden>
Signed-off-by: Ahelenia Ziemiańska <email address hidden>
Closes #11878
Closes #11879
This applies cleanly for Impish and Hirsute 2.x ZFS so backporting is straight forward.
[Test Plan]
cat /proc/sys/
[Where problems could occur]
This affects just a few /proc spl interfaces so the change is a low-impact fix. Not many folk even use these and nobody has reported this as a bug so the number of affected users is expected to be very small. I suspect nobody is reading the hostid from /proc as this information is available elsewhere and it's rather an old legacy interface.
The affected change is from upstream ZFS 2.x hence the patch applies cleanly.
This fix has been in upstream ZFS for several months with no reported regressions.
The change does not affect any core ZFS functionality.
Regression tested against the Ubuntu ZFS regression test suite and passed.
Changed in zfs-linux (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → In Progress |
assignee: | nobody → Colin Ian King (colin-king) |
Changed in zfs-linux (Ubuntu Hirsute): | |
assignee: | nobody → Colin Ian King (colin-king) |
status: | New → In Progress |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
tags: | added: verification-done verification-done-hirsute |
This bug was fixed in the package zfs-linux - 2.0.3-8ubuntu8
---------------
zfs-linux (2.0.3-8ubuntu8) impish; urgency=medium
* Fix /proc/sys/ kernel/ spl/hostid (LP: #1942991) spl-base- proc_dohostid- on-proc_ dostring. patch regex_t. patch
- 4750-linux-
* Fix build issues with latest tool updates:
- 4751-suppress-
* Move 470* patches to debian/ubuntu
-- Colin Ian King <email address hidden> Tue, 7 Sep 2021 19:08:23 +0100