diff --git a/fs/fcntl.c b/fs/fcntl.c index 313eba860346870265bf8a109a3a9c7091ca1864..693322e287510361b3166e811c7b915020187dee 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -116,6 +116,10 @@ int f_setown(struct file *filp, unsigned long arg, int force) int who = arg; type = PIDTYPE_PID; if (who < 0) { + /* avoid overflow below */ + if (who == INT_MIN) + return -EINVAL; + type = PIDTYPE_PGID; who = -who; }