memcpy: detected field-spanning write (size 8) of single field "lr + 1"

Bug #2082060 reported by Danilo Egea Gondolfo
74
This bug affects 8 people
Affects Status Importance Assigned to Milestone
zfs-linux (Ubuntu)
Fix Released
Undecided
Heitor Alves de Siqueira
Noble
Fix Committed
High
Heitor Alves de Siqueira
Oracular
Fix Committed
High
John Cabaj

Bug Description

SRU Justification

[Impact]

* Having occurrences of "detected field-spanning write" on zpool import. Logs included below SRU justification

[Fix]

* Backport 6f50f8e16b7c: "zfs_log: add flex array fields to log record structs"
* Backport c84a37ae93b5: "lua: add flex array field to TString type"

[Test Plan]

* Compile tested
* Run through autopkgtest regression tests

[Regression potential]

* Changes already in upstream ZFS. lua changes are quite small. Otherwise adding
  a new struct is added, which could lead to allocation issues if not managed
  properly.

I upgraded one of my systems to Oracular and noticed this error:

memcpy: detected field-spanning write (size 8) of single field "lr + 1" at /build/linux-3RcvoW/linux-6.11.0/debian/build/build-generic/____________________________________________________________________________dkms/build/zfs/2.2.6/build/module/zfs/zfs_log.c:461 (size 0)

I'm running kernel 6.11.0-8-generic and zfs 2.2.6-1ubuntu1

See also:

memcpy: detected field-spanning write #16501 - https://github.com/openzfs/zfs/issues/16501

memcpy: detected field-spanning write (size 7) of single field "sbuf" at /var/lib/dkms/zfs/2.2.99/build/module/lua/lstring.c:107 - https://github.com/openzfs/zfs/issues/16541
---
ProblemType: Bug
ApportVersion: 2.30.0-0ubuntu2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/seq: danilo 3545 F.... pipewire
 /dev/snd/controlC0: danilo 3550 F.... wireplumber
CasperMD5CheckResult: pass
DistroRelease: Ubuntu 24.10
InstallationDate: Installed on 2024-09-11 (15 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
Lsusb:
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 003: ID 04f2:b47f Chicony Electronics Co., Ltd VGA Webcam
 Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
 Bus 001 Device 005: ID 04ca:3014 Lite-On Technology Corp. Qualcomm Atheros Bluetooth
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
MachineType: Acer Aspire ES1-572
NonfreeKernelModules: zfs
Package: linux (not installed)
ProcEnviron:
 LANG=pt_BR.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=screen-256color
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/BOOT/ubuntu_x44vyn@/vmlinuz-6.11.0-8-generic root=ZFS=rpool/ROOT/ubuntu_x44vyn ro quiet splash crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M vt.handoff=1
ProcVersionSignature: Ubuntu 6.11.0-8.8-generic 6.11.0
RelatedPackageVersions:
 linux-restricted-modules-6.11.0-8-generic N/A
 linux-backports-modules-6.11.0-8-generic N/A
 linux-firmware 20240913.gita34e7a5f-0ubuntu2
Tags: oracular
Uname: Linux 6.11.0-8-generic x86_64
UnreportableReason: Este relatório é sobre o pacote que não foi instalado.
UpgradeStatus: Upgraded to oracular on 2024-09-25 (1 days ago)
UserGroups: N/A
_MarkForUpload: False
dmi.bios.date: 06/20/2016
dmi.bios.release: 1.2
dmi.bios.vendor: Insyde Corp.
dmi.bios.version: V1.02
dmi.board.asset.tag: Type2 - Board Asset Tag
dmi.board.name: T-Rex_SK
dmi.board.vendor: Acer
dmi.board.version: V1.02
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: V1.02
dmi.ec.firmware.release: 1.2
dmi.modalias: dmi:bvnInsydeCorp.:bvrV1.02:bd06/20/2016:br1.2:efr1.2:svnAcer:pnAspireES1-572:pvrV1.02:rvnAcer:rnT-Rex_SK:rvrV1.02:cvnAcer:ct10:cvrV1.02:skuAspireES1-572_1085_V1.02:
dmi.product.family: SKL
dmi.product.name: Aspire ES1-572
dmi.product.sku: Aspire ES1-572_1085_V1.02
dmi.product.version: V1.02
dmi.sys.vendor: Acer

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected oracular
description: updated
Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : CRDA.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : Lspci.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : Lspci-vt.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : Lsusb-t.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : Lsusb-v.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : ProcModules.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : RfKill.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : UdevDb.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : WifiSyslog.txt

apport information

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote : acpidump.txt

apport information

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/2082060

tags: added: iso-testing
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in zfs-linux (Ubuntu):
status: New → Confirmed
Revision history for this message
James De Ricco (jamescdericco) wrote :

I also got this issue when upgrading to Oracular today on my ZFS full disk encryption system. My first boot of Oracular hung at the kernel trace for several minutes before an otherwise successful boot. ZFS shipped with Oracular, version 2.2.6, is not officially compatible with linux kernel 6.11, the maximum supported Linux kernel version is 6.10. A fix for this issue is planned to be released in ZFS 2.2.7.

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

Hi James, can you check if the boot delay you mentioned happened due to this? https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/2084089

Revision history for this message
James De Ricco (jamescdericco) wrote :

Hi Danilo, thanks for pointing me to that bug, that was indeed the problem, and the solution was to install `systemd-cryptsetup`. Booting is now fast again, and now my swap space is working! The warning messages with the kernel traces for memcpy field spanning writes remain, but they do not cause any noticeable issues on my laptop.

Revision history for this message
Niccolò Belli (niccolo-belli) wrote :

Hi, this is a known issue with Linux 6.11 and zfs 2.2.6.
Even if it's considered harmless you should really backport this until 2.2.7 gets released: https://github.com/openzfs/zfs/pull/16539

You can't use the diff from that PR since it won't apply cleanly, but it's easy enough to backport and you reuse my patch from zfs-dkms-staging-git: https://aur.archlinux.org/cgit/aur.git/commit/?h=zfs-dkms-staging-git&id=c0037ba49d9739c753506640a91a716032d6f943

The patch is called "linux610-zfs_log-add-flex-array-fields-to-log-record-structs.patch" and we use it since a couple of weeks without issues.

You can also find it here where I constantly rebase on top of the latest staging branch: https://github.com/darkbasic/zfs/commits/zfs-2.2.7-staging-backports/

Revision history for this message
John Cabaj (john-cabaj) wrote :

There's a few other patches to finalize 6.11 support [1][2][3]

I'm hoping to come to a consensus this week on what else is required for 2.2.6 and identifying what we would need to do to possibly update to 2.2.7 when it's released as well.

[1]: https://github.com/openzfs/zfs/issues/16501
[2]: https://github.com/openzfs/zfs/pull/16539
[3]: https://github.com/openzfs/zfs/issues/16541

Revision history for this message
Niccolò Belli (niccolo-belli) wrote :

Yes I've backported all three of them: https://github.com/darkbasic/zfs/commits/zfs-2.2.7-staging-backports/

I consider "zfs_log-add-flex-array-fields-to-log-record-structs" the most important one because upstream marked kernel 6.11 as supported before the other two patches got merged.

2.2.6 plus the three backported patches has been tested on 6.11 by dozens of Arch Linux users with no issues so far.

Revision history for this message
John Cabaj (john-cabaj) wrote :

Including debdiff with upstream fixes for this issue.

tags: added: patch
Revision history for this message
Niccolò Belli (niccolo-belli) wrote :

2.2.7 and 2.3.0 have been released. Time to backport?

John Cabaj (john-cabaj)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in zfs-linux (Ubuntu Oracular):
status: New → Confirmed
tags: added: noble
Changed in zfs-linux (Ubuntu Noble):
status: New → Confirmed
Revision history for this message
Heitor Alves de Siqueira (halves) wrote :

Both of the required fixes have been merged into ZFS 2.2.7, which is already present in Plucky.

Changed in zfs-linux (Ubuntu):
status: Confirmed → Fix Released
assignee: nobody → Heitor Alves de Siqueira (halves)
Changed in zfs-linux (Ubuntu Oracular):
status: Confirmed → In Progress
Changed in zfs-linux (Ubuntu Noble):
status: Confirmed → In Progress
importance: Undecided → High
Changed in zfs-linux (Ubuntu Oracular):
importance: Undecided → High
Changed in zfs-linux (Ubuntu Noble):
assignee: nobody → John Cabaj (john-cabaj)
Changed in zfs-linux (Ubuntu Oracular):
assignee: nobody → John Cabaj (john-cabaj)
Changed in zfs-linux (Ubuntu Noble):
status: In Progress → Confirmed
Changed in zfs-linux (Ubuntu Noble):
assignee: John Cabaj (john-cabaj) → Heitor Alves de Siqueira (halves)
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Danilo, or anyone else affected,

Accepted zfs-linux into oracular-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zfs-linux/2.2.6-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-oracular to verification-done-oracular. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-oracular. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in zfs-linux (Ubuntu Oracular):
status: In Progress → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Danilo, or anyone else affected,

Accepted zfs-linux into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zfs-linux/2.2.2-0ubuntu9.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in zfs-linux (Ubuntu Noble):
status: Confirmed → Fix Committed
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (zfs-linux/2.2.6-1ubuntu1.1)

All autopkgtests for the newly accepted zfs-linux (2.2.6-1ubuntu1.1) for oracular have finished running.
The following regressions have been reported in tests triggered by the package:

zfs-linux/2.2.6-1ubuntu1.1 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/oracular/update_excuses.html#zfs-linux

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.