[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAN_we7P2LDvR8miAsoSeL6+iEOK+ucgjRDC8jtPbc4_-2nn7MQ@mail.gmail.com>
Date: Wed, 20 Aug 2014 14:01:07 +0200
From: Daniele Forsi <dforsi@...il.com>
To: Hayes Wang <hayeswang@...ltek.com>
Cc: netdev@...r.kernel.org, nic_swsd@...ltek.com,
linux-kernel@...r.kernel.org, USB list <linux-usb@...r.kernel.org>
Subject: Re: [PATCH net-next 4/4] r8152: support firmware files
2014-08-20 10:58 GMT+02:00 Hayes Wang:
> The firmware file is composed of the fw header and the commands. Each
> command has the following type.
>
> cmd(2 bytes) + length(2 bytes) + data(variable bytes)
> +static bool rtl_fw_format_ok(struct rtl_fw *rtl_fw)
> + start = le32_to_cpu(fw_header->fw_start);
> + if (start > fw->size)
> + goto out;
since "start" is an offset in an array of size "fw->size" this should
check for ">=" and if a command is at least cmd(2 bytes) + length(2
bytes), shouldn't this check for "start >= fw->size - 4"?
--
Daniele Forsi
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists