Andrew Morton [Fri, 18 Jul 2003 02:26:32 +0000 (19:26 -0700)]
[PATCH] Fix two bugs with process limits (RLIMIT_NPROC)
From: Neil Brown <neilb@cse.unsw.edu.au>
1/ If a setuid process swaps it's real and effective uids and then forks,
the fork fails if the new realuid has more processes
than the original process was limited to.
This is particularly a problem if a user with a process limit
(e.g. 256) runs a setuid-root program which does setuid() + fork()
(e.g. lprng) while root already has more than 256 process (which
is quite possible).
The root problem here is that a limit which should be a per-user
limit is being implemented as a per-process limit with
per-process (e.g. CAP_SYS_RESOURCE) controls.
Being a per-user limit, it should be that the root-user can over-ride
it, not just some process with CAP_SYS_RESOURCE.
This patch adds a test to ignore process limits if the real user is root.
2/ When a root-owned process (e.g. cgiwrap) sets up process limits and then
calls setuid, the setuid should fail if the user would then be running
more than rlim_cur[RLIMIT_NPROC] processes, but it doesn't. This patch
adds an appropriate test. With this patch, and per-user process limit
imposed in cgiwrap really works.
Andrew Morton [Fri, 18 Jul 2003 02:26:16 +0000 (19:26 -0700)]
[PATCH] fix removable partitioned media with devfs
From: Andrey Borzenkov <arvidjaar@mail.ru>
Current 2.5 does not register any device node in devfs for empty media
(capacity == 0) case. This makes removables unusable with devfs.
Partition rescan is done only on bdev open, but without any device node for
device it is impossible to open it.
In 2.4 it was finally solved by always registering .../disc node as
representation for "whole" disk and using devfsd action to force partition
rescan on access to (non-existing) partition name. For primary names it
was handled internally by devfs - it kept track of removable devices in
directory and initiated partition rescan when name was not found.
Both are obviously broken now. You can't do partition rescan because no
node is registered at all and internal handling was removed. Very nice.
The attached patch makes resgister_disk always register at least disc node.
This now works for old and new compat names as per devfsd configuration;
canonical names are still broken:
{pts/3}% ll /dev/scsi/host1/bus0/target4/lun0/part4
ls: /dev/scsi/host1/bus0/target4/lun0/part4: No such file or directory
but it can be fixed using the same technique as above so I won't push it.
Andrew Morton [Fri, 18 Jul 2003 02:26:08 +0000 (19:26 -0700)]
[PATCH] use kmalloc for ia32 stacks
From: William Lee Irwin III <wli@holomorphy.com>
I've been slab allocating the stack on i386 for some time, and it has gone
without incident in pgcl, -wli, -mjb (?), and so on. kmalloc() is fine;
there isn't any particularly compelling reason for a dedicated slab as
there's no preconstruction to do, though it can be arranged.
Basically, it works, there's no obvious reason not to, and (even better)
it's not totally invisible to the VM and even makes overhead reportable.
Andrew Morton [Fri, 18 Jul 2003 02:26:01 +0000 (19:26 -0700)]
[PATCH] remove task_cache entirely
From: Manfred Spraul <manfred@colorfullife.com>
kernel/fork.c contains a disabled cache for task stuctures. task
structures are placed into the task cache only if "tsk==current", and
"tsk==current" is impossible. There is even a WARN_ON against that in
__put_task_struct().
So remove it entirely - it's dead code.
One problem is that order-1 allocations are not cached per-cpu - we can
use kmalloc for the stack.
Andrew Morton [Fri, 18 Jul 2003 02:25:55 +0000 (19:25 -0700)]
[PATCH] is_devfsd_or_child() deadlock fix
From: Andrey Borzenkov <arvidjaar@mail.ru>
The code that did proper check existed in 2.4 and was removed in 2.5 for
whatever reason. The patch restores it slightly modified as below.
2.4 code looks somewhat unclean in that
- it traverses task list without lock.
- it starts from current->real_parent but nothing prevents current be
init_task itself. This hung for me on 2.5 during boot. May be 2.4 does
something differently.
Andrew Morton [Fri, 18 Jul 2003 02:25:31 +0000 (19:25 -0700)]
[PATCH] Ext3 xattr credits fix for quotas
From: Andreas Gruenbacher <agruen@suse.de>
The xattr and acl code are not properly reserving credits for quotas.
EXT3_DATA_TRANS_BLOCKS is an overestimate of the credits required including
quotas. Make it a little more tight, and use it in the xattr and acl code
to be quota safe.
Alan Stern [Thu, 17 Jul 2003 07:46:26 +0000 (00:46 -0700)]
[PATCH] USB: Handle over current inputs on all Intel controllers
This patch for the UHCI driver changes the test for over current inputs,
which can cause false Resume indications with some of Intel's USB
controllers. Previously the code only checked for one specific controller
chip, but now another one has turned up that exhibits the same flaw. It
seems best just to check for Intel being the manufacturer, especially
since it doesn't hurt to check for the condition when it isn't present or
is only temporary.
Adrian Bunk [Thu, 17 Jul 2003 03:43:53 +0000 (20:43 -0700)]
[PATCH] remove all #include <blk.h>'s
This causes blk.h to print a warning and removes all uses of blk.h.
I've tested the compilation in 2.6.0-test1 with a .config that tries to
compile as many drivers as possible.
- Reset netdevice to defaults in offline processing.
- Fix checksumming.
- Fix routing status display.
- Get rid of _ccw_device_get_device_number in qeth.
- Inline some functions to save stack space.
- Fix two memory leaks.
- Clear pending status in cio_enable_subchannel.
- Don't call device_unregister from interrupt context.
- Fix refcounting problems on static device structures for the ccw console.
- Delete timeouts for qdio after successful startup.
Frank Cusack [Thu, 17 Jul 2003 03:28:19 +0000 (20:28 -0700)]
[PATCH] Allow unattended nfs3/krb5 mounts
The comment in nfs_get_root() basically describes the patch:
Some authentication types (gss/krb5, most notably)
are such that root won't be able to present a
credential for GETATTR (ie, getroot()).
An easy way (ie, without this patch) to have unattended mounts is to
have a root/host@REALM (or similar) principal stashed in a keytab, which
root (rather, gssd) can use. However, this might not be desirable for
many sites. In any case, RFC2623 specifically describes the problem
addressed here.
Notes:
- Root inode gets inum of 1. This doesn't seem to matter, but may be
aesthetically unpleasing. I wanted to choose an inum unlikely to
conflict with an existing inum (although NFS has specific support
for that). It looks like more work than it's worth to change the
inum after the info is available. AFAICT it's not critical info.
- Solaris has this "wierd" (but understandable) behavior that after
mounting without a credential, the mount point is not visible at all
until an access is attempted with a credential. This now-you-see-it-
now-you-don't behavior doesn't seem worthwhile to reproduce here.
- Unfortunately, MOUNT_VERSION must go to 5. Some kernels with ver 4
do not understand pseudoflavor. Keeping it at 4 means that the
userland mount can't know for sure whether the kernel accepted the
option or not. (Unless I'm missing some hack that could be done.)
It works in my environment, against a netapp server (with the rpcsec_gss
patch I provided earlier).
Michael Hunold [Thu, 17 Jul 2003 03:10:19 +0000 (20:10 -0700)]
[PATCH] Update Technisat Skystar2 DVB driver
This is a follow-up patch to my latest patch series. It fixes the
problems and flaws Greg KH pointed out.
There was a typo in the Makefile, so the driver was never compiled. But
I assumed that it built without errors. Doh!
- update the Technisat Skystar2 driver:
- follow kernel coding rules, change comments
- change function return values from u32 to int where possible
- make all functions static
- comment out unused functions
- fix return values of functions to follow kernel rules
- removed bogus delay, read and write functions
Michael Hunold [Thu, 17 Jul 2003 03:10:12 +0000 (20:10 -0700)]
[PATCH] Add two drivers for USB based DVB-T adapters
- add two new usb dvb drivers:
o dvb-ttusb-budget.c for Technotrend/Hauppauge Nova-USB devices
(Thanks to Holger Waechtler <holger@convergence.de> and elix Domke
<tmbinc@gmx.net>)
o dvb-ttusb-dec.c for Technotrend/Hauppauge USB DEC2000-T devices
(Thanks to Alex Woods <linux-dvb@giblets.org>)
Michael Hunold [Thu, 17 Jul 2003 03:09:55 +0000 (20:09 -0700)]
[PATCH] Update various other frontend drivers
- In alps_tdlb7.c read SP8870 status reg to clear pending irqs in
FE_SET_FRONTEND, as suggested by Ragnar Sundblad to avoid frontend
hang-ups.
- the vp310 support in mt312.c support should be configured to 90Mhz,
too. skystar2 driver with bugfixed master_xfer() should probably
work now.
Michael Hunold [Thu, 17 Jul 2003 03:09:33 +0000 (20:09 -0700)]
[PATCH] Add two drivers for Hexium frame grabber cards
- add drivers for the Orion and Gemini frame grabber cards, based on
the saa7146. For details, see http://www.hexium.hu/. Thanks to
Michael Hunold <michael@mihu.de>.
Michael Hunold [Thu, 17 Jul 2003 03:09:07 +0000 (20:09 -0700)]
[PATCH] More saa7146 driver core updates
- separate all EXPORT_SYMBOL stuff to saa7146_ksyms.c
- properly stop capturing when no more buffers are available (missing
register upload)
- make extension data a per-device member, not a per-extension member,
so that every device can have it's own private data (necessary for
DVB drivers which handle more than one device)
- implement field based capturing, ie. capturing fields to different
capture buffers
- change default old of capture fields for ALTERNATE mode (comply with
bttv)
- follow these changes in various analog saa7146 based cards drivers
(mxb.c and dpc7146.c)
- follow these changes in various saa7146 based budget card drivers
Michael Hunold [Thu, 17 Jul 2003 03:08:58 +0000 (20:08 -0700)]
[PATCH] Update the DVB av7110 driver
- Fix to 'Sharing SDRAM between TT re-insertion and OSD...' - OSD
didn't get the maximum available memory in one piece; needs new
firmware version 0x2616
- Improved performance when setting palette with full 256 color OSD
- read MAC from EEPROM if available, contributed by Michael Glaum
<mglaum@kvh.com>
- add some MODULE_PARM_DESC for modinfo
- add support for the "analog module" available for DVB-C cards: the
saa7113 is initialized and some more v4l2 ioctls are available. you
can use "xawtv" now to switch between "dvb" and "analog" input. when
you are one the "analog" input, you can tune in analog channels.
Michael Hunold [Thu, 17 Jul 2003 03:08:31 +0000 (20:08 -0700)]
[PATCH] Update dvb frontend drivers
- grundig_29504-401.c: fix charge pump and band switch setting bug,
caught by Robert Schlabbach <robert_s@gmx.net>
- grundig_29504-401.c: pass apply_frontend_param() return value to
upper layers
- grundig_29504-401.c: try to make a more specific detection mechanism
- grundig_29504-491.c:remove bogus out-of-range check, FEC table index
is limited to 0...7 due to &= ~0x03 anyway...
- nxt6000.c: Patch by Paul Andreassen: Add Support for Comtech
DVBT-6k07 (PLL IC: SP5730)
- ves1820.c: use Robert Schlabbach's suggestions for CLKCONF (0x03) and
CARCONF (0x04)
- alps_bsrv2.c: don't enable voltage on init + inversion bugfix
Michael Hunold [Thu, 17 Jul 2003 03:08:25 +0000 (20:08 -0700)]
[PATCH] Major dvb net code cleanup, many fixes
- code review and fix the old race condition in dev->set_multicast_list
- use tq_schedule instead of tq_immediate
- remove card_num and dev_num from struct dvb_net (now obsolete)
- prevent interface from being removed while it is in use
- allow add/remove only for the superuser
- set check-CRC flag on section filter to drop broken packets
- some more debug printfs in filter handling code
- cleaned up and commented packet reception handler
- fix formatting
Michael Hunold [Thu, 17 Jul 2003 03:08:09 +0000 (20:08 -0700)]
[PATCH] Update the saa7146 driver core
- fix WRITE_RPS0 and WRITE_RPS1 inlines, fix usage in mxb and budget
drivers
- export "saa7146_start_preview" and "saa7146_stop_preview" to allow
drivers to start and stop video overlay (necessary for analog module
support in the av7110 driver)
- fix i2c implementation: some frontend drivers transfer a huge amount
of firmware data (> 30kB), speed up the transmission by busy waiting
between byte transfers for bigger transmissions
- change ioctl function in various driver to accept a saa7146
filehandle instead of a saa714 device structure
Peter Osterlund [Thu, 17 Jul 2003 02:56:07 +0000 (19:56 -0700)]
[PATCH] Incorrect timeout in CDROM_SEND_PACKET ioctl
The CDROM_SEND_PACKET ioctl passes a struct cdrom_generic_command from
user space, which contains a timeout field.
The timeout is measured in jiffies, but the conversion from user to
kernel jiffies is missing, which makes the timeout 10 times shorter than
it should be in 2.5 kernels on x86. This causes CDRW formatting with
cdrwtool to fail. The following patch fixes this problem.
Rudo Thomas [Thu, 17 Jul 2003 02:05:48 +0000 (19:05 -0700)]
[PATCH] fix emu10k1 removal oops
All of the cleanup functions in sound/oss/emu10k1/main.c were incorrectly
marked as __devinit. This little one fixes it, so that the module no longer
oopses when being removed.
Since the IO-APIC irq disable fix went in we can now enable
the proper IRQ disabling in the IDE driver again. That had
been disabled due to the problems with UP IO-APIC.
Steve French [Wed, 16 Jul 2003 15:36:51 +0000 (10:36 -0500)]
Fix inverted kmalloc parm ordering (noticed by Zwane) that caused oops on mounts of long server names (reported on bugzilla). Fix multiuser mount option.
David Mosberger [Wed, 16 Jul 2003 12:44:13 +0000 (05:44 -0700)]
ia64: If the compiler supports it, use attribute (model (small)) to
tell the compiler that per-CPU variables can be addressed
with "addl".
On the simulator kernel, this saves about 2776 bytes in the
kernel image. On a zx1 kernel, it saves about 5593 bytes.
As per-CPU variables are used more, these savings will
increase, of course.