Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 458426

Summary: =sys-kernel/gentoo-sources-3.8.0 fails to compile: invalid operands to binary == (have ‘kuid_t’ and ‘kuid_t’)
Product: Gentoo Linux Reporter: Nick Novikov <nick.novikov>
Component: New packagesAssignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>
Status: RESOLVED FIXED    
Severity: normal CC: jaak, nick.novikov
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: kernel config
modified kcopy patch

Description Nick Novikov 2013-02-20 09:58:09 UTC
drivers/char/kcopy/kcopy.c: In function ‘kcopy_validate_task’:
drivers/char/kcopy/kcopy.c:257:31: error: invalid operands to binary == (have ‘kuid_t’ and ‘kuid_t’)
drivers/char/kcopy/kcopy.c:257:67: error: invalid operands to binary == (have ‘kuid_t’ and ‘kuid_t’)


Reproducible: Always




Looks like CONFIG_UIDGID_STRICT_TYPE_CHECKS makes 'kuid_t' a struct, not uid_t
Comment 1 Nick Novikov 2013-02-20 09:59:12 UTC
Created attachment 339486 [details]
kernel config
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2013-02-20 11:25:11 UTC
*** Bug 458442 has been marked as a duplicate of this bug. ***
Comment 3 Yvan Royon 2013-02-22 16:49:30 UTC
To trigger this bug, you need:

1) KCopy enabled, under Device Drivers -> Character Devices.
This comes from the Gentoo patchset: 2400_kcopy-patch-for-infiniband-driver.patch

2) The User Namespace stuff (USER_NS under General Setup -> Namespaces support).

I suggest modifying the function kcopy_validate_task in the aforementioned Gentoo patch:

static int kcopy_validate_task(struct task_struct *p)
{
    return p && (uid_eq(current_euid(), task_euid(p)) || uid_eq(current_euid(), task_uid(p)));
}

instead of:

static int kcopy_validate_task(struct task_struct *p)
{
    return p && ((current_euid() == task_euid(p)) || (current_euid() == task_uid(p)));
}
Comment 4 Yvan Royon 2013-02-22 16:51:53 UTC
Created attachment 339724 [details, diff]
modified kcopy patch

The Gentoo kcopy patch with modified function kcopy_validate_task.

Please test, I didn't...
Comment 5 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-03-02 20:59:32 UTC
*gentoo-sources-3.8.1 (01 Mar 2013)
*gentoo-sources-3.7.10 (01 Mar 2013)

  01 Mar 2013; Tom Wijsman <TomWij@gentoo.org> +gentoo-sources-3.7.10.ebuild,
  +gentoo-sources-3.8.1.ebuild:
  Linux patches 3.7.10 and 3.8.1. Updated fbcondecor-0.9.6 to properly work with
  the 3.7 and 3.8 kernel branches according to bug #459060 thanks to Robert
  Cabrera. Modified kcopy patch according to bug #458426 thanks to Yvan Royon,
  since that was focused on 3.7 I have made that apply cleanly in 3.8 as well.