Re: [PATCH][next] staging: greybus: i2c: Use struct_size() helper in gb_i2c_operation_create()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Kees Cook <keescook@xxxxxxxxxxxx>
- Subject: Re: [PATCH][next] staging: greybus: i2c: Use struct_size() helper in gb_i2c_operation_create()
- From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
- Date: Wed, 26 Jan 2022 13:54:04 +0300
- In-reply-to: <202201241213.82E7D9F598@keescook>
- References: <20220121222250.GA73021@embeddedor> <202201241213.82E7D9F598@keescook>
- User-agent: Mutt/1.9.4 (2018-02-28)
On Mon, Jan 24, 2022 at 12:19:03PM -0800, Kees Cook wrote:
> This could still overflow if struct_size() returns SIZE_MAX. Perhaps:
>
> if (check_add_overflow(struct_size(request, ops, msg_count),
> data_out_size, &request_size))
> request_size = SIZE_MAX;
>
> I should brush off the saturating arithmetic helpers series:
> https://lore.kernel.org/all/20210920180853.1825195-1-keescook@xxxxxxxxxxxx/
Yes, please! Those seem like a million times easier to use.
regards,
dan carpenter
_______________________________________________
greybus-dev mailing list -- greybus-dev@xxxxxxxxxxxxxxxx
To unsubscribe send an email to greybus-dev-leave@xxxxxxxxxxxxxxxx
[Index of Archives]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]
[Asterisk Books]