diff options
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r-- | fs/fcntl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c index 313eba860346..693322e28751 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -116,6 +116,10 @@ int f_setown(struct file *filp, unsigned long arg, int force) | |||
116 | int who = arg; | 116 | int who = arg; |
117 | type = PIDTYPE_PID; | 117 | type = PIDTYPE_PID; |
118 | if (who < 0) { | 118 | if (who < 0) { |
119 | /* avoid overflow below */ | ||
120 | if (who == INT_MIN) | ||
121 | return -EINVAL; | ||
122 | |||
119 | type = PIDTYPE_PGID; | 123 | type = PIDTYPE_PGID; |
120 | who = -who; | 124 | who = -who; |
121 | } | 125 | } |