Skip to content
Permalink
Browse files

Fix get_special_prop() build failure

The cast of the size_t returned by strlcpy() to a uint64_t by the
VERIFY3U can result in a build failure when CONFIG_FORTIFY_SOURCE
is set.  This is due to the additional hardening.  Since the token
will always fit in strval the VERIFY3U has been removed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #8999
  • Loading branch information...
behlendorf committed Jul 11, 2019
1 parent c3fba90 commit b32ad9144ba680cd953735b2d382bf7f7fc379cc
Showing with 2 additions and 4 deletions.
  1. +2 −4 module/zfs/zcp_get.c
@@ -423,13 +423,11 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, const char *dsname,
case ZFS_PROP_RECEIVE_RESUME_TOKEN: {
char *token = get_receive_resume_stats_impl(ds);

VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN),
<, ZAP_MAXVALUELEN);
(void) strlcpy(strval, token, ZAP_MAXVALUELEN);
if (strcmp(strval, "") == 0) {
char *childval = get_child_receive_stats(ds);

VERIFY3U(strlcpy(strval, childval, ZAP_MAXVALUELEN),
<, ZAP_MAXVALUELEN);
(void) strlcpy(strval, childval, ZAP_MAXVALUELEN);
if (strcmp(strval, "") == 0)
error = ENOENT;

0 comments on commit b32ad91

Please sign in to comment.
You can’t perform that action at this time.