diff options
author | Joel Stanley <joel@jms.id.au> | 2016-11-21 02:38:38 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2016-11-21 02:38:47 +0300 |
commit | c55cf1296a0429d91b940a49a59977617a4e4cb3 (patch) | |
tree | 11d7ae008a0ad5bfe4110966b6df7c44cff723fd /mm/swapfile.c | |
parent | 5509e6ee766f6b910c3b81c02bae291fc1d9a806 (diff) | |
parent | 86429bd405de5741df4127096deae0b1d90b68f1 (diff) | |
download | linux-dev-4.4.tar.xz |
Merge tag 'v4.4.33' into dev-4.4openbmc-4.4-20161121-1dev-4.4
This is the 4.4.33 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 58877312cf6b..c1a0f3dea8b5 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2225,6 +2225,8 @@ static unsigned long read_swap_header(struct swap_info_struct *p, swab32s(&swap_header->info.version); swab32s(&swap_header->info.last_page); swab32s(&swap_header->info.nr_badpages); + if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) + return 0; for (i = 0; i < swap_header->info.nr_badpages; i++) swab32s(&swap_header->info.badpages[i]); } |