Bug#983357: Bug#988776: Bug#983357: Netinst crashes xen domU when loading kernel

Chuck Zmudzinski brchuckz at netscape.net
Thu Aug 26 13:01:48 BST 2021


On 8/24/2021 7:12 PM, Ben Hutchings wrote:
>
> The current limit on the environment of a uevent appears to be 2 KB
> (UEVENT_BUFFER_SIZE defined in <linux/kobject.h>).  That seems like it
> *might* be easier to change, so long as user-space doesn't have a
> similar limit.
>
> I looked into systemd/udev, and it seems to use an 8 KB buffer for
> receiving uevents:
>
> https://sources.debian.org/src/systemd/247.9-1/src/libsystemd/sd-device/device-monitor.c/?hl=390#L390
>
> But as a first step I think increasing the kernel buffer size to 4 KB
> would be enough.  Perhaps someone could test whether this patch to the
> domU kernel makes udev happier:
>
> --- a/include/linux/kobject.h
> +++ b/include/linux/kobject.h
> @@ -30,7 +30,7 @@
>   
>   #define UEVENT_HELPER_PATH_LEN		256
>   #define UEVENT_NUM_ENVP			64	/* number of env pointers */
> -#define UEVENT_BUFFER_SIZE		2048	/* buffer for the variables */
> +#define UEVENT_BUFFER_SIZE		4096	/* buffer for the variables */
>   
>   #ifdef CONFIG_UEVENT_HELPER
>   /* path to the userspace helper executed on an event */
> --- END ---
>
> ?
>
> Ben.
>

I tested this patch on my Xen HVM bullseye system and
it appears 4k is enough for the UEVENT_BUFFER_SIZE
to accommodate the Xen Virtual Keyboard's large
modalias. I needed to follow the instructions in
the Kernel team's handbook for changing the ABI
name of the kernel for the build to succeed with
the patch. I just bumped it from 8 to 8.1.

Results:

1. No coldplug failure reported at boot time.

2. With the patch the system can write uevent
data to sysfs for the Xen Virtual Keyboard device.

With the current 5.10.0-8 kernel:

chuckz at debian:~$ cat /sys/devices/virtual/input/input2/uevent
chuckz at debian:~$

With the patched kernel with a change to the ABI version from 8 to 8.1:

chuckz at debian:~$ uname -r
5.10.0-8.1-amd64
chuckz at debian:~$ cat /sys/devices/virtual/input/input2/uevent
PRODUCT=1/5853/ffff/0
NAME="Xen Virtual Keyboard"
PHYS="xenbus/device/vkbd/0"
PROP=0
EV=3
KEY=7fffffffffffffff ffffffffffffffff ffffffffffffffff...
MODALIAS=input:b0001v5853pFFFFe0000-e0,1,k71,72... really long MODALIAS
---------------------------------------------------------------------------

So I think a test of the installation media in a Xen HVM with the
4k buffer in the kernel is the next step.

I would also like to test a live CD in a Xen HVM with this patch.
It was also reported to fail to boot in a Xen HVM on the
debian-user list.

BTW, my complements to the Debian Kernel Team for the
excellent handbook on building kernels for Debian. It is
easy to understand and made it very easy for me to
build and test the patch even though I have not built
a Linux kernel in many years, and I never built a Debian
kernel before.

All the best,

Chuck




More information about the Pkg-systemd-maintainers mailing list