Skip to content

RPi3B+: Kernel underflow or use-after-free #5730

@neo1973

Description

@neo1973

Describe the bug

Frequently when running Kodi I'm getting this error in dmesg:

[ 1373.539694] ------------[ cut here ]------------
[ 1373.546813] WARNING: CPU: 1 PID: 423 at lib/refcount.c:87 refcount_dec_not_one+0xac/0xbc
[ 1373.557467] refcount_t: underflow; use-after-free.
[ 1373.564786] Modules linked in: rpcsec_gss_krb5 bcm2835_codec(C) bcm2835_v4l2(C) bcm2835_isp(C) bcm2835_mmal_vchiq(C) v4l2_mem2mem videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_common raspberrypi_hwmon videodev vc_sm_cma(C) mc i2c_bcm2835 raspberrypi_gpiomem cfg80211 rfkill uio_pdrv_genirq uio sch_fq_codel snd_bcm2835(C) fuse dm_mod zstd zram zsmalloc ip_tables x_tables ipv6 vc4 snd_soc_hdmi_codec snd_soc_core snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd drm_display_helper drm_dma_helper drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm drm_panel_orientation_quirks backlight cec
[ 1373.629538] CPU: 1 PID: 423 Comm: kodi.bin Tainted: G         C         6.1.62-3-rpi-ARCH #1
[ 1373.640926] Hardware name: BCM2835
[ 1373.647324]  unwind_backtrace from show_stack+0x18/0x1c
[ 1373.655492]  show_stack from dump_stack_lvl+0x90/0xac
[ 1373.663452]  dump_stack_lvl from __warn+0x80/0x11c
[ 1373.671112]  __warn from warn_slowpath_fmt+0x12c/0x198
[ 1373.679178]  warn_slowpath_fmt from refcount_dec_not_one+0xac/0xbc
[ 1373.688256]  refcount_dec_not_one from vc4_bo_dec_usecnt+0x2c/0xd8 [vc4]
[ 1373.698090]  vc4_bo_dec_usecnt [vc4] from drm_atomic_helper_cleanup_planes+0x64/0x78 [drm_kms_helper]
[ 1373.710486]  drm_atomic_helper_cleanup_planes [drm_kms_helper] from vc4_atomic_commit_tail+0x158/0x904 [vc4]
[ 1373.723526]  vc4_atomic_commit_tail [vc4] from commit_tail+0xa4/0x198 [drm_kms_helper]
[ 1373.734601]  commit_tail [drm_kms_helper] from drm_atomic_helper_commit+0x13c/0x160 [drm_kms_helper]
[ 1373.746898]  drm_atomic_helper_commit [drm_kms_helper] from drm_atomic_commit+0xb4/0xe8 [drm]
[ 1373.758855]  drm_atomic_commit [drm] from drm_mode_atomic_ioctl+0x890/0xb1c [drm]
[ 1373.769826]  drm_mode_atomic_ioctl [drm] from drm_ioctl+0x1d8/0x388 [drm]
[ 1373.780119]  drm_ioctl [drm] from sys_ioctl+0x118/0xa98
[ 1373.788648]  sys_ioctl from ret_fast_syscall+0x0/0x1c
[ 1373.796719] Exception stack(0xf12b1fa8 to 0xf12b1ff0)
[ 1373.804810] 1fa0:                   059689e0 bebd0658 00000000 c03864bc bebd0658 00000000
[ 1373.816042] 1fc0: 059689e0 bebd0658 c03864bc 00000036 059efbb0 048005a0 048005f8 059efbdc
[ 1373.827268] 1fe0: b4e2ae58 bebd0600 b544627c b4d94f3c
[ 1373.835456] ---[ end trace 0000000000000000 ]---

Steps to reproduce the behaviour

I don't know what triggers the underflow other than running Kodi. But it also doesn't seem to affect Kodi. The issue started to appear after I updated Kodi to a version that contains xbmc/xbmc#23921 so EGL fences or drmModeAtomicCommit with the DRM_MODE_ATOMIC_NONBLOCK flag may be part of the issue.

Device (s)

Raspberry Pi 3 Mod. B+

System

OS: Arch Linux ARM
Kernel (PKGBUILD): Linux alarmpi 6.1.62-3-rpi-ARCH #1 SMP Mon Nov 20 13:09:55 MST 2023 armv7l GNU/Linux
vcgencmd version:

Oct 17 2023 15:42:39 
Copyright (c) 2012 Broadcom
version 30f0c5e4d076da3ab4f341d88e7d505760b93ad7 (clean) (release) (start)

Logs

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions