diff mbox series

Bluetooth: L2CAP: Fix build errors in some archs

Message ID 20220812223939.530428-1-luiz.dentz@gmail.com (mailing list archive)
State Superseded
Headers show
Series Bluetooth: L2CAP: Fix build errors in some archs | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/subjectprefix success PASS
tedd_an/buildkernel success Build Kernel PASS
tedd_an/buildkernel32 success Build Kernel32 PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 494, Passed: 494 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Luiz Augusto von Dentz Aug. 12, 2022, 10:39 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This attempts to fix the follow errors:

In function 'memcmp',
    inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9,
    inlined from 'l2cap_global_chan_by_psm' at
    net/bluetooth/l2cap_core.c:2003:15:
./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp'
specified bound 6 exceeds source size 0 [-Werror=stringop-overread]
   44 | #define __underlying_memcmp     __builtin_memcmp
      |                                 ^
./include/linux/fortify-string.h:420:16: note: in expansion of macro
'__underlying_memcmp'
  420 |         return __underlying_memcmp(p, q, size);
      |                ^~~~~~~~~~~~~~~~~~~
In function 'memcmp',
    inlined from 'bacmp' at ./include/net/bluetooth/bluetooth.h:347:9,
    inlined from 'l2cap_global_chan_by_psm' at
    net/bluetooth/l2cap_core.c:2004:15:
./include/linux/fortify-string.h:44:33: error: '__builtin_memcmp'
specified bound 6 exceeds source size 0 [-Werror=stringop-overread]
   44 | #define __underlying_memcmp     __builtin_memcmp
      |                                 ^
./include/linux/fortify-string.h:420:16: note: in expansion of macro
'__underlying_memcmp'
  420 |         return __underlying_memcmp(p, q, size);
      |                ^~~~~~~~~~~~~~~~~~~

Fixes: 332f1795ca20 ("Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/l2cap_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

bluez.test.bot@gmail.com Aug. 12, 2022, 11:05 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285

---Test result---

Test Summary:
CheckPatch                    PASS      1.34 seconds
GitLint                       PASS      0.79 seconds
SubjectPrefix                 PASS      0.58 seconds
BuildKernel                   PASS      39.92 seconds
BuildKernel32                 PASS      35.20 seconds
Incremental Build with patchesPASS      49.68 seconds
TestRunner: Setup             PASS      584.32 seconds
TestRunner: l2cap-tester      PASS      19.76 seconds
TestRunner: bnep-tester       PASS      7.80 seconds
TestRunner: mgmt-tester       PASS      118.02 seconds
TestRunner: rfcomm-tester     PASS      11.69 seconds
TestRunner: sco-tester        PASS      11.30 seconds
TestRunner: smp-tester        PASS      11.48 seconds
TestRunner: userchan-tester   PASS      8.07 seconds



---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz Aug. 12, 2022, 11:12 p.m. UTC | #2
Hi Palmer, Sudip,

On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285

Could you guys try with the above change, I think the culprit is
actually setting c = NULL which triggers some compiler to think it may
be passed to bacmp.

> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      1.34 seconds
> GitLint                       PASS      0.79 seconds
> SubjectPrefix                 PASS      0.58 seconds
> BuildKernel                   PASS      39.92 seconds
> BuildKernel32                 PASS      35.20 seconds
> Incremental Build with patchesPASS      49.68 seconds
> TestRunner: Setup             PASS      584.32 seconds
> TestRunner: l2cap-tester      PASS      19.76 seconds
> TestRunner: bnep-tester       PASS      7.80 seconds
> TestRunner: mgmt-tester       PASS      118.02 seconds
> TestRunner: rfcomm-tester     PASS      11.69 seconds
> TestRunner: sco-tester        PASS      11.30 seconds
> TestRunner: smp-tester        PASS      11.48 seconds
> TestRunner: userchan-tester   PASS      8.07 seconds
>
>
>
> ---
> Regards,
> Linux Bluetooth



--
Luiz Augusto von Dentz
Sudip Mukherjee Aug. 13, 2022, 7:30 a.m. UTC | #3
Hi Luiz,

On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Palmer, Sudip,
>
> On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> >
> > This is automated email and please do not reply to this email!
> >
> > Dear submitter,
> >
> > Thank you for submitting the patches to the linux bluetooth mailing list.
> > This is a CI test results with your patch series:
> > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
>
> Could you guys try with the above change, I think the culprit is
> actually setting c = NULL which triggers some compiler to think it may
> be passed to bacmp.

I get "No patches to display" on that link.
Luiz Augusto von Dentz Aug. 13, 2022, 7:32 p.m. UTC | #4
Hi Sudip,

On Sat, Aug 13, 2022 at 12:31 AM Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
>
> Hi Luiz,
>
> On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > Hi Palmer, Sudip,
> >
> > On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> > >
> > > This is automated email and please do not reply to this email!
> > >
> > > Dear submitter,
> > >
> > > Thank you for submitting the patches to the linux bluetooth mailing list.
> > > This is a CI test results with your patch series:
> > > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
> >
> > Could you guys try with the above change, I think the culprit is
> > actually setting c = NULL which triggers some compiler to think it may
> > be passed to bacmp.
>
> I get "No patches to display" on that link.

That is probably because Ive send a v2:

https://patchwork.kernel.org/project/bluetooth/list/?series=667289

>
> --
> Regards
> Sudip
Sudip Mukherjee Aug. 14, 2022, 10:48 a.m. UTC | #5
Hi Luiz,

On Sat, Aug 13, 2022 at 8:32 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Sudip,
>
> On Sat, Aug 13, 2022 at 12:31 AM Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> >
> > Hi Luiz,
> >
> > On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
> > <luiz.dentz@gmail.com> wrote:
> > >
> > > Hi Palmer, Sudip,
> > >
> > > On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> > > >
> > > > This is automated email and please do not reply to this email!
> > > >
> > > > Dear submitter,
> > > >
> > > > Thank you for submitting the patches to the linux bluetooth mailing list.
> > > > This is a CI test results with your patch series:
> > > > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
> > >
> > > Could you guys try with the above change, I think the culprit is
> > > actually setting c = NULL which triggers some compiler to think it may
> > > be passed to bacmp.
> >
> > I get "No patches to display" on that link.
>
> That is probably because Ive send a v2:

I have not tested your patch as the build failure is not present with
the bluetooth master branch. Please let me know if this was the wrong
branch.
Luiz Augusto von Dentz Aug. 15, 2022, 5:55 p.m. UTC | #6
Hi Sudip,

On Sun, Aug 14, 2022 at 3:48 AM Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
>
> Hi Luiz,
>
> On Sat, Aug 13, 2022 at 8:32 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > Hi Sudip,
> >
> > On Sat, Aug 13, 2022 at 12:31 AM Sudip Mukherjee
> > <sudipm.mukherjee@gmail.com> wrote:
> > >
> > > Hi Luiz,
> > >
> > > On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
> > > <luiz.dentz@gmail.com> wrote:
> > > >
> > > > Hi Palmer, Sudip,
> > > >
> > > > On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> > > > >
> > > > > This is automated email and please do not reply to this email!
> > > > >
> > > > > Dear submitter,
> > > > >
> > > > > Thank you for submitting the patches to the linux bluetooth mailing list.
> > > > > This is a CI test results with your patch series:
> > > > > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
> > > >
> > > > Could you guys try with the above change, I think the culprit is
> > > > actually setting c = NULL which triggers some compiler to think it may
> > > > be passed to bacmp.
> > >
> > > I get "No patches to display" on that link.
> >
> > That is probably because Ive send a v2:
>
> I have not tested your patch as the build failure is not present with
> the bluetooth master branch. Please let me know if this was the wrong
> branch.

And you can't apply on top of the tree that you are able to reproduce?

>
> --
> Regards
> Sudip
Sudip Mukherjee Aug. 18, 2022, 9:28 p.m. UTC | #7
On Mon, Aug 15, 2022 at 6:55 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Sudip,
>
> On Sun, Aug 14, 2022 at 3:48 AM Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> >
> > Hi Luiz,
> >
> > On Sat, Aug 13, 2022 at 8:32 PM Luiz Augusto von Dentz
> > <luiz.dentz@gmail.com> wrote:
> > >
> > > Hi Sudip,
> > >
> > > On Sat, Aug 13, 2022 at 12:31 AM Sudip Mukherjee
> > > <sudipm.mukherjee@gmail.com> wrote:
> > > >
> > > > Hi Luiz,
> > > >
> > > > On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
> > > > <luiz.dentz@gmail.com> wrote:
> > > > >
> > > > > Hi Palmer, Sudip,
> > > > >
> > > > > On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> > > > > >
> > > > > > This is automated email and please do not reply to this email!
> > > > > >
> > > > > > Dear submitter,
> > > > > >
> > > > > > Thank you for submitting the patches to the linux bluetooth mailing list.
> > > > > > This is a CI test results with your patch series:
> > > > > > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
> > > > >
> > > > > Could you guys try with the above change, I think the culprit is
> > > > > actually setting c = NULL which triggers some compiler to think it may
> > > > > be passed to bacmp.
> > > >
> > > > I get "No patches to display" on that link.
> > >
> > > That is probably because Ive send a v2:
> >
> > I have not tested your patch as the build failure is not present with
> > the bluetooth master branch. Please let me know if this was the wrong
> > branch.
>
> And you can't apply on top of the tree that you are able to reproduce?

I can see its already in linux-next and I don't see those build
failures on next-20220818.
Luiz Augusto von Dentz Aug. 18, 2022, 10:03 p.m. UTC | #8
Hi Sudip,

On Thu, Aug 18, 2022 at 2:29 PM Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
>
> On Mon, Aug 15, 2022 at 6:55 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > Hi Sudip,
> >
> > On Sun, Aug 14, 2022 at 3:48 AM Sudip Mukherjee
> > <sudipm.mukherjee@gmail.com> wrote:
> > >
> > > Hi Luiz,
> > >
> > > On Sat, Aug 13, 2022 at 8:32 PM Luiz Augusto von Dentz
> > > <luiz.dentz@gmail.com> wrote:
> > > >
> > > > Hi Sudip,
> > > >
> > > > On Sat, Aug 13, 2022 at 12:31 AM Sudip Mukherjee
> > > > <sudipm.mukherjee@gmail.com> wrote:
> > > > >
> > > > > Hi Luiz,
> > > > >
> > > > > On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
> > > > > <luiz.dentz@gmail.com> wrote:
> > > > > >
> > > > > > Hi Palmer, Sudip,
> > > > > >
> > > > > > On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> > > > > > >
> > > > > > > This is automated email and please do not reply to this email!
> > > > > > >
> > > > > > > Dear submitter,
> > > > > > >
> > > > > > > Thank you for submitting the patches to the linux bluetooth mailing list.
> > > > > > > This is a CI test results with your patch series:
> > > > > > > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
> > > > > >
> > > > > > Could you guys try with the above change, I think the culprit is
> > > > > > actually setting c = NULL which triggers some compiler to think it may
> > > > > > be passed to bacmp.
> > > > >
> > > > > I get "No patches to display" on that link.
> > > >
> > > > That is probably because Ive send a v2:
> > >
> > > I have not tested your patch as the build failure is not present with
> > > the bluetooth master branch. Please let me know if this was the wrong
> > > branch.
> >
> > And you can't apply on top of the tree that you are able to reproduce?
>
> I can see its already in linux-next and I don't see those build
> failures on next-20220818.

Alright, I will send a pull request including it later this week just
in case it reappears for some reason.

>
> --
> Regards
> Sudip
Sudip Mukherjee Aug. 19, 2022, 7:28 a.m. UTC | #9
On Thu, Aug 18, 2022 at 11:04 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Sudip,
>
> On Thu, Aug 18, 2022 at 2:29 PM Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> >
> > On Mon, Aug 15, 2022 at 6:55 PM Luiz Augusto von Dentz
> > <luiz.dentz@gmail.com> wrote:
> > >
> > > Hi Sudip,
> > >
> > > On Sun, Aug 14, 2022 at 3:48 AM Sudip Mukherjee
> > > <sudipm.mukherjee@gmail.com> wrote:
> > > >
> > > > Hi Luiz,
> > > >
> > > > On Sat, Aug 13, 2022 at 8:32 PM Luiz Augusto von Dentz
> > > > <luiz.dentz@gmail.com> wrote:
> > > > >
> > > > > Hi Sudip,
> > > > >
> > > > > On Sat, Aug 13, 2022 at 12:31 AM Sudip Mukherjee
> > > > > <sudipm.mukherjee@gmail.com> wrote:
> > > > > >
> > > > > > Hi Luiz,
> > > > > >
> > > > > > On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
> > > > > > <luiz.dentz@gmail.com> wrote:
> > > > > > >
> > > > > > > Hi Palmer, Sudip,
> > > > > > >
> > > > > > > On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> > > > > > > >
> > > > > > > > This is automated email and please do not reply to this email!
> > > > > > > >
> > > > > > > > Dear submitter,
> > > > > > > >
> > > > > > > > Thank you for submitting the patches to the linux bluetooth mailing list.
> > > > > > > > This is a CI test results with your patch series:
> > > > > > > > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
> > > > > > >
> > > > > > > Could you guys try with the above change, I think the culprit is
> > > > > > > actually setting c = NULL which triggers some compiler to think it may
> > > > > > > be passed to bacmp.
> > > > > >
> > > > > > I get "No patches to display" on that link.
> > > > >
> > > > > That is probably because Ive send a v2:
> > > >
> > > > I have not tested your patch as the build failure is not present with
> > > > the bluetooth master branch. Please let me know if this was the wrong
> > > > branch.
> > >
> > > And you can't apply on top of the tree that you are able to reproduce?
> >
> > I can see its already in linux-next and I don't see those build
> > failures on next-20220818.
>
> Alright, I will send a pull request including it later this week just
> in case it reappears for some reason.

Just to be clear, the build failure is still there on the mainline
branch from Linus. But next-20220818, which has the fixes does not
show the build failure. So, it will be needed for Linus tree.
Luiz Augusto von Dentz Aug. 19, 2022, 6:49 p.m. UTC | #10
Hi Sudip,

On Fri, Aug 19, 2022 at 12:28 AM Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
>
> On Thu, Aug 18, 2022 at 11:04 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > Hi Sudip,
> >
> > On Thu, Aug 18, 2022 at 2:29 PM Sudip Mukherjee
> > <sudipm.mukherjee@gmail.com> wrote:
> > >
> > > On Mon, Aug 15, 2022 at 6:55 PM Luiz Augusto von Dentz
> > > <luiz.dentz@gmail.com> wrote:
> > > >
> > > > Hi Sudip,
> > > >
> > > > On Sun, Aug 14, 2022 at 3:48 AM Sudip Mukherjee
> > > > <sudipm.mukherjee@gmail.com> wrote:
> > > > >
> > > > > Hi Luiz,
> > > > >
> > > > > On Sat, Aug 13, 2022 at 8:32 PM Luiz Augusto von Dentz
> > > > > <luiz.dentz@gmail.com> wrote:
> > > > > >
> > > > > > Hi Sudip,
> > > > > >
> > > > > > On Sat, Aug 13, 2022 at 12:31 AM Sudip Mukherjee
> > > > > > <sudipm.mukherjee@gmail.com> wrote:
> > > > > > >
> > > > > > > Hi Luiz,
> > > > > > >
> > > > > > > On Sat, Aug 13, 2022 at 12:12 AM Luiz Augusto von Dentz
> > > > > > > <luiz.dentz@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Hi Palmer, Sudip,
> > > > > > > >
> > > > > > > > On Fri, Aug 12, 2022 at 4:05 PM <bluez.test.bot@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > This is automated email and please do not reply to this email!
> > > > > > > > >
> > > > > > > > > Dear submitter,
> > > > > > > > >
> > > > > > > > > Thank you for submitting the patches to the linux bluetooth mailing list.
> > > > > > > > > This is a CI test results with your patch series:
> > > > > > > > > PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667285
> > > > > > > >
> > > > > > > > Could you guys try with the above change, I think the culprit is
> > > > > > > > actually setting c = NULL which triggers some compiler to think it may
> > > > > > > > be passed to bacmp.
> > > > > > >
> > > > > > > I get "No patches to display" on that link.
> > > > > >
> > > > > > That is probably because Ive send a v2:
> > > > >
> > > > > I have not tested your patch as the build failure is not present with
> > > > > the bluetooth master branch. Please let me know if this was the wrong
> > > > > branch.
> > > >
> > > > And you can't apply on top of the tree that you are able to reproduce?
> > >
> > > I can see its already in linux-next and I don't see those build
> > > failures on next-20220818.
> >
> > Alright, I will send a pull request including it later this week just
> > in case it reappears for some reason.
>
> Just to be clear, the build failure is still there on the mainline
> branch from Linus. But next-20220818, which has the fixes does not
> show the build failure. So, it will be needed for Linus tree.

So I assume one next is merged into the Linus tree that should take
care of these errors.

>
> --
> Regards
> Sudip
diff mbox series

Patch

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 1c39fc40591b..1dc05c77c22f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1992,12 +1992,12 @@  static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
 			src_match = !bacmp(&c->src, src);
 			dst_match = !bacmp(&c->dst, dst);
 			if (src_match && dst_match) {
-				c = l2cap_chan_hold_unless_zero(c);
-				if (!c)
+				c1 = l2cap_chan_hold_unless_zero(c);
+				if (!c1)
 					continue;
 
 				read_unlock(&chan_list_lock);
-				return c;
+				return c1;
 			}
 
 			/* Closest match */