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] [day] [month] [year] [list]
Message-ID:
 <CH3SPRMB0001A4CF7CD6E522DC45D5D9B8EC2@CH3SPRMB0001.namprd02.prod.outlook.com>
Date: Mon, 27 Jan 2025 16:21:57 +0000
From: Brian Cain <bcain@...cinc.com>
To: Maíra Canal <mcanal@...lia.com>,
        Christian Gmeiner
	<christian.gmeiner@...il.com>,
        Willem de Bruijn
	<willemdebruijn.kernel@...il.com>
CC: "linux-hexagon@...r.kernel.org" <linux-hexagon@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "dhowells@...hat.com" <dhowells@...hat.com>,
        "edumazet@...gle.com"
	<edumazet@...gle.com>,
        Willem de Bruijn <willemb@...gle.com>,
        kernel test
 robot <lkp@...el.com>
Subject: RE: [PATCH] hexagon: fix using plain integer as NULL pointer warning
 in cmpxchg



> -----Original Message-----
> From: Maíra Canal <mcanal@...lia.com>
> Sent: Sunday, January 26, 2025 4:59 PM
> To: Christian Gmeiner <christian.gmeiner@...il.com>; Willem de Bruijn
> <willemdebruijn.kernel@...il.com>
> Cc: linux-hexagon@...r.kernel.org; Brian Cain <bcain@...cinc.com>; linux-
> kernel@...r.kernel.org; dhowells@...hat.com; edumazet@...gle.com;
> Willem de Bruijn <willemb@...gle.com>; kernel test robot <lkp@...el.com>;
> mcanal@...lia.com
> Subject: Re: [PATCH] hexagon: fix using plain integer as NULL pointer warning
> in cmpxchg
> 
> WARNING: This email originated from outside of Qualcomm. Please be wary of
> any links or attachments, and do not enable macros.
> 
> Hi Brian,
> 
> Do you have an estimate for when this patch will be picked? We are
> getting build reports from Hexagon in the V3D GPU driver [1].

Sorry for the delay.  I will work on it this week, Maíra.

> [1]
> https://lore.kernel.org/oe-kbuild-all/202501031246.AD8Jjze0-lkp@intel.com/
> 
> Best Regards,
> - Maíra
> 
> On 07/01/25 07:17, Christian Gmeiner wrote:
> > Hi Willem,
> >
> >>
> >> From: Willem de Bruijn <willemb@...gle.com>
> >>
> >> Sparse reports
> >>
> >>      net/ipv4/inet_diag.c:1511:17: sparse: sparse: Using plain integer as NULL
> pointer
> >>
> >> Due to this code calling cmpxchg on a non-integer type
> >> struct inet_diag_handler *
> >>
> >>      return !cmpxchg((const struct
> inet_diag_handler**)&inet_diag_table[type],
> >>                      NULL, h) ? 0 : -EEXIST;
> >>
> >> While hexagon's cmpxchg assigns an integer value to a variable of this
> >> type.
> >>
> >>      __typeof__(*(ptr)) __oldval = 0;
> >>
> >> Update this assignment to cast 0 to the correct type.
> >>
> >> The original issue is easily reproduced at head with the below block,
> >> and is absent after this change.
> >>
> >>      make LLVM=1 ARCH=hexagon defconfig
> >>      make C=1 LLVM=1 ARCH=hexagon net/ipv4/inet_diag.o
> >>
> >> Fixes: 99a70aa051d2 ("Hexagon: Add processor and system headers")
> >> Reported-by: kernel test robot <lkp@...el.com>
> >> Closes: https://lore.kernel.org/oe-kbuild-all/202411091538.PGSTqUBi-
> lkp@...el.com/
> >> Signed-off-by: Willem de Bruijn <willemb@...gle.com>
> >
> > Closes: https://lore.kernel.org/oe-kbuild-all/202501031246.AD8Jjze0-
> lkp@...el.com/
> > Tested-by: Christian Gmeiner <cgmeiner@...lia.com>
> >
> >> ---
> >>   arch/hexagon/include/asm/cmpxchg.h | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/arch/hexagon/include/asm/cmpxchg.h
> b/arch/hexagon/include/asm/cmpxchg.h
> >> index bf6cf5579cf4..9c58fb81f7fd 100644
> >> --- a/arch/hexagon/include/asm/cmpxchg.h
> >> +++ b/arch/hexagon/include/asm/cmpxchg.h
> >> @@ -56,7 +56,7 @@ __arch_xchg(unsigned long x, volatile void *ptr, int
> size)
> >>          __typeof__(ptr) __ptr = (ptr);                          \
> >>          __typeof__(*(ptr)) __old = (old);                       \
> >>          __typeof__(*(ptr)) __new = (new);                       \
> >> -       __typeof__(*(ptr)) __oldval = 0;                        \
> >> +       __typeof__(*(ptr)) __oldval = (__typeof__(*(ptr))) 0;   \
> >>                                                                  \
> >>          asm volatile(                                           \
> >>                  "1:     %0 = memw_locked(%1);\n"                \
> >> --
> >> 2.47.0.338.g60cca15819-goog
> >>
> >>
> >
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ