Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: kvs: support configuration of max transaction count #6581

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Jan 25, 2025

Per discussion in #6125, denial-of-service attacks could be made against the KVS by very very large KVS transactions.

Support two configurations for capping the number of transactions made by users. One for each individual transaction made by a caller and one for the combined total of operations from a fence.

For the time being, I made the default 64K for the transaction cap and 1M for the fence cap.

I made this WIP only b/c those defaults may be tweaked depending on what stats we get from the prior PR #6556. I would like to merge only after we gather a bit of data, although I'd be quite shocked if we have to adjust the defaults. Edit: Or alternately, if we'd like to just get the code in, we could default the max to LLONG_MAX and lower the default at a later time.

Only other thought is I decided to return the errno E2BIG if we went across a max cap boundary. It's possible there is a superior errno for this, I picked it b/c I thought "ehhh that's not bad".

@chu11
Copy link
Member Author

chu11 commented Feb 3, 2025

re-pushed, removing all fence related parts of this PR, since KVS fence support is now gone

chu11 added 3 commits February 3, 2025 11:35
Problem: A KVS denial of service is possible because there is
no maximum on the number of operations a user can submit in a KVS
transaction.  For example, a KVS transaction with billions of KVS
entries would lead to a severe degradation in KVS performance.

Support a new KVS configuration "transaction-max-ops" that will reject
KVS transaction with operations above a maximum count.  The default
maximum is 65536.

Fixes flux-framework#6572
Problem: The new kvs transaction-max-ops configuration
option is not documented.

Add documentation to flux-config-kvs(5)
Problem: There is no coverage for the new kvs transaction-max-ops
configuration.

Add coverage in t1005-kvs-security.t.
@chu11 chu11 force-pushed the issue6572_kvs_transaction_max branch from 07ed829 to 7b1939d Compare February 3, 2025 19:35
@chu11
Copy link
Member Author

chu11 commented Feb 3, 2025

re-pushed, removing all the fence stuff that is no longer relevant b/c KVS fence support was removed

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.47%. Comparing base (a50142e) to head (7b1939d).

Files with missing lines Patch % Lines
src/modules/kvs/kvs.c 90.90% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6581      +/-   ##
==========================================
+ Coverage   79.45%   79.47%   +0.01%     
==========================================
  Files         531      531              
  Lines       88282    88304      +22     
==========================================
+ Hits        70145    70177      +32     
+ Misses      18137    18127      -10     
Files with missing lines Coverage Δ
src/modules/kvs/kvs.c 72.62% <90.90%> (+0.27%) ⬆️

... and 13 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant