[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101028.113746.104048682.davem@davemloft.net>
Date: Thu, 28 Oct 2010 11:37:46 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: torvalds@...ux-foundation.org
Cc: netdev@...r.kernel.org, drosenberg@...curity.com,
jon.maloy@...csson.com, allan.stephens@...driver.com
Subject: Re: [PATCH] net: Limit socket I/O iovec total length to INT_MAX.
From: Linus Torvalds <torvalds@...ux-foundation.org>
Date: Thu, 28 Oct 2010 11:33:56 -0700
> On Thu, Oct 28, 2010 at 11:22 AM, David Miller <davem@...emloft.net> wrote:
>>
>> - int tot_len = 0;
>> + size_t tot_len = 0;
>
> I would actually keep "tot_len" as an "int".
...
>> +int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)
>> {
>> int size, ct;
>> - long err;
>> + size_t err;
>
> Same thing here. Making "err" be an "int" is actually the right thing
> to do, because then it matches the return type (iow, if it was any
> other type, there would be an implicit cast, and if it didn't fit in
> "int", that would be a bug anyway).
Yep, agreed on all counts, I'll make those changes.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists