pandora: defconfig: update
[pandora-kernel.git] / fs / fcntl.c
index 75e7c1f..d90a20b 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/signal.h>
 #include <linux/rcupdate.h>
 #include <linux/pid_namespace.h>
+#include <linux/shmem_fs.h>
 
 #include <asm/poll.h>
 #include <asm/siginfo.h>
@@ -420,6 +421,10 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
        case F_GETPIPE_SZ:
                err = pipe_fcntl(filp, cmd, arg);
                break;
+       case F_ADD_SEALS:
+       case F_GET_SEALS:
+               err = shmem_fcntl(filp, cmd, arg);
+               break;
        default:
                break;
        }
@@ -565,10 +570,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