mediatek:fix "Kernel vulnerability in /dev/misc-sd" issue

Problem:
Security vulnerability in /dev/misc-sd, and someone
can use invalid value through ioctl to get root.

Solution:
Add boundary protection

Bug num:25323711

Change-Id: I3cb499da51ddacf9f6c7073473ff1d80c0428ffc
Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com>
(cherry picked from commit 3342bf8ec543ad2df2f32a8eadd03c39ba9c859d)
1 file changed