You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Attila Doroszlai (Jira)" <ji...@apache.org> on 2021/03/18 08:24:00 UTC

[jira] [Assigned] (HDDS-4993) Add guardrail for reserved buffer size when DN reads a chunk

     [ https://issues.apache.org/jira/browse/HDDS-4993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Attila Doroszlai reassigned HDDS-4993:
--------------------------------------

    Assignee: Attila Doroszlai

> Add guardrail for reserved buffer size when DN reads a chunk
> ------------------------------------------------------------
>
>                 Key: HDDS-4993
>                 URL: https://issues.apache.org/jira/browse/HDDS-4993
>             Project: Apache Ozone
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Wei-Chiu Chuang
>            Assignee: Attila Doroszlai
>            Priority: Major
>
> https://github.com/apache/ozone/blob/db3c50d9fc4b1048cd83074343cc00444f0b24f7/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/FilePerBlockStrategy.java#L148
> {code}
>     long len = info.getLen();
>     long offset = info.getOffset();
>     ByteBuffer data = ByteBuffer.allocate((int) len);
> {code}
> DN reserves a byte buffer for client's chunk read request based on whatever client specifies, without check. This is bad. Client can send a message forcing DN to allocate up to 2GB memory per request. (Fortunately the grpc handler captures the OOM exception so DN doesn't crash)
> Propose: add a guardrail check. XceiverServerGrpc set max inbound message size as 32MB (OZONE_SCM_CHUNK_MAX_SIZE). We should make sure the requested length is less than this too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org