X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Ffcntl.c;h=894aab376b8d11b63f5161ea3806eac8c3ef3a8a;hb=85612401b97f42ca3addf3d5786cc6de4fcb8fda;hp=22764c7c8382ce607ca5f9ec9b1a2f48e3d15c4e;hpb=7bf7e370d5919112c223a269462cd0b546903829;p=pandora-kernel.git diff --git a/fs/fcntl.c b/fs/fcntl.c index 22764c7c8382..894aab376b8d 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -565,10 +565,21 @@ static void send_sigio_to_task(struct task_struct *p, si.si_signo = signum; si.si_errno = 0; si.si_code = reason; + /* + * Posix definies POLL_IN and friends to be signal + * specific si_codes for SIG_POLL. Linux extended + * these si_codes to other signals in a way that is + * ambiguous if other signals also have signal + * specific si_codes. In that case use SI_SIGIO instead + * to remove the ambiguity. + */ + if (sig_specific_sicodes(signum)) + si.si_code = SI_SIGIO; + /* Make sure we are called with one of the POLL_* reasons, otherwise we could leak kernel stack into userspace. */ - BUG_ON((reason & __SI_MASK) != __SI_POLL); + BUG_ON((reason < POLL_IN) || ((reason - POLL_IN) >= NSIGPOLL)); if (reason - POLL_IN >= NSIGPOLL) si.si_band = ~0L; else