diff --git a/winsup/cygwin/resource.cc b/winsup/cygwin/resource.cc index 46d74b984..c4c79ca6f 100644 --- a/winsup/cygwin/resource.cc +++ b/winsup/cygwin/resource.cc @@ -261,6 +261,12 @@ setrlimit (int resource, const struct rlimit *rlp) __leave; } + if (rlp->rlim_cur > oldlimits.rlim_max) + { + set_errno (EPERM); + __leave; + } + switch (resource) { case RLIMIT_AS: