• Waiman Long's avatar
    ipc: IPCMNI limit check for msgmni and shmmni · 6730e658
    Waiman Long authored
    Patch series "ipc: IPCMNI limit check for *mni & increase that limit", v9.
    
    The sysctl parameters msgmni, shmmni and semmni have an inherent limit of
    IPC_MNI (32k).  However, users may not be aware of that because they can
    write a value much higher than that without getting any error or
    notification.  Reading the parameters back will show the newly written
    values which are not real.
    
    The real IPCMNI limit is now enforced to make sure that users won't put in
    an unrealistic value.  The first 2 patches enforce the limits.
    
    There are also users out there requesting increase in the IPCMNI value.
    The last 2 patches attempt to do that by using a boot kernel parameter
    "ipcmni_extend" to increase the IPCMNI limit from 32k to 8M if the users
    really want the extended value.
    
    This patch (of 4):
    
    A user can write arbitrary integer values to msgmni and shmmni sysctl
    parameters without getting error, but the actual limit is really IPCMNI
    (32k).  This can mislead users as they think they can get a value that is
    not real.
    
    The right limits are now set for msgmni and shmmni so that the users will
    become aware if they set a value outside of the acceptable range.
    
    Link: http://lkml.kernel.org/r/1536352137-12003-2-git-send-email-longman@redhat.comSigned-off-by: default avatarWaiman Long <longman@redhat.com>
    Acked-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
    Reviewed-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    Cc: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    6730e658
ipc_sysctl.c 5.44 KB