The vulnerability lies in the cp utility's recursive copy functionality (-R or -a) where it mishandles character and block device files. The core of the issue is in the copy_helper function in src/uu/cp/src/cp.rs. Before the patch, this function lacked specific logic to handle these special files. When encountering a device file, it would default to treating it as a regular file, attempting to read its contents and write them to a new file at the destination. This behavior could be exploited for a denial-of-service attack. For instance, copying /dev/zero would result in a file that grows indefinitely, consuming all available disk space. The patch addresses this by introducing a new function, copy_node, which uses the nix::sys::stat::mknod system call to correctly recreate the device file at the destination, preserving its type and attributes. The copy_helper function is modified to detect character and block devices and delegate their handling to the new copy_node function. The copy_file function, which is higher up in the call stack, was also modified to simplify the passing of file metadata, reflecting the new, more robust handling of file types.