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


Groups > linux.kernel > #1246113

Re: [PATCH] pstore: add vmalloc error check

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH] pstore: add vmalloc error check
Date Tue, 13 Oct 2015 22:20:03 +0200
Message-ID <qjedd-o2-17@gated-at.bofh.it> (permalink)
References <qj4dQ-2vA-19@gated-at.bofh.it>
X-Original-To Geliang Tang <geliangtang@163.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GTMEXeBuPcJlN0zGXlImR1Cuy26hwPzpc9UNA0CUW9M=; b=bswQhzx0V/7COsJWtG6xoLSmK8QQprtG/Aww8DQxW5NRCYkc3kKPdKCDskxZ31W4Qa sc2jl3yt/szxN5fQyRyQPiVM95KHfQ5WhkTCq4Lpf3RzHIURHDAP13rnU9I4YTyxog6a QoX93Cwe+Cg2NHlqP0nOJowjmRalZXjhsdJJI0775tqSGi09ppGVhkArcqXTborwDmKw CrI9x2abZc/jKq4IExzH/NUU2Qk4STg19EAsvmvjb5W+MKY0n2oec/txCXJE0hSiEOvu L+HyrFZezWtGLwh81wPB8rj5oD5rN6TV2Abr+j2YubxBOLWu5uMiNDW1TTwTmX39bA2v oilg==
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GTMEXeBuPcJlN0zGXlImR1Cuy26hwPzpc9UNA0CUW9M=; b=Fv7qUxhFDmplz+XkMEbfHXKb7ivaOfQCZowbtC4aTkEtOFOou9Cjac96IgJEVK/LKO dwRA8kLmP/2YsQhO3s/mHmYXcPm8ApVL6vk3s5yuRivO1KfhEzCQ1Qj4UHWSmwytbXY5 6FFm5giXtDHt/v6rLu/Prsf20lASo6DBnKbl8=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=GTMEXeBuPcJlN0zGXlImR1Cuy26hwPzpc9UNA0CUW9M=; b=YbQQ2xQEHBVFh4qe0+J9ZTtBNmwlqfGsZXFzhTHaqWTo9fw+6GWO0dnRHGEoek6yxt KrlfcbwFlBTnbhB/CQM5j7Mo9FcCIJtLTVwOrcRNEQxp1JuiSS8vQhtCDHyncepKwpch MUEowgygYq9I3QbTd50xQpOCvM/u86RmzjIFvgwr+m5uc7fDcSVo7tTOaivmhwroIVbv D3FGU7BPnGWjhdC9YWQmYtgTj0UulrnpCDf0VSr1L7gMEE+91Unc4kGdbU1H0/BFBCOe 7aWL8DMskcNbxesXks11Vu4uS/N+uxmhDW0rMvcFP/shemcujzDINy6I+JMxo+ivQJ3M LQ5w==
X-Gm-Message-State ALoCoQmoBu+dgjFE1vRj+E7oaCYqa6uoyjP6erZeqjbpdUJBc9vYL1Z1eHvYrVEPhNi5vlGhKf/O
MIME-Version 1.0
X-Received by 10.107.36.15 with SMTP id k15mr13703585iok.61.1444767318670; Tue, 13 Oct 2015 13:15:18 -0700 (PDT)
X-Google-Sender-Auth 5lEI99olY4tvQ0ekmNEcNdaPaUY
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 39
Organization linux.* mail to news gateway
X-Original-Cc Anton Vorontsov <anton@enomsg.org>, Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>, LKML <linux-kernel@vger.kernel.org>
X-Original-Date Tue, 13 Oct 2015 13:15:18 -0700
X-Original-Message-ID <CAGXu5jJ22J_LXjqY9mGNPttuL8+wS7UD-mxZaVWNjd8Mkd0G5w@mail.gmail.com>
X-Original-References <d77cf96dbe1c38616d4c50699e2836c6f5803ad6.1444756887.git.geliangtang@163.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1246113

Show key headers only | View raw


On Tue, Oct 13, 2015 at 2:27 AM, Geliang Tang <geliangtang@163.com> wrote:
> If vmalloc is failed, return -ENOMEM.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  fs/pstore/pmsg.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c
> index feb5dd2..5a2f05a 100644
> --- a/fs/pstore/pmsg.c
> +++ b/fs/pstore/pmsg.c
> @@ -37,6 +37,8 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf,
>         if (buffer_size > PMSG_MAX_BOUNCE_BUFFER_SIZE)
>                 buffer_size = PMSG_MAX_BOUNCE_BUFFER_SIZE;
>         buffer = vmalloc(buffer_size);
> +       if (!buffer)
> +               return -ENOMEM;
>
>         mutex_lock(&pmsg_lock);
>         for (i = 0; i < count; ) {
> --
> 1.9.1

I thought I saw this fix come through before? Regardless, thank you!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees


-- 
Kees Cook
Chrome OS Security
--
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 — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] pstore: add vmalloc error check Geliang Tang <geliangtang@163.com> - 2015-10-13 11:40 +0200
  Re: [PATCH] pstore: add vmalloc error check Kees Cook <keescook@chromium.org> - 2015-10-13 22:20 +0200

csiph-web