From: Randy Dunlap <rdunlap@infradead.org>
To: Steve French <smfrench@gmail.com>,
CIFS <linux-cifs@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
LAK <linux-arm-kernel@lists.infradead.org>
Subject: Re: Fwd: [EXTERNAL] Re: ioctl.c:undefined reference to `__get_user_bad'
Date: Mon, 17 May 2021 14:06:33 -0700 [thread overview]
Message-ID: <5b29fe73-7c95-0b9f-3154-c053fa94cb67@infradead.org> (raw)
In-Reply-To: <d3e24342-4f30-6a2f-3617-a917539eac94@infradead.org>
[adding back linux-arm-kernel; what happened to it? ]
On 5/17/21 2:04 PM, Randy Dunlap wrote:
> On 5/17/21 10:13 AM, Steve French wrote:
>>> If you fix the issue, kindly add following tag as appropriate
>>> Reported-by: kernel test robot <lkp@intel.com>
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>> arm-linux-gnueabi-ld: fs/cifs/ioctl.o: in function `cifs_dump_full_key':
>>>>> ioctl.c:(.text+0x44): undefined reference to `__get_user_bad'
>>>
>>
>> <snip>
>>
>>> # CONFIG_MMU is not set
>>>
>>> and arch/arm/include/asm/uaccess.h does not implement get_user(size 8 bytes)
>>> for the non-MMU case:
>>
>> I see another place in fs/cifs/ioctl.c where we already had been doing
>> a get_user() into a u64 - any idea what you are supposed to do
>> instead? Any example code where people have worked around this.
>
> Hi Steve,
>
> This change in cifs_dump_full_key() makes it build OK:
>
> - if (get_user(suid, (__u64 __user *)arg))
> + if (get_user(suid, (unsigned int __user *)arg))
>
>
> That is what the other call uses:
>
> case FS_IOC_SETFLAGS:
> cifs_dbg(VFS, "cifs ioctl FS_IOC_SETFLAGS:\n");
> if (pSMBFile == NULL)
> break;
> tcon = tlink_tcon(pSMBFile->tlink);
> caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
>
> if (get_user(ExtAttrBits, (int __user *)arg)) {
> rc = -EFAULT;
> break;
> }
>
> However, my reading/understanding is that the one immediately above
> is incorrect, as is the -/+ patch above it, since get_user() gets its
> data size (1, 2, 4, 8) from the type of the pointer that is passed to it.
> For 8 bytes (64 bits), 'int' is not sufficient, so IMO the get_user()
> call that builds:
> if (get_user(ExtAttrBits, (int __user *)arg)) {
> is a bug. It should be:
> if (get_user(ExtAttrBits, (__u64 __user *)arg)) {
> and if I make that latter change in the source file, the build says:
>
> arm-linux-gnueabi-ld: fs/cifs/ioctl.o: in function `cifs_dump_full_key':
> ioctl.c:(.text+0x14): undefined reference to `__get_user_bad'
> arm-linux-gnueabi-ld: fs/cifs/ioctl.o: in function `cifs_ioctl':
> ioctl.c:(.text+0x1f2): undefined reference to `__get_user_bad'
>
> so now both of them fail on the get_user() of 8 bytes.
>
> Hope that clarifies things. It tells me that arm no-MMU still
> needs support for get_user() of size 8 bytes.
>
--
~Randy
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-17 21:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202105110829.MHq04tJz-lkp@intel.com>
2021-05-17 6:49 ` ioctl.c:undefined reference to `__get_user_bad' Randy Dunlap
[not found] ` <MN2PR21MB15184963469FEC9B13433964E42D9@MN2PR21MB1518.namprd21.prod.outlook.com>
[not found] ` <CAH2r5mswqB9DT21YnSXMSAiU0YwFUNu0ni6f=cW+aLz4ssA8rw@mail.gmail.com>
[not found] ` <d3e24342-4f30-6a2f-3617-a917539eac94@infradead.org>
2021-05-17 21:06 ` Randy Dunlap [this message]
2021-05-18 10:03 ` Fwd: [EXTERNAL] " Russell King (Oracle)
2021-05-19 1:48 ` Randy Dunlap
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=5b29fe73-7c95-0b9f-3154-c053fa94cb67@infradead.org \
--to=rdunlap@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=smfrench@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).