public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@linux.intel.com>
To: Andy Lutomirski <luto@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	X86 ML <x86@kernel.org>
Subject: Re: [RFC][PATCH] x86, syscalls: use SYSCALL_DEFINE() macros for sys_modify_ldt()
Date: Fri, 13 Oct 2017 15:21:48 -0700	[thread overview]
Message-ID: <555fa610-77ab-99d2-70e1-aa2e16bb2c6b@linux.intel.com> (raw)
In-Reply-To: <CALCETrWbGF0_=_JceQgPO31A7Zbk+nTD3=xD71koCdQC_qGA7g@mail.gmail.com>

On 10/13/2017 02:03 PM, Andy Lutomirski wrote:
>>
>> -asmlinkage int sys_modify_ldt(int func, void __user *ptr,
>> -                             unsigned long bytecount)
>> +SYSCALL_DEFINE3(modify_ldt, int , func , void __user * , ptr ,
>> +               unsigned long , bytecount)
> sys_modify_ldt() returns int, which is wrong, and it's visibly wrong
> to 64-bit user code.  So I think you need to make sure that the return
> value is cast to int in all cases.

I'm not quite following.

Is there any difference between having something return 'int' and having
it return 'long' but only use the lower 32 bits?  The caller is surely
expecting its result in the lower 32 bits, but this should not change that.

Did you just mean that we need to careful to cast the result in
sys_modify_ldt() over to an 'int' before returning it?

  reply	other threads:[~2017-10-13 22:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 20:39 [RFC][PATCH] x86, syscalls: use SYSCALL_DEFINE() macros for sys_modify_ldt() Dave Hansen
2017-10-13 21:03 ` Andy Lutomirski
2017-10-13 22:21   ` Dave Hansen [this message]
2017-10-13 23:49   ` Brian Gerst
2017-10-14  4:42     ` Andy Lutomirski
2017-10-14  6:25       ` Brian Gerst
2017-10-14 16:35         ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=555fa610-77ab-99d2-70e1-aa2e16bb2c6b@linux.intel.com \
    --to=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox