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


Groups > linux.kernel > #1369392

Re: [PATCH v2] block: fix possible NULL dereference

From Jens Axboe <axboe@kernel.dk>
Newsgroups linux.kernel
Subject Re: [PATCH v2] block: fix possible NULL dereference
Date 2016-04-01 16:40 +0200
Message-ID <rj8oX-5Jd-31@gated-at.bofh.it> (permalink)
References <rj8oW-5Jd-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 04/01/2016 08:34 AM, Sudip Mukherjee wrote:
> We were checking for iter to be NULL after dereferencing it. There is
> actually no need to check for iter to be NULL as all the callers of
> blk_rq_map_user_iov() does call it with a valid pointer to
> struct iov_iter.
> But as iter->count can be NULL so the assignment to copy is being done
> after checking for it.
>
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> ---
>
> v2: removed the check for iter
> v1: moved the assignment to copy after check for iter and iter->count

Your subject is wrong (there's no NULL deref). Ditto for the commit 
message - it can be zero, not NULL. The latter would imply a memory 
address, but it's just an integer.

-- 
Jens Axboe

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


Thread

[PATCH v2] block: fix possible NULL dereference Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-04-01 16:40 +0200
  Re: [PATCH v2] block: fix possible NULL dereference Jens Axboe <axboe@kernel.dk> - 2016-04-01 16:40 +0200
    Re: [PATCH v2] block: fix possible NULL dereference Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-04-01 17:30 +0200

csiph-web