[linux-next] kallsyms: Use strscpy() instead of strlcpy()

Message ID 20221020090547.398680-1-cui.jinpeng2@zte.com.cn
State New
Headers
Series [linux-next] kallsyms: Use strscpy() instead of strlcpy() |

Commit Message

cuijinpeng666@gmail.com Oct. 20, 2022, 9:05 a.m. UTC
  From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>

The implementation of strscpy() is more robust and safer.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
---
 kernel/kallsyms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Greg KH Oct. 20, 2022, 9:32 a.m. UTC | #1
On Thu, Oct 20, 2022 at 09:05:47AM +0000, cuijinpeng666@gmail.com wrote:
> From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
> 
> The implementation of strscpy() is more robust and safer.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>

Again, please stop.

I have told you, and others who are purporting to send patches from ZTE
to please stop using gmail.com addresses as there is no way to verify
that you really are from ZTE.  You are potentially lying about who you
are here, which is not allowed in kernel development for obvious
reasons.

Also, these email addresses are "one way only" with no responses ever
being recieved, and so they have been banned from vger mailing lists.

I will go ask this one to be banned as well.

Please work with your employer to get their email settings fixed up so
that you can properly send patches.  Do NOT abuse gmail for this as
that's not ok.

greg k-h
  
Greg KH Oct. 20, 2022, 12:43 p.m. UTC | #2
On Thu, Oct 20, 2022 at 08:27:39PM +0800, jinpeng Cui wrote:
> Hello,Please do not ban my private account cuijinpeng666@gmail.com

Sorry, that has already happened.

> I am very sorry if the patches from zte.com.cn
> in the past few months have made you angry,
> we have decided to fix the problem you pointed out
> as soon as possible.
> Our company's mailbox name@zte.com.cn
> cannot send emails to the external network,
> so we use name@gmail.com to send patches;

You all have been warned numerous times over many weeks and months and
never responded to our emails.

We have no proof that using gmail accounts is actually coming from a ZTE
employee, so until that happens, we can not take your changes (not to
mention the basic fact that you all keep ignoring our review comments,
which is a good enough reason to ignore them.)

Please fix your email systems.

Also, do not attempt to send html emails (like this one), as the lists
by default, reject them as you know.

greg k-h
  
Kees Cook Oct. 21, 2022, 4:17 p.m. UTC | #3
On Thu, Oct 20, 2022 at 02:43:52PM +0200, Greg KH wrote:
> > I am very sorry if the patches from zte.com.cn
> > in the past few months have made you angry,
> > we have decided to fix the problem you pointed out
> > as soon as possible.
> > Our company's mailbox name@zte.com.cn
> > cannot send emails to the external network,
> > so we use name@gmail.com to send patches;
> 
> You all have been warned numerous times over many weeks and months and
> never responded to our emails.
> 
> We have no proof that using gmail accounts is actually coming from a ZTE
> employee, so until that happens, we can not take your changes (not to
> mention the basic fact that you all keep ignoring our review comments,
> which is a good enough reason to ignore them.)

Aren't there a few solutions here?

1) Just send the emails from @gmail with matching S-o-b.
2) Send an @zte.com.cn to lkml to confirm their @gmail/@zte.com.cn mapping.
3) Fix the email systems.
  
Greg KH Oct. 22, 2022, 5:56 a.m. UTC | #4
On Fri, Oct 21, 2022 at 09:17:10AM -0700, Kees Cook wrote:
> On Thu, Oct 20, 2022 at 02:43:52PM +0200, Greg KH wrote:
> > > I am very sorry if the patches from zte.com.cn
> > > in the past few months have made you angry,
> > > we have decided to fix the problem you pointed out
> > > as soon as possible.
> > > Our company's mailbox name@zte.com.cn
> > > cannot send emails to the external network,
> > > so we use name@gmail.com to send patches;
> > 
> > You all have been warned numerous times over many weeks and months and
> > never responded to our emails.
> > 
> > We have no proof that using gmail accounts is actually coming from a ZTE
> > employee, so until that happens, we can not take your changes (not to
> > mention the basic fact that you all keep ignoring our review comments,
> > which is a good enough reason to ignore them.)
> 
> Aren't there a few solutions here?
> 
> 1) Just send the emails from @gmail with matching S-o-b.

As we know these developers are claiming to be from a company that we
can not confirm they are actually working for, no, we can't take their
contributions as that goes against the DCO (anonymous contributions).

> 2) Send an @zte.com.cn to lkml to confirm their @gmail/@zte.com.cn mapping.

That would be great, but so far no one that I have contacted from ZTE
has been able to confirm that these are actually ZTE developers.

> 3) Fix the email systems.

That would be the best thing for them to do, and would solve the problem
for everyone at their company.  Hopefully that happens soon.

thanks,

greg k-h
  

Patch

diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index cc244c02b4cf..639de60ed417 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -660,7 +660,7 @@  static int get_ksymbol_bpf(struct kallsym_iter *iter)
 {
 	int ret;
 
-	strlcpy(iter->module_name, "bpf", MODULE_NAME_LEN);
+	strscpy(iter->module_name, "bpf", MODULE_NAME_LEN);
 	iter->exported = 0;
 	ret = bpf_get_kallsym(iter->pos - iter->pos_ftrace_mod_end,
 			      &iter->value, &iter->type,
@@ -680,7 +680,7 @@  static int get_ksymbol_bpf(struct kallsym_iter *iter)
  */
 static int get_ksymbol_kprobe(struct kallsym_iter *iter)
 {
-	strlcpy(iter->module_name, "__builtin__kprobes", MODULE_NAME_LEN);
+	strscpy(iter->module_name, "__builtin__kprobes", MODULE_NAME_LEN);
 	iter->exported = 0;
 	return kprobe_get_kallsym(iter->pos - iter->pos_bpf_end,
 				  &iter->value, &iter->type,