Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272890

Re: [PATCH] tty/vt/keyboard: use memdup_user to simplify code

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Saurabh Sengar <saurabh.truth@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tty/vt/keyboard: use memdup_user to simplify code
Date Thu, 19 Nov 2015 08:20:01 +0100
Message-ID <qwrFD-6aF-1@gated-at.bofh.it> (permalink)
References <qnH6W-3es-15@gated-at.bofh.it> <qospc-7q6-15@gated-at.bofh.it>
X-Original-To Greg KH <gregkh@linuxfoundation.org>, jslaby@suse.com, linux-kernel@vger.kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CAhSc/jLzeVAQ5ISil/qbFB0zjhqynQAzQjXRKt/m8s=; b=XHVGRAsyTD8qNhfLmSS/sg0DRN/DNr3APMjtlfeJ2KQAQxdeApCTB7XNslEhOGVHHx QCJPfx/x+nWpxRoQylWbEc76k0Tcna3uK6wKVh+CsRs96AT0MQvSrKmZ8ehucMjwee8N oePps4zItjctDEFC43xeEPl6O72DPluVzYDvxfaw6u4o1BTYldP3qOdpmjrzR7J7L544 pmD7g8YcOwrWJ8iu970JI1nvRDrz/gSNVXHTAXyGB0scEFWMXAjgWeUgVOjCparozFJM FprQDGvsHGW4Co1ydVN0OWu/e63tMkzl4R/5SW3z9m6IG574Rz+p8eEYbYCFoEroQEq2 5jWg==
MIME-Version 1.0
X-Received by 10.50.8.104 with SMTP id q8mr11063424iga.73.1447917492604; Wed, 18 Nov 2015 23:18:12 -0800 (PST)
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 47
Organization linux.* mail to news gateway
X-Original-Cc Saurabh Sengar <saurabh.truth@gmail.com>
X-Original-Date Thu, 19 Nov 2015 12:48:12 +0530
X-Original-Message-ID <CAA8avJ_VoEi5G9KLnhrY9ULgwQ3q=o8XgqHmMWGNmpBLE=CWVA@mail.gmail.com>
X-Original-References <saurabh.truth@gmail.com> <1446013604-15017-1-git-send-email-saurabh.truth@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1272890

Show key headers only | View raw


On 28 October 2015 at 11:56, Saurabh Sengar <saurabh.truth@gmail.com> wrote:
> use memdup_user rather than duplicating implementation.
> found by coccinelle
>
> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
> ---
>  drivers/tty/vt/keyboard.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index 6f0336f..f973bfc 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -1706,16 +1706,12 @@ int vt_do_diacrit(unsigned int cmd, void __user *udp, int perm)
>                         return -EINVAL;
>
>                 if (ct) {
> -                       dia = kmalloc(sizeof(struct kbdiacr) * ct,
> -                                                               GFP_KERNEL);
> -                       if (!dia)
> -                               return -ENOMEM;
>
> -                       if (copy_from_user(dia, a->kbdiacr,
> -                                       sizeof(struct kbdiacr) * ct)) {
> -                               kfree(dia);
> -                               return -EFAULT;
> -                       }
> +                       dia = memdup_user(a->kbdiacr,
> +                                       sizeof(struct kbdiacr) * ct);
> +                       if (IS_ERR(dia))
> +                               return PTR_ERR(dia);
> +
>                 }
>
>                 spin_lock_irqsave(&kbd_event_lock, flags);
> --
> 1.9.1
>

Hi,

Is this patch rejected for some reason or is still in queue?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] tty/vt/keyboard: use memdup_user to simplify code Saurabh Sengar <saurabh.truth@gmail.com> - 2015-11-19 08:20 +0100

csiph-web