parent
5aec67d5bb
commit
78e18981fb
|
@ -242,12 +242,10 @@ class Root : public Root_component
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if donated ram quota suffices for both communication
|
* Check if donated ram quota suffices for both communication
|
||||||
* buffers. Also check both sizes separately to handle a
|
* buffers and check for overflow
|
||||||
* possible overflow of the sum of both sizes.
|
|
||||||
*/
|
*/
|
||||||
if (tx_buf_size > ram_quota - session_size
|
if (tx_buf_size + rx_buf_size < tx_buf_size ||
|
||||||
|| rx_buf_size > ram_quota - session_size
|
tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
||||||
|| tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
|
||||||
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
||||||
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
||||||
throw Genode::Root::Quota_exceeded();
|
throw Genode::Root::Quota_exceeded();
|
||||||
|
|
|
@ -203,12 +203,10 @@ class Root : public Genode::Root_component<Wifi_session_component,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if donated ram quota suffices for both communication
|
* Check if donated ram quota suffices for both communication
|
||||||
* buffers. Also check both sizes separately to handle a
|
* buffers and check for overflow
|
||||||
* possible overflow of the sum of both sizes.
|
|
||||||
*/
|
*/
|
||||||
if (tx_buf_size > ram_quota - session_size
|
if (tx_buf_size + rx_buf_size < tx_buf_size ||
|
||||||
|| rx_buf_size > ram_quota - session_size
|
tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
||||||
|| tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
|
||||||
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
||||||
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
||||||
throw Genode::Root::Quota_exceeded();
|
throw Genode::Root::Quota_exceeded();
|
||||||
|
|
|
@ -48,12 +48,10 @@ class Nic::Root : public Genode::Root_component<SESSION_COMPONENT,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if donated ram quota suffices for both communication
|
* Check if donated ram quota suffices for both communication
|
||||||
* buffers. Also check both sizes separately to handle a
|
* buffers and check for overflow
|
||||||
* possible overflow of the sum of both sizes.
|
|
||||||
*/
|
*/
|
||||||
if (tx_buf_size > ram_quota - session_size
|
if (tx_buf_size + rx_buf_size < tx_buf_size ||
|
||||||
|| rx_buf_size > ram_quota - session_size
|
tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
||||||
|| tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
|
||||||
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
||||||
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
||||||
throw Genode::Root::Quota_exceeded();
|
throw Genode::Root::Quota_exceeded();
|
||||||
|
|
|
@ -52,12 +52,10 @@ class Root : public Genode::Root_component<Lan9118, Genode::Single_client>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if donated ram quota suffices for both communication
|
* Check if donated ram quota suffices for both communication
|
||||||
* buffers. Also check both sizes separately to handle a
|
* buffers and check for overflow
|
||||||
* possible overflow of the sum of both sizes.
|
|
||||||
*/
|
*/
|
||||||
if (tx_buf_size > ram_quota - session_size
|
if (tx_buf_size + rx_buf_size < tx_buf_size ||
|
||||||
|| rx_buf_size > ram_quota - session_size
|
tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
||||||
|| tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
|
||||||
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
||||||
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
||||||
throw Genode::Root::Quota_exceeded();
|
throw Genode::Root::Quota_exceeded();
|
||||||
|
|
|
@ -166,12 +166,10 @@ class Nic::Root : public Genode::Root_component<Loopback_component>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if donated ram quota suffices for both communication
|
* Check if donated ram quota suffices for both communication
|
||||||
* buffers. Also check both sizes separately to handle a
|
* buffers and check for overflow
|
||||||
* possible overflow of the sum of both sizes.
|
|
||||||
*/
|
*/
|
||||||
if (tx_buf_size > ram_quota - session_size
|
if (tx_buf_size + rx_buf_size < tx_buf_size ||
|
||||||
|| rx_buf_size > ram_quota - session_size
|
tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
||||||
|| tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
|
||||||
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
||||||
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
||||||
throw Root::Quota_exceeded();
|
throw Root::Quota_exceeded();
|
||||||
|
|
|
@ -230,12 +230,10 @@ class Root : public Genode::Root_component<Openvpn_component, Genode::Single_cli
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if donated ram quota suffices for both communication
|
* Check if donated ram quota suffices for both communication
|
||||||
* buffers. Also check both sizes separately to handle a
|
* buffers and check for overflow
|
||||||
* possible overflow of the sum of both sizes.
|
|
||||||
*/
|
*/
|
||||||
if (tx_buf_size > ram_quota - session_size
|
if (tx_buf_size + rx_buf_size < tx_buf_size ||
|
||||||
|| rx_buf_size > ram_quota - session_size
|
tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
||||||
|| tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
|
||||||
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
PERR("insufficient 'ram_quota', got %zd, need %zd",
|
||||||
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
ram_quota, tx_buf_size + rx_buf_size + session_size);
|
||||||
throw Genode::Root::Quota_exceeded();
|
throw Genode::Root::Quota_exceeded();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user