lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 13 Jan 2015 18:05:04 +0200
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	Chris Metcalf <cmetcalf@...hip.com>
Cc:	linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
	linux-arch@...r.kernel.org
Subject: Re: [PATCH v2 23/40] tile: enable sparse checks for get/put_user

On Tue, Jan 13, 2015 at 10:55:26AM -0500, Chris Metcalf wrote:
> On 1/13/2015 4:45 AM, Michael S. Tsirkin wrote:
> >On Mon, Jan 12, 2015 at 07:08:36PM -0500, Chris Metcalf wrote:
> >>The key changes are to copy the x86 definition of __inttype(), and then to
> >>arrange to use an intermediate integral type that gets assigned to or from
> >>the actual typed value so as to expose any sparse issues.
> >>
> >>If this works for you, I'm happy to queue it in the tile tree, or I can
> >>provide a proper git commit for you to include in your series, whichever
> >>works better for you.
> >Please queue it up for 3.20. Extra __force is needed in a couple of
> >places - would you like to fix this up yourself, or do you want me to
> >write a patch on top?
> 
> I'll fold in your suggestions to my patch.
> 
> >>@@ -178,7 +178,7 @@ extern int fixup_exception(struct pt_regs *regs);
> >>                              "9:"                                       \
> >>                              : "=r" (ret), "=r" (__a), "=&r" (__b)      \
> >>                              : "r" (ptr), "i" (-EFAULT));               \
> >>-               (x) = (__typeof(x))(__typeof((x)-(x)))                  \
> >>+               (x) = (__typeof(x))(__inttype(x))                       \
> >>                         (((u64)__hi32(__a, __b) << 32) |                \
> >>                          __lo32(__a, __b));                             \
> >>         })
> >This cast to __typeof(x) needs to be done with __force, otherwise
> >there will be a warning with bitwise types.
> 
> Actually, this place no longer needs any casting at all, on reflection.
> I've changed the __get_user() code to do the "get" into an __inttype
> uniformly, so __get_user_8 will always have a u64 type for "x" here.
> 
> I'll cc you on the updated patch, so if you'd like to add your
> Reviewed-by tag to it, let me know.

Sure.

> -- 
> Chris Metcalf, EZChip Semiconductor
> http://www.ezchip.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ