]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 12 Apr 2021 12:50:29 +0000 (09:50 -0300)
commiteb00293db1e71f56d6cfa9bf2783ef7197765de6
tree4ea9de8263e992340e74822806cc81b245d6e650
parente484dbf1052c597f8aae9ad87e71a4c8d2dec2b4
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