[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yqj8kkqwb1JA3qBe@kbusch-mbp.dhcp.thefacebook.com>
Date: Tue, 14 Jun 2022 14:24:34 -0700
From: Keith Busch <kbusch@...nel.org>
To: Erwan Velu <erwanaliasr1@...il.com>
Cc: Erwan Velu <e.velu@...teo.com>, Jens Axboe <axboe@...com>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
"open list:NVM EXPRESS DRIVER" <linux-nvme@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] nvme: Ensure char members of struct nvme_id_ctrl are
null-terminated
On Tue, Jun 14, 2022 at 11:09:01PM +0200, Erwan Velu wrote:
> + else {
> + /* Ensure that model, serial and firmware fields are always null-terminated */
> + (*id)->mn[sizeof((*id)->mn)-1] = 0;
> + (*id)->sn[sizeof((*id)->sn)-1] = 0;
> + (*id)->fr[sizeof((*id)->fr)-1] = 0;
> + }
But the last byte here is owned by the controller. You may be truncating
information.
Powered by blists - more mailing lists