diff --git a/patches.suse/dm-flakey-fix-a-crash-with-invalid-table-line-98db.patch b/patches.suse/dm-flakey-fix-a-crash-with-invalid-table-line-98db.patch new file mode 100644 index 0000000..95e0720 --- /dev/null +++ b/patches.suse/dm-flakey-fix-a-crash-with-invalid-table-line-98db.patch @@ -0,0 +1,42 @@ +From 98dba02d9a93eec11bffbb93c7c51624290702d2 Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Tue, 18 Apr 2023 15:57:47 -0400 +Subject: [PATCH] dm flakey: fix a crash with invalid table line +Git-commit: 98dba02d9a93eec11bffbb93c7c51624290702d2 +Patch-mainline: v6.4-rc1 +References: git-fixes + +This command will crash with NULL pointer dereference: + dmsetup create flakey --table \ + "0 `blockdev --getsize /dev/ram0` flakey /dev/ram0 0 0 1 2 corrupt_bio_byte 512" + +Fix the crash by checking if arg_name is non-NULL before comparing it. + +Cc: stable@vger.kernel.org +Signed-off-by: Mikulas Patocka +Signed-off-by: Mike Snitzer +Signed-off-by: Coly Li + +--- + drivers/md/dm-flakey.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c +index ebcfb99b186b..ef07b294e550 100644 +--- a/drivers/md/dm-flakey.c ++++ b/drivers/md/dm-flakey.c +@@ -125,9 +125,9 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc, + * Direction r or w? + */ + arg_name = dm_shift_arg(as); +- if (!strcasecmp(arg_name, "w")) ++ if (arg_name && !strcasecmp(arg_name, "w")) + fc->corrupt_bio_rw = WRITE; +- else if (!strcasecmp(arg_name, "r")) ++ else if (arg_name && !strcasecmp(arg_name, "r")) + fc->corrupt_bio_rw = READ; + else { + ti->error = "Invalid corrupt bio direction (r or w)"; +-- +2.35.3 + diff --git a/series.conf b/series.conf index 45aaa1e..f9b34fc 100644 --- a/series.conf +++ b/series.conf @@ -41462,6 +41462,7 @@ patches.suse/dm-clone-call-kmem_cache_destroy-in-dm_clone_init-er-6827.patch patches.suse/dm-integrity-call-kmem_cache_destroy-in-dm_integrity-6b79.patch patches.suse/dm-ioctl-fix-nested-locking-in-table_clear-to-remove-deadlock-concern-3b89.patch + patches.suse/dm-flakey-fix-a-crash-with-invalid-table-line-98db.patch patches.suse/scsi-lpfc-Prevent-lpfc_debugfs_lockstat_write-buffer.patch patches.suse/scsi-lpfc-Reorder-freeing-of-various-DMA-buffers-and.patch patches.suse/scsi-lpfc-Fix-lockdep-warning-for-rx_monitor-lock-wh.patch