summaryrefslogtreecommitdiff
path: root/drivers/hwmon/fschmd.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2022-04-13 18:06:19 +0300
committerMike Snitzer <snitzer@kernel.org>2022-04-13 20:22:17 +0300
commit73d7b06e902dd294e1f61554f7c403d0f705cf92 (patch)
tree3d9e26fff2473ffffa6afad5064ec74f0fc4cb74 /drivers/hwmon/fschmd.c
parentce40426fdc3c92acdba6b5ca74bc7277ffaa6a3d (diff)
downloadlinux-73d7b06e902dd294e1f61554f7c403d0f705cf92.tar.xz
dm zone: fix NULL pointer dereference in dm_zone_map_bio
Commit 0fbb4d93b38b ("dm: add dm_submit_bio_remap interface") changed the alloc_io() function to delay the initialization of struct dm_io's orig_bio member, leaving it NULL until after the dm_io and associated user submitted bio is processed by __split_and_process_bio(). This change causes a NULL pointer dereference in dm_zone_map_bio() when the original user bio is inspected to detect the need for zone append command emulation. Fix this NULL pointer by updating dm_zone_map_bio() to not access ->orig_bio when the same info can be accessed from the clone of the ->orig_bio _before_ any ->map processing. Save off the bio_op() and bio_sectors() for the clone and then use the saved orig_bio_details as needed. Fixes: 0fbb4d93b38b ("dm: add dm_submit_bio_remap interface") Reported-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/hwmon/fschmd.c')
0 files changed, 0 insertions, 0 deletions