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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 20 Aug 2010 17:14:01 -0400
From:	Jeff Mahoney <jeffm@...e.com>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:	Yoshinori Sato <ysato@...rs.sourceforge.jp>
Subject: [patch 00/10] ioctls: Convert ten architectures to asm-generic/ioctls.h

Around the time of the 32-/64-bit x86 merge, asm-generic/ioctls.h was
created. It was modeled after the x86 version and new architectures are
encouraged to use it.

It turns out that ten other architectures have done essentially the same
thing, but by copying it instead. This series of patches updates those
architectures to use the generic version.

There were a few differences between the arch-specific versions and the
generic one, but none problematic enough to preclude this merge.

Specifically:
- 5 architectures define their own FIOQSIZE. asm-generic/ioctls.h
  already contains an ifndef for exactly this case.
- cris defines two new rs-485 ioctls and redefines another one. The
  two new ones are kept private and an ifndef line is added to the
  generic list.
- frv and h8300 provide TIOCTTYGSTRUCT, which is completely unused.
  I've kept it private to those architectures but it should probably
  be removed.
- The generic list contains the termiox ioctl set. This seems to have
  been added to x86 with the expectation that other arch maintainers
  would add it to their own. New architectures have inherited this
  automatically via asm-generic/ioctls.h and there isn't anything
  inherently architecture specific about it. It's safe to just
  add it to the affected architectures. If there is resistance to
  this, I can submit a separate patchset to enable it on those
  architectures and THEN apply this patchet, but it seems like a
  waste of time.
- The generic list provides TIOCGRS485 and TIOCSRS485, but they are
  still only used by two drivers, which are only available on arm,
  avr32, and cris. Again, there is nothing inherently architecture
  specific about it and new architectures have inherited it already.

All this can be verified with the following script. It strips
whitespace, comments, and the leading ifndef/define header, sorts the
output, and compares it without whitespace. It doesn't do any value
processing, strictly 1:1 text.

I plan to audit the remaining architectures when I get a chance. Those
are parisc, powerpc, sh, and xtensa.

-Jeff

---->8----
#!/bin/sh
process_include() {
	sed -ne 's/^#[[:space:]]*define/#define/p' < $1 | \
	sed -e 's#/\*.*##'| sed -e 's/[[:space:]]*$//' | \
	egrep -v '#define _*(ASM|ARCH)'|grep -v ^$ | sort -k 2
}

process_include include/asm-generic/ioctls.h > generic_ioctls

for arch in arm avr32 cris frv h8300 ia64 m32r m68k mn10300 s390; do
	process_include arch/$arch/include/asm/ioctls.h > $arch-ioctls
	echo [$arch]
	diff -wu $arch-ioctls generic_ioctls #|grep '^+#'
	rm -f $arch-ioctls
done

rm generic_ioctls
----8<----


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