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

Bug 546488

Summary: sys-kernel/spl - PAX: size overflow detected in function zil_itx_create
Product: Gentoo Linux Reporter: Jason Zaman <perfinion>
Component: HardenedAssignee: Richard Yao (RETIRED) <ryao>
Status: RESOLVED FIXED    
Severity: normal CC: pageexec, perfinion, re.emese, sven.eden
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=532992
Whiteboard:
Package list:
Runtime testing required: ---

Description Jason Zaman gentoo-dev 2015-04-13 20:24:09 UTC
upstream bug: https://github.com/zfsonlinux/zfs/issues/2505

There is a SIZE_OVERFLOW detected in the P2ROUNDUP_TYPED macro. I have been using the upstream bug for a while and its been working okay. It is the macros from the linux kernel itself in spl since those are known to work.

The issue is the typing is slightly different so unsure if it is acceptable. Either need to be exactly the same output or need to know exactly what is acceptable output for the macro if a slightly different one is to be used.
Comment 1 PaX Team 2015-04-17 21:46:55 UTC
uhm, i don't quite get what's being reported here ;). do you have a specific problem/question that needs addressing?
Comment 2 Jason Zaman gentoo-dev 2015-04-18 10:02:54 UTC
(In reply to PaX Team from comment #1)
> uhm, i don't quite get what's being reported here ;). do you have a specific
> problem/question that needs addressing?

Heh, I guess I explained badly. 

the problem is this:

#define P2ROUNDUP_TYPED(x, align, type) (-(-(type)(x) & -(type)(align)))

It is valid C but trips up the size overflow extension. The best way is to just change them to something equivalent that doenst trip up the overflow.

Someone else in the github issue posted on the grsec forum a while ago. I decided to once and for all see if this could be fixed.
https://forums.grsecurity.net/viewtopic.php?f=1&t=4016

The best suggestion in the github bug is to use the macros from the linux kernel:
http://lxr.free-electrons.com/source/include/linux/kernel.h?v=3.2#L54
but the types in it are not quite the same so we need to verify everything carefully before it can be merged in.
Comment 3 Jason Zaman gentoo-dev 2015-11-23 10:50:59 UTC
This has been merged into master and I dropped the check in the live ebuild.

commit e5fce67bb30aaee7d7be98527726d260e5d40c85
Author: Jason Zaman <perfinion@gentoo.org>
Date:   Mon Nov 23 18:47:06 2015 +0800

    sys-kernel/spl: remove PAX_SIZE_OVERFLOW check
    
    The patches to fix this have been merged into master now.
    https://github.com/zfsonlinux/zfs/issues/2505
    
    Package-Manager: portage-2.2.20.1