lkml.org 
[lkml]   [2012]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[ 105/108] x86, tls: Off by one limit check
    3.0-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Dan Carpenter <dan.carpenter@oracle.com>

    commit 8f0750f19789cf352d7e24a6cc50f2ab1b4f1372 upstream.

    These are used as offsets into an array of GDT_ENTRY_TLS_ENTRIES members
    so GDT_ENTRY_TLS_ENTRIES is one past the end of the array.

    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Link: http://lkml.kernel.org/r/20120324075250.GA28258@elgon.mountain
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/x86/kernel/tls.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/arch/x86/kernel/tls.c
    +++ b/arch/x86/kernel/tls.c
    @@ -163,7 +163,7 @@ int regset_tls_get(struct task_struct *t
    {
    const struct desc_struct *tls;

    - if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
    + if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
    (pos % sizeof(struct user_desc)) != 0 ||
    (count % sizeof(struct user_desc)) != 0)
    return -EINVAL;
    @@ -198,7 +198,7 @@ int regset_tls_set(struct task_struct *t
    struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES];
    const struct user_desc *info;

    - if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
    + if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
    (pos % sizeof(struct user_desc)) != 0 ||
    (count % sizeof(struct user_desc)) != 0)
    return -EINVAL;



    \
     
     \ /
      Last update: 2012-03-30 23:11    [W:0.025 / U:30.400 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site