aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-hym8563.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2021-05-10 14:49:05 -0400
committerMike Snitzer <snitzer@redhat.com>2021-05-13 14:42:52 -0400
commitc699a0db2d62e3bbb7f0bf35c87edbc8d23e3062 (patch)
tree22dff394ba42ecd8141bbd8ff8b6482df8de99e9 /drivers/rtc/rtc-hym8563.c
parent7ee06ddc4038f936b0d4459d37a7d4d844fb03db (diff)
dm snapshot: fix crash with transient storage and zero chunk size
The following commands will crash the kernel: modprobe brd rd_size=1048576 dmsetup create o --table "0 `blockdev --getsize /dev/ram0` snapshot-origin /dev/ram0" dmsetup create s --table "0 `blockdev --getsize /dev/ram0` snapshot /dev/ram0 /dev/ram1 N 0" The reason is that when we test for zero chunk size, we jump to the label bad_read_metadata without setting the "r" variable. The function snapshot_ctr destroys all the structures and then exits with "r == 0". The kernel then crashes because it falsely believes that snapshot_ctr succeeded. In order to fix the bug, we set the variable "r" to -EINVAL. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/rtc/rtc-hym8563.c')
0 files changed, 0 insertions, 0 deletions