All of lore.kernel.org
 help / color / mirror / Atom feed
From: mwilck@suse.com
To: Benjamin Marzinski <bmarzins@redhat.com>,
	Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [dm-devel] [PATCH v2 14/15] libmultipath: apply_format(): prevent buffer overflow
Date: Mon,  4 Apr 2022 19:04:56 +0200	[thread overview]
Message-ID: <20220404170457.16021-15-mwilck@suse.com> (raw)
In-Reply-To: <20220404170457.16021-1-mwilck@suse.com>

[-- Attachment #1: Type: application/octet-stream, Size: 569 bytes --]

From: Martin Wilck <mwilck@suse.com>

Potential overflow found by coverity (CID 376918).
---
 libmultipath/callout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/callout.c b/libmultipath/callout.c
index dac088c..57c3481 100644
--- a/libmultipath/callout.c
+++ b/libmultipath/callout.c
@@ -160,7 +160,7 @@ int apply_format(char * string, char * cmd, struct path * pp)
 	myfree = CALLOUT_MAX_SIZE;
 
 	if (!pos) {
-		strcpy(dst, string);
+		strlcpy(dst, string, CALLOUT_MAX_SIZE);
 		return 0;
 	}
 
-- 
2.35.1


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

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

  parent reply	other threads:[~2022-04-04 17:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 17:04 [dm-devel] [PATCH v2 00/15] Rework uevent filtering and merging mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 01/15] multipathd: allow adding git rev as version suffix mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 02/15] multipathd: don't switch to DAEMON_IDLE during startup mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 03/15] uevent_dispatch(): use while in wait loop mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 04/15] libmultipath: uevent_dispatch(): process uevents one by one mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 05/15] multipathd: reconfigure: disallow changing uid_attrs mwilck
2022-04-04 20:25   ` Benjamin Marzinski
2022-04-04 17:04 ` [dm-devel] [PATCH v2 06/15] libmultipath: microoptimize uevent filtering and merging mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 07/15] libmultipath: uevent_listen(): don't delay uevents mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 08/15] libmultipath: uevent: use struct to pass parameters around mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 09/15] libmultipath: uevent: log statistics about filtering and merging mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 10/15] libmultipath: merge_uevq(): filter first, then merge mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 11/15] libmultipath: uevent_filter(): filter previously merged events mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 12/15] libmultipath: uevent: improve log messages mwilck
2022-04-04 17:04 ` [dm-devel] [PATCH v2 13/15] libmultipath: uevent: add debug messages for event queue mwilck
2022-04-04 17:04 ` mwilck [this message]
2022-04-04 20:34   ` [dm-devel] [PATCH v2 14/15] libmultipath: apply_format(): prevent buffer overflow Benjamin Marzinski
2022-04-04 17:04 ` [dm-devel] [PATCH v2 15/15] libmultipath: avoid memory leak with uid_attrs mwilck
2022-04-04 20:45   ` Benjamin Marzinski
2022-04-04 19:39 ` [dm-devel] [PATCH v2 00/15] Rework uevent filtering and merging Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220404170457.16021-15-mwilck@suse.com \
    --to=mwilck@suse.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.