Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1701190 > unrolled thread

Buffer overread in pv88090-regulator.ko

Started byAnton Vasilyev <vasilyev@ispras.ru>
First post2017-08-01 18:10 +0200
Last post2017-08-02 04:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  Buffer overread in pv88090-regulator.ko Anton Vasilyev <vasilyev@ispras.ru> - 2017-08-01 18:10 +0200
    RE: Buffer overread in pv88090-regulator.ko James Seong-Won Ban <James.Ban.opensource@diasemi.com> - 2017-08-02 04:50 +0200

#1701190 — Buffer overread in pv88090-regulator.ko

FromAnton Vasilyev <vasilyev@ispras.ru>
Date2017-08-01 18:10 +0200
SubjectBuffer overread in pv88090-regulator.ko
Message-ID<u9HU6-68E-11@gated-at.bofh.it>
Hello.

While searching for memory errors in Linux kernel I've come across
drivers/regulator/pv88090-regulator.ko module.

Buffer overread could occur at pv88090_i2c_probe():

If read from malicious device such values for conf2 and range
(e.g. 0x10000000 and 0x1000 for PV88090_ID_BUCK2) that
             conf2 = (conf2 >> PV88090_BUCK_VDAC_RANGE_SHIFT) &
                 PV88090_BUCK_VDAC_RANGE_MASK;
and
             range = (range >>
                  (PV88080_BUCK_VRANGE_GAIN_SHIFT + i - 1)) &
                 PV88080_BUCK_VRANGE_GAIN_MASK;
become 1 then
             index = ((range << 1) | conf2);
become 3, but index is used for dereference pv88090_buck_vol[3].

Should be index=3 considered as incorrect value and pv88090_i2c_probe() 
must return error,
or pv88090_buck_vol[] should be expanded?

Found by Linux Driver Verification project (linuxtesting.org).

--
Anton Vasilyev
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
e-mail: vasilyev@ispras.ru

[toc] | [next] | [standalone]


#1701646

FromJames Seong-Won Ban <James.Ban.opensource@diasemi.com>
Date2017-08-02 04:50 +0200
Message-ID<u9RTr-3Xy-9@gated-at.bofh.it>
In reply to#1701190
Hi Anton,

I have not thought this driver should be loaded for any malicious device.
Anyway we will update it.

Regards,
James

> -----Original Message-----
> From: Anton Vasilyev [mailto:vasilyev@ispras.ru]
> Sent: Wednesday, August 02, 2017 1:06 AM
> To: James Seong-Won Ban
> Cc: Liam Girdwood; Mark Brown; linux-kernel@vger.kernel.org; ldv-
> project@linuxtesting.org
> Subject: Buffer overread in pv88090-regulator.ko
> 
> Hello.
> 
> While searching for memory errors in Linux kernel I've come across
> drivers/regulator/pv88090-regulator.ko module.
> 
> Buffer overread could occur at pv88090_i2c_probe():
> 
> If read from malicious device such values for conf2 and range (e.g. 0x10000000
> and 0x1000 for PV88090_ID_BUCK2) that
>              conf2 = (conf2 >> PV88090_BUCK_VDAC_RANGE_SHIFT) &
>                  PV88090_BUCK_VDAC_RANGE_MASK; and
>              range = (range >>
>                   (PV88080_BUCK_VRANGE_GAIN_SHIFT + i - 1)) &
>                  PV88080_BUCK_VRANGE_GAIN_MASK; become 1 then
>              index = ((range << 1) | conf2); become 3, but index is used for
> dereference pv88090_buck_vol[3].
> 
> Should be index=3 considered as incorrect value and pv88090_i2c_probe() must
> return error, or pv88090_buck_vol[] should be expanded?
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> --
> Anton Vasilyev
> Linux Verification Center, ISPRAS
> web: http://linuxtesting.org
> e-mail: vasilyev@ispras.ru

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web