lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231024025928.GD800259@ZenIV>
Date:   Tue, 24 Oct 2023 03:59:28 +0100
From:   Al Viro <viro@...iv.linux.org.uk>
To:     David Laight <David.Laight@...lab.com>
Cc:     Eric Dumazet <edumazet@...gle.com>,
        gus Gusenleitner Klaus <gus@...a.com>,
        Al Viro <viro@....linux.org.uk>,
        Thomas Gleixner <tglx@...utronix.de>,
        lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>, "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        "dsahern@...nel.org" <dsahern@...nel.org>,
        "kuba@...nel.org" <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Subject: Re: AW: [PATCH] amd64: Fix csum_partial_copy_generic()

On Mon, Oct 23, 2023 at 08:16:59AM +0000, David Laight wrote:
> From: Al Viro
> > Sent: 22 October 2023 12:12
> > 
> > On Sun, Oct 22, 2023 at 11:03:39AM +0000, David Laight wrote:
> > 
> > > > +			return -1;
> > >
> > > If you are going to return -1 the return type should be signed.
> > 
> > It's a perfectly valid C to have return -1 in a function that
> > returns unsigned long long (or any other unsigned type, really)...
> 
> It is also valid C to return a pointer :-)

No, it is not.  Conversions done for return are the same as for
assignments; in particular, conversion from any integer type to
any unsigned integer type is done by taking the value modulo
the range of target type.  Conversion from pointer to an integer,
OTOH, is a constraint violation.

> I also suspect that sparse will complain massively and
> require a lot of the horrid (__force) casts.
> (They should really be a function so that they are completely
> ignored by the compiler - unless the compiler needs a cast as well.)

Why would sparse "complain massively" about operations with u64?
I realize that you've slapped "I suspect" in front of that
particular load of fertilizer, but... seriously, your output is
very hard to distinguish from ChatGPT drivel ;-/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ