linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ajay Garg <ajaygargnsit@gmail.com>
To: Pavel Skripkin <paskripkin@gmail.com>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tty: vt: keyboard: initialize "kbs" so that kfree(kbs) runs fine even if kbs is not kmalloced.
Date: Sat, 6 Nov 2021 17:46:45 +0530	[thread overview]
Message-ID: <CAHP4M8XaWtagZcocGoeT2Rb6F6JeKqMFa2ZzTZ0ddCES0-T-jw@mail.gmail.com> (raw)
In-Reply-To: <dd7e35fc-d5b2-c41b-f03a-cbf467401205@gmail.com>

Hi Pavel,

Thanks for the review.

>
> Please, don't put change log into commit message. It should go under ---
>

Ok, many thanks Pavel.
Will take care in all my future patches.


>
> These is only one caller of vt_do_kdgkb_ioctl, which simple does:
>
>
>         case KDGKBSENT:
>         case KDSKBSENT:
>                 return vt_do_kdgkb_ioctl(cmd, up, perm);
>
> It means, that cmd can not be different from KDGKBSENT and KDSKBSENT.
>
> I guess, you found this "issue" via static analysis tool like smatch or
> smth similar, but this bug is impossible right now.
>

Yes, following was reported by smatch (amongst others) :
vt_do_kdgkb_ioctl() error: uninitialized symbol 'kbs'.


Regarding the current state, "vt_do_kdgkb_ioctl" should ideally behave
correctly independently, without bothering whether a cmd is a valid
one. From that perspective, it makes sense to ensure that kfree never
crashes.

However, I don't have any strong opinions on what is right or what is
wrong, as long as things work fine.

So, if there is a general consensus that the change should not be made
currently, I would be ok.
In case the change should be made, kindly let me know, I will post the
v3 patch (making change as per the review-comment of moving changelog
below ---).


Thanks and Regards,
Ajay

  reply	other threads:[~2021-11-06 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-06 10:40 [PATCH v2] tty: vt: keyboard: initialize "kbs" so that kfree(kbs) runs fine even if kbs is not kmalloced Ajay Garg
2021-11-06 11:05 ` Pavel Skripkin
2021-11-06 12:16   ` Ajay Garg [this message]
2021-11-06 12:45     ` Pavel Skripkin
2021-11-06 18:35 ` Andy Shevchenko
2021-11-06 18:59   ` Ajay Garg
     [not found]     ` <CAHp75VcZArNXhY2T5RmSmrFrAvd4YGRfpByBb4hYLccNwGDyVA@mail.gmail.com>
2021-11-06 22:06       ` Ajay Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHP4M8XaWtagZcocGoeT2Rb6F6JeKqMFa2ZzTZ0ddCES0-T-jw@mail.gmail.com \
    --to=ajaygargnsit@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=paskripkin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).