[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrVhqMjYWT-kbOS1+dyUmokRVsKKqEN=qLsRoC+QphKE7g@mail.gmail.com>
Date: Wed, 31 May 2017 15:20:01 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Andy Lutomirski <luto@...nel.org>, x86-ml <x86@...nel.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] x86/ldt: Rename ldr_struct.size to .n_entries
On Wed, May 31, 2017 at 10:08 AM, Borislav Petkov <bp@...en8.de> wrote:
> Hey guys,
>
> do you have anything against the below renaming?
>
> ldt->size is simply confusing while it wants to be called ldt->n_entries
> as it is used like this throughout the code.
Agreed, but...
> static int read_ldt(void __user *ptr, unsigned long bytecount)
> {
> - int retval;
> - unsigned long size;
> struct mm_struct *mm = current->mm;
> + unsigned long num_entries;
> + int retval;
...
> - size = mm->context.ldt->size * LDT_ENTRY_SIZE;
> - if (size > bytecount)
> - size = bytecount;
> + num_entries = mm->context.ldt->n_entries * LDT_ENTRY_SIZE;
> + if (num_entries > bytecount)
> + num_entries = bytecount;
num_bytes, perhaps?
> @@ -248,7 +248,7 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
> mutex_lock(&mm->context.lock);
>
> old_ldt = mm->context.ldt;
> - oldsize = old_ldt ? old_ldt->size : 0;
> + oldsize = old_ldt ? old_ldt->n_entries : 0;
how about old_n_entries?
--Andy
Powered by blists - more mailing lists