All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Tom Tucker <tom@opengridcomputing.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	trond.myklebust@fys.uio.no, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 02/23] SUNRPC: Fix return type of svc_addr_len()
Date: Thu, 2 Apr 2009 18:39:49 -0400	[thread overview]
Message-ID: <20090402223949.GE18195@fieldses.org> (raw)
In-Reply-To: <49D4182F.20104@opengridcomputing.com>

On Wed, Apr 01, 2009 at 08:43:11PM -0500, Tom Tucker wrote:
> J. Bruce Fields wrote:
>> On Wed, Mar 18, 2009 at 08:45:36PM -0400, Chuck Lever wrote:
>>> The svc_addr_len() helper function can return a negative errno value,
>>> but its return type is size_t, which is unsigned.
>>>
>>> The RDMA transport code passes this return value directly to memset(),
>>> without checking first if it's negative.  This could cause memset() to
>>> clobber a large piece of memory if svc_addr_len() has returned an
>>> error.
>>
>> I'd still like to understand when this can happen, to better understand
>> how the error should be handled.
>
>
> I don't think that the current code base can cause this to occur.
>
> My recollection is that this code was added at the time we were  
> in-flight with the IPv6 integration and I was somewhat uncomfortable bug  
> checking on an unknown address type, however, this may in fact be the  
> right thing to do.
>
> I think changing the return type to int is fine.

OK, thanks.  So sounds like the consensus is that the return value
should either trigger a BUG() or just be ignored.--b.

  reply	other threads:[~2009-04-02 22:39 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19  0:45 [PATCH 00/23] Shorter series for 2.6.30 Chuck Lever
     [not found] ` <20090319004024.32404.68289.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-03-19  0:45   ` [PATCH 01/23] SUNRPC: Don't flag empty RPCB_GETADDR reply as bogus Chuck Lever
2009-03-19  0:45   ` [PATCH 02/23] SUNRPC: Fix return type of svc_addr_len() Chuck Lever
     [not found]     ` <20090319004535.32404.37120.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-03-24 20:32       ` J. Bruce Fields
2009-03-24 20:37         ` Chuck Lever
2009-03-24 21:02           ` J. Bruce Fields
2009-03-26  7:43           ` Greg Banks
2009-03-26 16:03             ` Chuck Lever
2009-04-02  1:43         ` Tom Tucker
2009-04-02 22:39           ` J. Bruce Fields [this message]
2009-04-02 22:43             ` Chuck Lever
2009-03-19  0:45   ` [PATCH 03/23] SUNRPC: Clean up static inline functions in svc_xprt.h Chuck Lever
2009-03-19  0:45   ` [PATCH 04/23] NFSD: If port value written to /proc/fs/nfsd/portlist is invalid, return EINVAL Chuck Lever
2009-03-19  0:45   ` [PATCH 05/23] SUNRPC: Clean up svc_find_xprt() calling sequence Chuck Lever
2009-03-19  0:46   ` [PATCH 06/23] SUNRPC: Pass a family argument to svc_register() Chuck Lever
2009-03-19  0:46   ` [PATCH 07/23] SUNRPC: svc_setup_socket() gets protocol family from socket Chuck Lever
2009-03-19  0:46   ` [PATCH 08/23] SUNRPC: Change svc_create_xprt() to take a @family argument Chuck Lever
2009-03-19  0:46   ` [PATCH 09/23] SUNRPC: Remove @family argument from svc_create() and svc_create_pooled() Chuck Lever
2009-03-19  0:46   ` [PATCH 10/23] NFS: Revert creation of IPv6 listeners for lockd and NFSv4 callbacks Chuck Lever
2009-03-19  0:46   ` [PATCH 11/23] SUNRPC: Set IPV6ONLY flag on PF_INET6 RPC listener sockets Chuck Lever
2009-03-19  0:46   ` [PATCH 12/23] SUNRPC: Use IPv4 loopback for registering AF_INET6 kernel RPC services Chuck Lever
2009-03-19  0:46   ` [PATCH 13/23] SUNRPC: Don't return EPROTONOSUPPORT in svc_register()'s helpers Chuck Lever
2009-03-19  0:47   ` [PATCH 14/23] SUNRPC: Clean up address type casts in rpcb_v4_register() Chuck Lever
2009-03-19  0:47   ` [PATCH 15/23] SUNRPC: rpcbind actually interprets r_owner string Chuck Lever
     [not found]     ` <20090319004713.32404.63163.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-03-26  8:58       ` Greg Banks
2009-03-26 15:44         ` Chuck Lever
2009-03-26 23:18           ` Greg Banks
2009-03-27 15:36             ` Chuck Lever
2009-03-27 22:02               ` Greg Banks
2009-03-19  0:47   ` [PATCH 16/23] SUNRPC: Allow callers to pass rpcb_v4_register a NULL address Chuck Lever
2009-03-19  0:47   ` [PATCH 17/23] SUNRPC: Simplify svc_unregister() Chuck Lever
2009-03-19  0:47   ` [PATCH 18/23] SUNRPC: Simplify kernel RPC service registration Chuck Lever
2009-03-19  0:47   ` [PATCH 19/23] SUNRPC: rpcb_register() should handle errors silently Chuck Lever
2009-03-19  0:47   ` [PATCH 20/23] SUNRPC: Remove CONFIG_SUNRPC_REGISTER_V4 Chuck Lever
2009-03-19  0:47   ` [PATCH 21/23] lockd: Start PF_INET6 listener only if IPv6 support is available Chuck Lever
2009-03-19  0:48   ` [PATCH 22/23] NFS: Start PF_INET6 callback " Chuck Lever
2009-03-19  0:48   ` [PATCH 23/23] NFS: Simplify logic to compare socket addresses in client.c Chuck Lever
2009-03-24 22:49   ` [PATCH 00/23] Shorter series for 2.6.30 J. Bruce Fields

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=20090402223949.GE18195@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tom@opengridcomputing.com \
    --cc=trond.myklebust@fys.uio.no \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.