The official reason is "with the presence of pid namespaces in the
kernel using pid_t-s inside one is no longer safe".But the reason I fix exactly the infiniband right now is the following.
About a month ago (when the 2.6.25 was not yet released) there still
was a one last caller of a to-be-deprecated-soon function find_pid() -
the kill_proc() function, which in turn was only used by nfs callback
code.During the last merge window, this last caller was finally eliminated
by some NFS patch(es) and I was about to finally kill this kill_proc()
and find_pid(), but found, that I was late and the kill_proc is now
called from the infiniband driver (commit 58411d1c).So here's the patch, that turns this code to use struct pid * and (!)
the kill_pid routine. If it is possible to have this one in 2.6.26, I
would appreciate this A LOT and be able to close one more hole in pid
namespaces.Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index ce7b7c3..258e66c 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -2616,7 +2616,7 @@ int ipath_reset_device(int unit)
ipath_dbg("unit %u port %d is in use "
"(PID %u cmd %s), can't reset\n",
unit, i,
- dd->ipath_pd[i]->port_pid,
+ pid_nr(dd->ipath_pd[i]->port_pid),
dd->ipath_pd[i]->port_comm);
ret = -EBUSY;
goto bail;
@@ -2654,19 +2654,21 @@ bail:
static int ipath_signal_procs(struct ipath_devdata *dd, int sig)
{
int i, sub, any = 0;
- pid_t pid;
+ struct pid *pid;if (!dd->ipath_pd)
return 0;
for (i = 1; i < dd->ipath_cfgports; i++) {
- if (!dd->ipath_pd[i] || !dd->ipath_pd[i]->port_cnt ||
- !dd->ipath_pd[i]->port_pid)
+ if (!dd->ipath_pd[i] || !dd->ipath_pd[i]->port_cnt)
continue;
pid = dd->ipath_pd[i]->port_pid;
+ if (!p...
thanks, applied
--
Seems fine to me... ipath guys, any comment? I think it would be
reasonale to include this with the other ipath fixes when I ask Linus to
pull in a day or two.
--
On Mon, 12 May 2008, Roland Dreier wrote:
| Seems fine to me... ipath guys, any comment? I think it would be
| reasonale to include this with the other ipath fixes when I ask Linus to
| pull in a day or two.I looked at the original patch, and it looks fine to me.
Should be fairly easy to cover in ofed 1.4 backport patches for the
older kernels.Dave Olson
dave.olson@qlogic.com
--
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Linus Torvalds | Linux 2.6.27-rc5 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| David Miller | Slow DOWN, please!!! |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Natalie Protasevich | [BUG] New Kernel Bugs |
