]> git.proxmox.com Git - mirror_ubuntu-impish-kernel.git/commit
UBUNTU: SAUCE: shiftfs: free allocated memory in shiftfs_btrfs_ioctl_fd_replace(...
authorSeth Forshee <seth.forshee@canonical.com>
Fri, 9 Apr 2021 18:01:06 +0000 (13:01 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 28 Jun 2021 06:03:59 +0000 (08:03 +0200)
commitf2060cf8dfba3edd99aee5d8baaa791cfcbc4613
treef45a85a54491804674409a3bc1a7e390caa77871
parent0e1e054e10b716ebf3a0d66d260ecdafd78a5d19
UBUNTU: SAUCE: shiftfs: free allocated memory in shiftfs_btrfs_ioctl_fd_replace() error paths

Many error paths in shiftfs_btrfs_ioctl_fd_replace() do not free memory
allocated near the top of the function. Fix up these error paths to free
the memory.

Additionally, the addresses for the allocated memory are assigned to
return parameters early in the function, before we know whether or not
the function as a whole will return success. Wait to assign these values
until we know the function was successful, and for good measure
initialize the return parameters to NULL at the start.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
CVE-2021-3492
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/shiftfs.c