* linux-next: manual merge of the nfc tree with the nfc-fixes tree
@ 2026-06-29 13:15 Mark Brown
2026-07-24 3:18 ` Zhou, Yun
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2026-06-29 13:15 UTC (permalink / raw)
To: David Heidelberg
Cc: Linux Kernel Mailing List, Linux Next Mailing List, Samuel Page,
Yun Zhou
[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]
Hi all,
Today's linux-next merge of the nfc tree got a conflict in:
net/nfc/nci/rsp.c
between commit:
075f88b7d3b5c ("nfc: nci: fix uninit-value in nci_core_init_rsp_packet()")
from the nfc-fixes tree and commit:
1d5fcb66b07a3 ("nfc: nci: fix use of uninitialized memory in CORE_INIT_RSP parsing")
from the nfc tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc net/nfc/nci/rsp.c
index 6b2fa6bdbd14b,85c3ff2b78cd9..0000000000000
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@@ -50,7 -50,8 +50,8 @@@ static u8 nci_core_init_rsp_packet_v1(s
const struct nci_core_init_rsp_1 *rsp_1 = (void *)skb->data;
const struct nci_core_init_rsp_2 *rsp_2;
+ /* Ensure that the status field can be accessed. */
- if (skb_headlen(skb) < 1)
+ if (skb->len < sizeof(*rsp_1))
return NCI_STATUS_SYNTAX_ERROR;
pr_debug("status 0x%x\n", rsp_1->status);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: linux-next: manual merge of the nfc tree with the nfc-fixes tree
2026-06-29 13:15 linux-next: manual merge of the nfc tree with the nfc-fixes tree Mark Brown
@ 2026-07-24 3:18 ` Zhou, Yun
2026-07-26 19:50 ` David Heidelberg
0 siblings, 1 reply; 3+ messages in thread
From: Zhou, Yun @ 2026-07-24 3:18 UTC (permalink / raw)
To: Mark Brown, David Heidelberg
Cc: Linux Kernel Mailing List, Linux Next Mailing List, Samuel Page, horms
Hi Mark, David,
My patch (1d5fcb66b07a3) [1] was applied to the nfc tree on Jun 2,
nearly a month before Samuel's (075f88b7d3b5c, Jun 24) [2] . They fix
the same bug.
But Samuel's v2 still has issues that I addressed during my v1 [3] -->
v3 iteration:
1. Error response handling: his patch requires sizeof(*rsp_1) before
reading the status field. A valid NCI error response may only contain
a 1-byte status — his code returns SYNTAX_ERROR instead of propagating
the device's actual error code. I fixed this in v2 [4] by checking 1
byte first, then requiring the full header only after status == OK.
2. ndev state corruption: Simon flagged that if the length check fails
after ndev fields are partially updated, it leaves ndev in an
inconsistent state. My v3 defers all ndev updates until after
validation passes.
[1]
https://lore.kernel.org/all/20260527052625.3309581-1-yun.zhou@windriver.com/T/
[2] https://lore.kernel.org/all/20260624224455.999374-1-sam@bynar.io/
[3]
https://lore.kernel.org/all/20260519013042.3459906-1-yun.zhou@windriver.com/T/
[4]
https://lore.kernel.org/all/20260522021326.1164807-1-yun.zhou@windriver.com/T/
Was there something wrong with my version, or was it just a mechanical
conflict resolution?
Thanks,
Yun
On 6/29/2026 9:15 PM, Mark Brown wrote:
> Hi all,
>
> Today's linux-next merge of the nfc tree got a conflict in:
>
> net/nfc/nci/rsp.c
>
> between commit:
>
> 075f88b7d3b5c ("nfc: nci: fix uninit-value in nci_core_init_rsp_packet()")
>
> from the nfc-fixes tree and commit:
>
> 1d5fcb66b07a3 ("nfc: nci: fix use of uninitialized memory in CORE_INIT_RSP parsing")
>
> from the nfc tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc net/nfc/nci/rsp.c
> index 6b2fa6bdbd14b,85c3ff2b78cd9..0000000000000
> --- a/net/nfc/nci/rsp.c
> +++ b/net/nfc/nci/rsp.c
> @@@ -50,7 -50,8 +50,8 @@@ static u8 nci_core_init_rsp_packet_v1(s
> const struct nci_core_init_rsp_1 *rsp_1 = (void *)skb->data;
> const struct nci_core_init_rsp_2 *rsp_2;
>
> + /* Ensure that the status field can be accessed. */
> - if (skb_headlen(skb) < 1)
> + if (skb->len < sizeof(*rsp_1))
> return NCI_STATUS_SYNTAX_ERROR;
>
> pr_debug("status 0x%x\n", rsp_1->status);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: linux-next: manual merge of the nfc tree with the nfc-fixes tree
2026-07-24 3:18 ` Zhou, Yun
@ 2026-07-26 19:50 ` David Heidelberg
0 siblings, 0 replies; 3+ messages in thread
From: David Heidelberg @ 2026-07-26 19:50 UTC (permalink / raw)
To: Zhou, Yun, Samuel Page
Cc: Linux Kernel Mailing List, Linux Next Mailing List, Samuel Page,
horms, Mark Brown
On 24/07/2026 05:18, Zhou, Yun wrote:
> Hi Mark, David,
>
> My patch (1d5fcb66b07a3) [1] was applied to the nfc tree on Jun 2, nearly a
> month before Samuel's (075f88b7d3b5c, Jun 24) [2] . They fix the same bug.
>
Hello Yun,
thank you for noticing me.
> But Samuel's v2 still has issues that I addressed during my v1 [3] --> v3
> iteration:
> 1. Error response handling: his patch requires sizeof(*rsp_1) before
> reading the status field. A valid NCI error response may only contain
> a 1-byte status — his code returns SYNTAX_ERROR instead of propagating
> the device's actual error code. I fixed this in v2 [4] by checking 1 byte first,
> then requiring the full header only after status == OK.
>
> 2. ndev state corruption: Simon flagged that if the length check fails
> after ndev fields are partially updated, it leaves ndev in an
> inconsistent state. My v3 defers all ndev updates until after
> validation passes.
Yes, now I see. I somehow must missed the part completely, maybe I looked at
older revision when comparing these two patches approaches.
Conclusion: I'm re-picking the original patch in v3, and will drop the
nfc: nci: fix uninit-value in nci_core_init_rsp_packet()
Thank you both for the contribution and sorry for the complications!
David
>
> [1] https://lore.kernel.org/all/20260527052625.3309581-1-yun.zhou@windriver.com/T/
> [2] https://lore.kernel.org/all/20260624224455.999374-1-sam@bynar.io/
> [3] https://lore.kernel.org/all/20260519013042.3459906-1-yun.zhou@windriver.com/T/
> [4] https://lore.kernel.org/all/20260522021326.1164807-1-yun.zhou@windriver.com/T/
>
> Was there something wrong with my version, or was it just a mechanical conflict
> resolution?
>
> Thanks,
> Yun
>
> On 6/29/2026 9:15 PM, Mark Brown wrote:
>> Hi all,
>>
>> Today's linux-next merge of the nfc tree got a conflict in:
>>
>> net/nfc/nci/rsp.c
>>
>> between commit:
>>
>> 075f88b7d3b5c ("nfc: nci: fix uninit-value in nci_core_init_rsp_packet()")
>>
>> from the nfc-fixes tree and commit:
>>
>> 1d5fcb66b07a3 ("nfc: nci: fix use of uninitialized memory in CORE_INIT_RSP
>> parsing")
>>
>> from the nfc tree.
>>
>> I fixed it up (see below) and can carry the fix as necessary. This
>> is now fixed as far as linux-next is concerned, but any non trivial
>> conflicts should be mentioned to your upstream maintainer when your tree
>> is submitted for merging. You may also want to consider cooperating
>> with the maintainer of the conflicting tree to minimise any particularly
>> complex conflicts.
>>
>> diff --cc net/nfc/nci/rsp.c
>> index 6b2fa6bdbd14b,85c3ff2b78cd9..0000000000000
>> --- a/net/nfc/nci/rsp.c
>> +++ b/net/nfc/nci/rsp.c
>> @@@ -50,7 -50,8 +50,8 @@@ static u8 nci_core_init_rsp_packet_v1(s
>> const struct nci_core_init_rsp_1 *rsp_1 = (void *)skb->data;
>> const struct nci_core_init_rsp_2 *rsp_2;
>> + /* Ensure that the status field can be accessed. */
>> - if (skb_headlen(skb) < 1)
>> + if (skb->len < sizeof(*rsp_1))
>> return NCI_STATUS_SYNTAX_ERROR;
>> pr_debug("status 0x%x\n", rsp_1->status);
>
--
David Heidelberg
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-26 19:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 13:15 linux-next: manual merge of the nfc tree with the nfc-fixes tree Mark Brown
2026-07-24 3:18 ` Zhou, Yun
2026-07-26 19:50 ` David Heidelberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®