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: <0c4d0f509a99540d87224c05fd27d322@chewa.net>
Date:	Thu, 12 Apr 2012 17:41:53 +0200
From:	Rémi Denis-Courmont <remi@...lab.net>
To:	Mauro Carvalho Chehab <mchehab@...hat.com>
Cc:	James Courtier-Dutton <james.dutton@...il.com>,
	<mchehab@...radead.org>, <linux-media@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [RFC] [PATCH] v4l2: use unsigned rather than enums in ioctl() structs

On Thu, 12 Apr 2012 11:55:12 -0300, Mauro Carvalho Chehab
<mchehab@...hat.com> wrote:
> I can see only two viable fixes for it:
> 
> 1) add a typedef for the enum, using the sizeof(enum) in order to select
> the
> size of the used integer.
> 
> Pros:
> 	- Patch is easy to write/easy to review;
> 	- Won't change the struct size, so applications compiled without
> 	  strong gcc optimization won't break;
> Cons:
> 	- It will add a typedef, with is ugly;
> 	- struct size on 32 bits will be different thant he size on 64 bits
> 	  (not really an issue, as v4l2-compat32 will handle that;

On which platforms do enums occupy 64-bits? Alpha? More to the point, on
which platform is enum not the same size as unsigned?

At least on x86-64, enum is 32-bits and so is unsigned.

> 	- v4l2-compat32 code may require changes.
> 
> 2) just replace it by a 32 bits integer.
> 
> Pros:
> 	- no typedefs;
> 	- struct size won't change between 32/64 bits (except when they also
> 	  have pointers);
> Cons:
> 	- will break ABI. So, a compat code is required;
> 	- will require a "videodev2.h" fork for the legacy API with the enum's;
> 	- will require a compat code to convert from enum into integer and
> 	  vice-versa.
> 
> Comments/Votes?

-- 
Rémi Denis-Courmont
Sent from my collocated server
--
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