dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [dm-devel] [PATCH] libmultipathd Avoid parsing errors due to unsupported designators
@ 2023-03-20 19:22 Brian Bunker
  2023-03-23 20:23 ` Martin Wilck
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Bunker @ 2023-03-20 19:22 UTC (permalink / raw)
  To: device-mapper development

Unsupported designators, even if they are correct, will result
in parsing errors. Add support for these two:

Logical Unit Group (0x6)
Vendor Specific (0x0)

Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
invalid device designator at offset 87: 01060004
Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
invalid device designator at offset 131: 02000005

Thanks,
Brian

Signed-off-by: Brian Bunker <brian@purestorage.com>
—
---
 libmultipath/discovery.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index d9ee2cb9..306884f6 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1211,6 +1211,14 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
                        invalid = (d[3] < 8);
                        new_prio = 2;
                        break;
+               case 0x6:
+                       /* Logical Unit Group */
+                       invalid = (d[3] != 4);
+                       break;
+               case 0x0:
+                       /* Vendor Specific */
+                       invalid = 0;
+                       break;
                case 0xa:
                        condlog(2, "%s: UUID identifiers not yet supported",
                                __func__);
--


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [dm-devel] [PATCH] libmultipathd Avoid parsing errors due to unsupported designators
  2023-03-20 19:22 [dm-devel] [PATCH] libmultipathd Avoid parsing errors due to unsupported designators Brian Bunker
@ 2023-03-23 20:23 ` Martin Wilck
  2023-03-24 14:25   ` Benjamin Marzinski
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Wilck @ 2023-03-23 20:23 UTC (permalink / raw)
  To: dm-devel, brian

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

On Mon, 2023-03-20 at 12:22 -0700, Brian Bunker wrote:
> Unsupported designators, even if they are correct, will result
> in parsing errors. Add support for these two:
> 
> Logical Unit Group (0x6)
> Vendor Specific (0x0)
> 
> Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
> invalid device designator at offset 87: 01060004
> Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
> invalid device designator at offset 131: 02000005
> 
> Thanks,
> Brian

Thanks. I've modified your patch as attached.

Martin


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-libmultipathd-Avoid-parsing-errors-due-to-unsupporte.patch --]
[-- Type: text/x-patch; name="0001-libmultipathd-Avoid-parsing-errors-due-to-unsupporte.patch", Size: 1477 bytes --]

From 9edbc2b6154786a9e7bb38890d023301c65c8a6a Mon Sep 17 00:00:00 2001
From: Brian Bunker <brian@purestorage.com>
Date: Mon, 20 Mar 2023 12:22:02 -0700
Subject: [PATCH] libmultipathd Avoid parsing errors due to unsupported
 designators

Unsupported designators, even if they are correct, will result
in parsing errors. Add support for these two:

Logical Unit Group (0x6)
Vendor Specific (0x0)

Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
invalid device designator at offset 87: 01060004
Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
invalid device designator at offset 131: 02000005

Thanks,
Brian

mwilck: added descriptor type 7 (MD5) for completeness.

Signed-off-by: Brian Bunker <brian@purestorage.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/discovery.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 3a5ba17..6865cd9 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1211,6 +1211,17 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
 			invalid = (d[3] < 8);
 			new_prio = 2;
 			break;
+		case 0x6:
+			/* Logical Unit Group */
+			invalid = (d[3] != 4);
+			break;
+		case 0x7:
+			/* MD5 logical unit designator */
+			invalid = (d[3] != 16);
+			break;
+		case 0x0:
+			/* Vendor Specific */
+			break;
 		case 0xa:
 			condlog(2, "%s: UUID identifiers not yet supported",
 				__func__);
-- 
2.39.2


[-- Attachment #3: Type: text/plain, Size: 98 bytes --]

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [dm-devel] [PATCH] libmultipathd Avoid parsing errors due to unsupported designators
  2023-03-23 20:23 ` Martin Wilck
@ 2023-03-24 14:25   ` Benjamin Marzinski
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Marzinski @ 2023-03-24 14:25 UTC (permalink / raw)
  To: Martin Wilck; +Cc: dm-devel, brian

On Thu, Mar 23, 2023 at 08:23:24PM +0000, Martin Wilck wrote:
> On Mon, 2023-03-20 at 12:22 -0700, Brian Bunker wrote:
> > Unsupported designators, even if they are correct, will result
> > in parsing errors. Add support for these two:
> > 
> > Logical Unit Group (0x6)
> > Vendor Specific (0x0)
> > 
> > Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
> > invalid device designator at offset 87: 01060004
> > Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
> > invalid device designator at offset 131: 02000005
> > 
> > Thanks,
> > Brian
> 
> Thanks. I've modified your patch as attached.
> 
> Martin
> 

> From 9edbc2b6154786a9e7bb38890d023301c65c8a6a Mon Sep 17 00:00:00 2001
> From: Brian Bunker <brian@purestorage.com>
> Date: Mon, 20 Mar 2023 12:22:02 -0700
> Subject: [PATCH] libmultipathd Avoid parsing errors due to unsupported
>  designators
> 
> Unsupported designators, even if they are correct, will result
> in parsing errors. Add support for these two:
> 
> Logical Unit Group (0x6)
> Vendor Specific (0x0)
> 
> Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
> invalid device designator at offset 87: 01060004
> Mar 20 13:37:35 init107-18 multipath[45016]: parse_vpd_pg83:
> invalid device designator at offset 131: 02000005
> 
> Thanks,
> Brian
> 
> mwilck: added descriptor type 7 (MD5) for completeness.
> 
> Signed-off-by: Brian Bunker <brian@purestorage.com>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> ---
>  libmultipath/discovery.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> index 3a5ba17..6865cd9 100644
> --- a/libmultipath/discovery.c
> +++ b/libmultipath/discovery.c
> @@ -1211,6 +1211,17 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
>  			invalid = (d[3] < 8);
>  			new_prio = 2;
>  			break;
> +		case 0x6:
> +			/* Logical Unit Group */
> +			invalid = (d[3] != 4);
> +			break;
> +		case 0x7:
> +			/* MD5 logical unit designator */
> +			invalid = (d[3] != 16);
> +			break;
> +		case 0x0:
> +			/* Vendor Specific */
> +			break;
>  		case 0xa:
>  			condlog(2, "%s: UUID identifiers not yet supported",
>  				__func__);
> -- 
> 2.39.2
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-24 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 19:22 [dm-devel] [PATCH] libmultipathd Avoid parsing errors due to unsupported designators Brian Bunker
2023-03-23 20:23 ` Martin Wilck
2023-03-24 14:25   ` Benjamin Marzinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).