[PATCH] fix for sigio delivery

Stephen Rothwell (sfr@canb.auug.org.au)
Wed, 15 May 2002 16:52:40 +1000


Hi Linus,

This patch means that we keep the upper 16 bits of the si_code
field of the siginfo structure that is delivered with and SIGIOs.
We need this so that the code that actually copies the siginfo_t
out to user mode knows which part of the union to copy. We currently
get away with out this information because we always copy at least
two ints worth of the union, but this s an ugly hack and I would
like to tidy it up.

Comments?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.15/fs/fcntl.c 2.5.15-si.3/fs/fcntl.c --- 2.5.15/fs/fcntl.c Tue Apr 23 10:42:27 2002 +++ 2.5.15-si.3/fs/fcntl.c Wed May 15 16:46:48 2002 @@ -435,7 +435,7 @@ back to SIGIO in that case. --sct */ si.si_signo = fown->signum; si.si_errno = 0; - si.si_code = reason & ~__SI_MASK; + si.si_code = reason; /* Make sure we are called with one of the POLL_* reasons, otherwise we could leak kernel stack into userspace. */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/