Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230222042244.GH1903@voyager>
Date: Wed, 22 Feb 2023 05:23:12 +0100
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: Re: [BUG] ioctl: overflow in implicit constant conversion

On Tue, Feb 21, 2023 at 10:17:31PM -0500, Rich Felker wrote:
> Unless you're seeing something I'm not, there's no UB. The shifts take
> place on the unsigned type, and the conversion from unsigned to signed
> is implementation-defined, not undefined. The implementation-defined
> definition relevant to us is modular reduction.
>

Yeah, sorry, I had missed that the directions are defined as unsigned
constants. That turns any shift that might have been undefined into an
unsigned shift, where it is defined. As I said in the other mail, the
compiler is just warning about nothing here, and it should probably not
warn for system header files, anyway.

We may be able to silence the compiler by adding an explicit int
conversion to the _IOC macro. But I'm not sure if we want to set a
precedent that we will add code just to shut up overeager warnings.

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.