flux-core
flux-core copied to clipboard
kvs: ensure large values exceeding maximum rejected consistently
Following up #6264, it is not clear that the KVS ensures that all data is below the maximum allowed and that errors propogate correctly / consistently. For example:
int flux_kvs_txn_put (flux_kvs_txn_t *txn,
int flags,
const char *key,
const char *value);
internally flux_kvs_txn_put()
calls strlen (value)
which can return size_t
which can be larger than int
. It's not super clear what the fallout of such calls could be. That value is passed to treeobj_create_val()
(takes an int
), which then calls base64_encoded_length ()
(takes a size_t
). I'm not sure what error would result here.
In
int flux_kvs_txn_pack (flux_kvs_txn_t *txn,
int flags,
const char *key,
const char *fmt,
...);
It appears internally the resulting string after json_pack()
is called is not checked for length either before being passed to treeobj_create_val()
.
Also need to audit that large values sent directly to the KVS module outside of the API are rejected accordingly.