diff --git a/[refs] b/[refs] index 5e011f7c3d3b..78698c911693 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ee527cd3a20c2aeaac17d939e5d011f7a76d69f5 +refs/heads/master: af7c693f146069a1f44739acef9abf1bc27f7247 diff --git a/trunk/ipc/compat.c b/trunk/ipc/compat.c index fa18141539fb..8b44aa9a7c95 100644 --- a/trunk/ipc/compat.c +++ b/trunk/ipc/compat.c @@ -542,6 +542,8 @@ static inline int put_compat_shminfo64(struct shminfo64 *smi, if (!access_ok(VERIFY_WRITE, up64, sizeof(*up64))) return -EFAULT; + if (smi->shmmax > INT_MAX) + smi->shmmax = INT_MAX; err = __put_user(smi->shmmax, &up64->shmmax); err |= __put_user(smi->shmmin, &up64->shmmin); err |= __put_user(smi->shmmni, &up64->shmmni); @@ -557,6 +559,8 @@ static inline int put_compat_shminfo(struct shminfo64 *smi, if (!access_ok(VERIFY_WRITE, up, sizeof(*up))) return -EFAULT; + if (smi->shmmax > INT_MAX) + smi->shmmax = INT_MAX; err = __put_user(smi->shmmax, &up->shmmax); err |= __put_user(smi->shmmin, &up->shmmin); err |= __put_user(smi->shmmni, &up->shmmni);