* i40e_pto.c: Odd use of strlcpy converted from strncpy
@ 2019-10-06 17:19 ` Joe Perches
0 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2019-10-06 17:19 UTC (permalink / raw)
To: Jeff Kirsher, intel-wired-lan, netdev; +Cc: Mitch Williams, Patryk Małek
This got converted from strncpy to strlcpy but it's
now not necessary to use one character less than the
actual size.
Perhaps the sizeof() - 1 is now not correct and it
should use strscpy and a normal sizeof.
from:
commit 7eb74ff891b4e94b8bac48f648a21e4b94ddee64
Author: Mitch Williams <mitch.a.williams@intel.com>
Date: Mon Aug 20 08:12:30 2018 -0700
i40e: use correct length for strncpy
and
commit 4ff2d8540321324e04c1306f85d4fe68a0c2d0ae
Author: Patryk Małek <patryk.malek@intel.com>
Date: Tue Oct 30 10:50:44 2018 -0700
i40e: Replace strncpy with strlcpy to ensure null termination
---
drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index 9bf1ad4319f5..627b1c02bb4b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -700,8 +700,8 @@ static long i40e_ptp_create_clock(struct i40e_pf *pf)
if (!IS_ERR_OR_NULL(pf->ptp_clock))
return 0;
- strlcpy(pf->ptp_caps.name, i40e_driver_name,
- sizeof(pf->ptp_caps.name) - 1);
+ strscpy(pf->ptp_caps.name, i40e_driver_name, sizeof(pf->ptp_caps.name));
+
pf->ptp_caps.owner = THIS_MODULE;
pf->ptp_caps.max_adj = 999999999;
pf->ptp_caps.n_ext_ts = 0;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Intel-wired-lan] i40e_pto.c: Odd use of strlcpy converted from strncpy
@ 2019-10-06 17:19 ` Joe Perches
0 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2019-10-06 17:19 UTC (permalink / raw)
To: intel-wired-lan
This got converted from strncpy to strlcpy but it's
now not necessary to use one character less than the
actual size.
Perhaps the sizeof() - 1 is now not correct and it
should use strscpy and a normal sizeof.
from:
commit 7eb74ff891b4e94b8bac48f648a21e4b94ddee64
Author: Mitch Williams <mitch.a.williams@intel.com>
Date: Mon Aug 20 08:12:30 2018 -0700
i40e: use correct length for strncpy
and
commit 4ff2d8540321324e04c1306f85d4fe68a0c2d0ae
Author: Patryk Ma?ek <patryk.malek@intel.com>
Date: Tue Oct 30 10:50:44 2018 -0700
i40e: Replace strncpy with strlcpy to ensure null termination
---
drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index 9bf1ad4319f5..627b1c02bb4b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -700,8 +700,8 @@ static long i40e_ptp_create_clock(struct i40e_pf *pf)
if (!IS_ERR_OR_NULL(pf->ptp_clock))
return 0;
- strlcpy(pf->ptp_caps.name, i40e_driver_name,
- sizeof(pf->ptp_caps.name) - 1);
+ strscpy(pf->ptp_caps.name, i40e_driver_name, sizeof(pf->ptp_caps.name));
+
pf->ptp_caps.owner = THIS_MODULE;
pf->ptp_caps.max_adj = 999999999;
pf->ptp_caps.n_ext_ts = 0;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: i40e_pto.c: Odd use of strlcpy converted from strncpy
2019-10-06 17:19 ` [Intel-wired-lan] " Joe Perches
@ 2019-10-07 20:44 ` Jeff Kirsher
-1 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2019-10-07 20:44 UTC (permalink / raw)
To: Joe Perches, intel-wired-lan, netdev; +Cc: Mitch Williams, Patryk Małek
[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]
On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote:
> This got converted from strncpy to strlcpy but it's
> now not necessary to use one character less than the
> actual size.
>
> Perhaps the sizeof() - 1 is now not correct and it
> should use strscpy and a normal sizeof.
>
> from:
>
> commit 7eb74ff891b4e94b8bac48f648a21e4b94ddee64
> Author: Mitch Williams <mitch.a.williams@intel.com>
> Date: Mon Aug 20 08:12:30 2018 -0700
>
> i40e: use correct length for strncpy
>
> and
>
> commit 4ff2d8540321324e04c1306f85d4fe68a0c2d0ae
> Author: Patryk Małek <patryk.malek@intel.com>
> Date: Tue Oct 30 10:50:44 2018 -0700
>
> i40e: Replace strncpy with strlcpy to ensure null termination
Looks like you have a typo in the subject, s/i40e_pto.c/i40e_ptp.c/.
You are also missing you signed-off-by: and Fixes:, I can get your
change under test in the meantime to confirm your fix.
> ---
> drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> index 9bf1ad4319f5..627b1c02bb4b 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> @@ -700,8 +700,8 @@ static long i40e_ptp_create_clock(struct i40e_pf
> *pf)
> if (!IS_ERR_OR_NULL(pf->ptp_clock))
> return 0;
>
> - strlcpy(pf->ptp_caps.name, i40e_driver_name,
> - sizeof(pf->ptp_caps.name) - 1);
> + strscpy(pf->ptp_caps.name, i40e_driver_name, sizeof(pf-
> >ptp_caps.name));
> +
> pf->ptp_caps.owner = THIS_MODULE;
> pf->ptp_caps.max_adj = 999999999;
> pf->ptp_caps.n_ext_ts = 0;
>
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Intel-wired-lan] i40e_pto.c: Odd use of strlcpy converted from strncpy
@ 2019-10-07 20:44 ` Jeff Kirsher
0 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2019-10-07 20:44 UTC (permalink / raw)
To: intel-wired-lan
On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote:
> This got converted from strncpy to strlcpy but it's
> now not necessary to use one character less than the
> actual size.
>
> Perhaps the sizeof() - 1 is now not correct and it
> should use strscpy and a normal sizeof.
>
> from:
>
> commit 7eb74ff891b4e94b8bac48f648a21e4b94ddee64
> Author: Mitch Williams <mitch.a.williams@intel.com>
> Date: Mon Aug 20 08:12:30 2018 -0700
>
> i40e: use correct length for strncpy
>
> and
>
> commit 4ff2d8540321324e04c1306f85d4fe68a0c2d0ae
> Author: Patryk Ma?ek <patryk.malek@intel.com>
> Date: Tue Oct 30 10:50:44 2018 -0700
>
> i40e: Replace strncpy with strlcpy to ensure null termination
Looks like you have a typo in the subject, s/i40e_pto.c/i40e_ptp.c/.
You are also missing you signed-off-by: and Fixes:, I can get your
change under test in the meantime to confirm your fix.
> ---
> drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> index 9bf1ad4319f5..627b1c02bb4b 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> @@ -700,8 +700,8 @@ static long i40e_ptp_create_clock(struct i40e_pf
> *pf)
> if (!IS_ERR_OR_NULL(pf->ptp_clock))
> return 0;
>
> - strlcpy(pf->ptp_caps.name, i40e_driver_name,
> - sizeof(pf->ptp_caps.name) - 1);
> + strscpy(pf->ptp_caps.name, i40e_driver_name, sizeof(pf-
> >ptp_caps.name));
> +
> pf->ptp_caps.owner = THIS_MODULE;
> pf->ptp_caps.max_adj = 999999999;
> pf->ptp_caps.n_ext_ts = 0;
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20191007/ab27f888/attachment.asc>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: i40e_pto.c: Odd use of strlcpy converted from strncpy
2019-10-07 20:44 ` [Intel-wired-lan] " Jeff Kirsher
@ 2019-10-07 20:48 ` Joe Perches
-1 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2019-10-07 20:48 UTC (permalink / raw)
To: jeffrey.t.kirsher, intel-wired-lan, netdev
Cc: Mitch Williams, Patryk Małek
On Mon, 2019-10-07 at 13:44 -0700, Jeff Kirsher wrote:
> On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote:
> > This got converted from strncpy to strlcpy but it's
> > now not necessary to use one character less than the
> > actual size.
> >
> > Perhaps the sizeof() - 1 is now not correct and it
> > should use strscpy and a normal sizeof.
[]
> You are also missing you signed-off-by: and Fixes:, I can get your
> change under test in the meantime to confirm your fix.
I didn't sign off as all I intended was to bring it
to your attention. The diff is just the simplest way.
It's trivial if it's a defect.
> > ---
> > drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > index 9bf1ad4319f5..627b1c02bb4b 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > @@ -700,8 +700,8 @@ static long i40e_ptp_create_clock(struct i40e_pf
> > *pf)
> > if (!IS_ERR_OR_NULL(pf->ptp_clock))
> > return 0;
> >
> > - strlcpy(pf->ptp_caps.name, i40e_driver_name,
> > - sizeof(pf->ptp_caps.name) - 1);
> > + strscpy(pf->ptp_caps.name, i40e_driver_name, sizeof(pf-
> > > ptp_caps.name));
> > +
> > pf->ptp_caps.owner = THIS_MODULE;
> > pf->ptp_caps.max_adj = 999999999;
> > pf->ptp_caps.n_ext_ts = 0;
> >
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Intel-wired-lan] i40e_pto.c: Odd use of strlcpy converted from strncpy
@ 2019-10-07 20:48 ` Joe Perches
0 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2019-10-07 20:48 UTC (permalink / raw)
To: intel-wired-lan
On Mon, 2019-10-07 at 13:44 -0700, Jeff Kirsher wrote:
> On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote:
> > This got converted from strncpy to strlcpy but it's
> > now not necessary to use one character less than the
> > actual size.
> >
> > Perhaps the sizeof() - 1 is now not correct and it
> > should use strscpy and a normal sizeof.
[]
> You are also missing you signed-off-by: and Fixes:, I can get your
> change under test in the meantime to confirm your fix.
I didn't sign off as all I intended was to bring it
to your attention. The diff is just the simplest way.
It's trivial if it's a defect.
> > ---
> > drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > index 9bf1ad4319f5..627b1c02bb4b 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > @@ -700,8 +700,8 @@ static long i40e_ptp_create_clock(struct i40e_pf
> > *pf)
> > if (!IS_ERR_OR_NULL(pf->ptp_clock))
> > return 0;
> >
> > - strlcpy(pf->ptp_caps.name, i40e_driver_name,
> > - sizeof(pf->ptp_caps.name) - 1);
> > + strscpy(pf->ptp_caps.name, i40e_driver_name, sizeof(pf-
> > > ptp_caps.name));
> > +
> > pf->ptp_caps.owner = THIS_MODULE;
> > pf->ptp_caps.max_adj = 999999999;
> > pf->ptp_caps.n_ext_ts = 0;
> >
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: i40e_pto.c: Odd use of strlcpy converted from strncpy
2019-10-07 20:48 ` [Intel-wired-lan] " Joe Perches
@ 2019-10-07 21:48 ` Jeff Kirsher
-1 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2019-10-07 21:48 UTC (permalink / raw)
To: Joe Perches, intel-wired-lan, netdev; +Cc: Mitch Williams, Patryk Małek
[-- Attachment #1: Type: text/plain, Size: 761 bytes --]
On Mon, 2019-10-07 at 13:48 -0700, Joe Perches wrote:
> On Mon, 2019-10-07 at 13:44 -0700, Jeff Kirsher wrote:
> > On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote:
> > > This got converted from strncpy to strlcpy but it's
> > > now not necessary to use one character less than the
> > > actual size.
> > >
> > > Perhaps the sizeof() - 1 is now not correct and it
> > > should use strscpy and a normal sizeof.
> []
> > You are also missing you signed-off-by: and Fixes:, I can get your
> > change under test in the meantime to confirm your fix.
>
> I didn't sign off as all I intended was to bring it
> to your attention. The diff is just the simplest way.
> It's trivial if it's a defect.
Ah, thanks for bringing it to our attention.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Intel-wired-lan] i40e_pto.c: Odd use of strlcpy converted from strncpy
@ 2019-10-07 21:48 ` Jeff Kirsher
0 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2019-10-07 21:48 UTC (permalink / raw)
To: intel-wired-lan
On Mon, 2019-10-07 at 13:48 -0700, Joe Perches wrote:
> On Mon, 2019-10-07 at 13:44 -0700, Jeff Kirsher wrote:
> > On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote:
> > > This got converted from strncpy to strlcpy but it's
> > > now not necessary to use one character less than the
> > > actual size.
> > >
> > > Perhaps the sizeof() - 1 is now not correct and it
> > > should use strscpy and a normal sizeof.
> []
> > You are also missing you signed-off-by: and Fixes:, I can get your
> > change under test in the meantime to confirm your fix.
>
> I didn't sign off as all I intended was to bring it
> to your attention. The diff is just the simplest way.
> It's trivial if it's a defect.
Ah, thanks for bringing it to our attention.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20191007/f37d0888/attachment.asc>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-10-07 21:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-06 17:19 i40e_pto.c: Odd use of strlcpy converted from strncpy Joe Perches
2019-10-06 17:19 ` [Intel-wired-lan] " Joe Perches
2019-10-07 20:44 ` Jeff Kirsher
2019-10-07 20:44 ` [Intel-wired-lan] " Jeff Kirsher
2019-10-07 20:48 ` Joe Perches
2019-10-07 20:48 ` [Intel-wired-lan] " Joe Perches
2019-10-07 21:48 ` Jeff Kirsher
2019-10-07 21:48 ` [Intel-wired-lan] " Jeff Kirsher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.