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]
Message-ID: <20150413122911.GW10964@mwanda>
Date:	Mon, 13 Apr 2015 15:31:09 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Peter Senna Tschudin <peter.senna@...il.com>
Cc:	Geert Uytterhoeven <geert@...ux-m68k.org>,
	driverdevel <devel@...verdev.osuosl.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jun Tian <jun.j.tian@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Garret Kelly <garret.kelly@...il.com>,
	Octavian Purdila <octavian.purdila@...el.com>,
	Nick Kralevich <nnk@...gle.com>, Alan <alan@...ux.intel.com>
Subject: Re: [PATCH] Fix pointer cast for 32 bits arch

On Mon, Apr 13, 2015 at 01:25:15PM +0200, Peter Senna Tschudin wrote:
> Line 4677 of http://pastebin.com/2bi9Dg7k looks like a bug
> 
> diff -u -p a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
> -       regs->nip = (unsigned long) (unsigned long)ksig->ka.sa.sa_handler;

I don't know about "bug" but it does look uninentional, yes.

Double casting is probably a good thing to print a static checker
warning about.

Other static checkers complain about:

1)	~(char)foo;

	(char)foo is type promoted to an int before the bitwise NOT.

2)	(long *)&some_int

3)	some_function((struct foo *)ptr);

	Casting function arguments is almost always wrong.  I check this
	with Smatch.  I don't remember the details.

4)	(long long)(x + y)

	Probably it should be (long long)x + y

regards,
dan carpenter

--
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