Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4386344pxb; Sat, 6 Nov 2021 12:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxK9qTcKhALauasrhJLYCbyLREvGdLBHJ3YugToCxZTBXS7dsJZTRB9URrlau2jphwGGzP X-Received: by 2002:a92:ad0c:: with SMTP id w12mr46251386ilh.20.1636228106700; Sat, 06 Nov 2021 12:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636228106; cv=none; d=google.com; s=arc-20160816; b=tn2KnPyiRbe9Rd19/AxQ1YQcS9soGUysOHxkGwyl/ztoXFBqRPtZyOqoE88otVmZzs vC1LeoKo5TaCQ5Sax7036O4eHpiynPyyJYJVAjwKx4dwdsNY4/TCq11O7MGcQE5kIMWH yDa1Wtkh4NAtKOXFmA88m21ZiySsjeTGbhpFwPqOoqKJA6yj0pIf7DkZA2cH/GfUWPpr U4pqcPqQQkAOCwF+4Ft5792b7lyW/66OB3B1V+i7NSOdNTVyxBR5pgxRcaTjDUud/3eJ nY5qM3Qjwn3B4TdB/XYmptHvhZ9JOP+o8Wb6t4UfIpTHckgKGL4l9uuUpS/8k1fJ6ICz BjnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Wij71fKA1HG2jiSYInwTXYj/LtZwp9diZJCmSGprZss=; b=t0iL0ndCHvSj2DQH9xEJuSbJiJn4b6iC0hrtUiO0N4KpA6VTtf8R1yvx1nq9PQ/pTD 1/8x0iOjSn8RtY+6P/oaFyJrqy9D8X9QtNZ3qQiVFVw83O0vNwGQYmTsdw0cuSi9RjBo 1itNU1UNN3EO/g6InPXVWuSS+zG2p8AwE8s8Dk51ruCem0xMOooaGJe1zW/gMkxrtnc0 BlNWVmqLqMsk/e/9JrmBM1j+H7M/LvI7EkeOxwtzZ8Ixo2jNnhpAG2ezYiXAgHt3ow/0 DIjsry1GLl69I4HFYgQIs/LSN3d4kT1AyC9wZg7kXle+yY9kPXJpneoiZdGECw/3pKKd OWvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PrWVoE3B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si15421205ioo.64.2021.11.06.12.48.14; Sat, 06 Nov 2021 12:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PrWVoE3B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233511AbhKFMsk (ORCPT + 99 others); Sat, 6 Nov 2021 08:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232900AbhKFMsj (ORCPT ); Sat, 6 Nov 2021 08:48:39 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 064FEC061570; Sat, 6 Nov 2021 05:45:58 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id f3so24428473lfu.12; Sat, 06 Nov 2021 05:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Wij71fKA1HG2jiSYInwTXYj/LtZwp9diZJCmSGprZss=; b=PrWVoE3BZTjFRpJsGE5x62Fu125ksbCKl0cApBawk3P3OuMDYy6DQwYfMbCTVKTp/k PeTBOzjpBD8QEn+u5B7hdgX1uFPP3JMJeVmt8ECT8e22v2l8bGgAV2dpV0rHZq7QDQsN bxlphXuk9shR2qBbfT/n8n5atjkdj0wnMrg7izZRMi/jlPQI5VSfdA8t9kxjVSyI4K0F z3BDe0gSsrnxDWmGvsHU5BPFOLPgGs5uLXc9N45gdNqhiyct7t0ANieRS2Rv1/Gwx3Ff ucDuZaq4GDgQLgzFY6fFIxVC7gwCmT77qLOQi8I3K2J2KCq6qgpfnRESpXNurxoAs4P8 hf3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Wij71fKA1HG2jiSYInwTXYj/LtZwp9diZJCmSGprZss=; b=7dV5LH8G2MhsbzONhr5R6cPJ5Tsz9/U5XoQrmG8bvQCzSn/lcxwFGhXB48ilI8mk4G CWWzS5wWJZTkcfTgzyIbws73jKFovpKx1xt6rSzczhcula1GzSaH4tVvffbhtIDXs/oU bBQDYJqyCz4hj4EXsuqpCLiKhezEkaH70al4z0bV29O93gO3hnn0y+KMkEy1iHwz3AQe Cvenz8fpCLNGO73VgNNdB40j1KxPRIemXXic8QksKdjPp2GjvKuu1+EPyKJuicpAE0I1 ziJ6NuB7ank1EXZOZ6phcTn4AHRSWIONTYQs7X7Qb4ihq/Kjws8xL0Q6OURq0lfmLYSY zJBg== X-Gm-Message-State: AOAM531NJoqWJFKO7UoI4s7wcruJqkCfl63/gDeNM/ZwEJX62nmdbyhF QMNPyA7sWs1UuNcNCZT+vBNaftuu1Do= X-Received: by 2002:a05:6512:31d1:: with SMTP id j17mr60960429lfe.11.1636202756239; Sat, 06 Nov 2021 05:45:56 -0700 (PDT) Received: from [192.168.1.11] ([217.117.245.207]) by smtp.gmail.com with ESMTPSA id z1sm1151234lfu.222.2021.11.06.05.45.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Nov 2021 05:45:55 -0700 (PDT) Message-ID: Date: Sat, 6 Nov 2021 15:45:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v2] tty: vt: keyboard: initialize "kbs" so that kfree(kbs) runs fine even if kbs is not kmalloced. Content-Language: en-US To: Ajay Garg Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <20211106104053.98761-1-ajaygargnsit@gmail.com> From: Pavel Skripkin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/6/21 15:16, Ajay Garg wrote: > 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 ---). > > I can't say if it needed or not, since I am not the maintainer. I've just said my thoughts on this change. It looks like you missed all maintainers emails in your CC list :) └──$ ./scripts/get_maintainer.pl -f drivers/tty/vt/keyboard.c Greg Kroah-Hartman (supporter:TTY LAYER,commit_signer:10/10=100%,authored:2/10=20%,added_lines:31/66=47%,removed_lines:31/59=53%) Jiri Slaby (supporter:TTY LAYER,commit_signer:6/10=60%,authored:3/10=30%,added_lines:14/66=21%,removed_lines:4/59=7%) Andy Shevchenko (commit_signer:4/10=40%,authored:4/10=40%,added_lines:18/66=27%,removed_lines:21/59=36%) Emil Renner Berthing (commit_signer:1/10=10%,authored:1/10=10%,removed_lines:3/59=5%) linux-kernel@vger.kernel.org (open list) This is the list of people you need to send patches to. Please, use this script next time to not miss people related to your change :) The same for your other patch. With regards, Pavel Skripkin