public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Qianqiang Liu <qianqiang.liu@163.com>
To: benato.denis96@gmail.com
Cc: jagathjog1996@gmail.com, jic23@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: There is a potential buffer overflow issue in bmi323
Date: Thu, 12 Sep 2024 17:50:12 +0800	[thread overview]
Message-ID: <ZuK5VH179B4j0jjm@thinkpad.> (raw)

Hi,

I reviewed the following code in drivers/iio/imu/bmi323/bmi323_core.c:

2245         for (unsigned int i = 0; i < ARRAY_SIZE(bmi323_ext_reg_savestate); i++) { <-
2246                 ret = bmi323_write_ext_reg(data, bmi323_reg_savestate[i], <-
2247						savestate->reg_settings[i]);
2248                 if (ret) {
2249                         dev_err(data->dev,
2250                                 "Error writing bmi323 external reg 0x%x: %d\n",
2251                                 bmi323_reg_savestate[i], ret);
2252                         return ret;
2253                 }
2254         }

The array size of the "bmi323_ext_reg_savestate" is twelve, and the
array size of "bmi323_reg_savestate" is nine.

Is it possible that "bmi323_reg_savestate" may have buffer overflow
issue?

-- 
Best,
Qianqiang Liu


             reply	other threads:[~2024-09-12  9:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12  9:50 Qianqiang Liu [this message]
     [not found] <66e2b969.170a0220.29a2d3.4b31SMTPIN_ADDED_BROKEN@mx.google.com>
2024-09-14 12:07 ` There is a potential buffer overflow issue in bmi323 Denis Benato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZuK5VH179B4j0jjm@thinkpad. \
    --to=qianqiang.liu@163.com \
    --cc=benato.denis96@gmail.com \
    --cc=jagathjog1996@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox