Message ID | 20101208000642.975564500@clark.site |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
On Tue, Dec 7, 2010 at 4:04 PM, Greg KH <gregkh@suse.de> wrote: > > From: Robin Holt <holt@sgi.com> > > [ Problem was fixed differently upstream. -DaveM ] Gaah. I'd really like to see more of a description for things like this. A commit ID for the alternate fix, or at least a few words about the different fix or reason why upstream doesn't need the stable commit. Linus -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Dec 07, 2010 at 05:22:34PM -0800, Linus Torvalds wrote: > On Tue, Dec 7, 2010 at 4:04 PM, Greg KH <gregkh@suse.de> wrote: > > > > From: Robin Holt <holt@sgi.com> > > > > [ Problem was fixed differently upstream. -DaveM ] > > Gaah. I'd really like to see more of a description for things like > this. A commit ID for the alternate fix, or at least a few words about > the different fix or reason why upstream doesn't need the stable > commit. I'll let David confirm this, he's the one who sent it to me :) thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Le mardi 07 décembre 2010 à 20:16 -0800, Greg KH a écrit : > On Tue, Dec 07, 2010 at 05:22:34PM -0800, Linus Torvalds wrote: > > On Tue, Dec 7, 2010 at 4:04 PM, Greg KH <gregkh@suse.de> wrote: > > > > > > From: Robin Holt <holt@sgi.com> > > > > > > [ Problem was fixed differently upstream. -DaveM ] > > > > Gaah. I'd really like to see more of a description for things like > > this. A commit ID for the alternate fix, or at least a few words about > > the different fix or reason why upstream doesn't need the stable > > commit. > > I'll let David confirm this, he's the one who sent it to me :) upstream uses commit 8d987e5c7510 (net: avoid limits overflow) This commit is a bit more untrusive for stable kernels : It depends on : a9febbb4bd13 (sysctl: min/max bounds are optional) 27b3d80a7b6a (sysctl: fix min/max handling in __do_proc_doulongvec_minmax()) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Wed, 08 Dec 2010 06:50:45 +0100 > Le mardi 07 décembre 2010 à 20:16 -0800, Greg KH a écrit : >> On Tue, Dec 07, 2010 at 05:22:34PM -0800, Linus Torvalds wrote: >> > On Tue, Dec 7, 2010 at 4:04 PM, Greg KH <gregkh@suse.de> wrote: >> > > >> > > From: Robin Holt <holt@sgi.com> >> > > >> > > [ Problem was fixed differently upstream. -DaveM ] >> > >> > Gaah. I'd really like to see more of a description for things like >> > this. A commit ID for the alternate fix, or at least a few words about >> > the different fix or reason why upstream doesn't need the stable >> > commit. >> >> I'll let David confirm this, he's the one who sent it to me :) > > upstream uses commit 8d987e5c7510 (net: avoid limits overflow) > > This commit is a bit more untrusive for stable kernels : > > It depends on : > a9febbb4bd13 (sysctl: min/max bounds are optional) > 27b3d80a7b6a (sysctl: fix min/max handling in __do_proc_doulongvec_minmax()) Yep, this is the case. Greg, you can add a reference to: a9febbb4bd13 27b3d80a7b6a 8d987e5c7510 in my "[ ... ]" in the commit message to clear this up. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Dec 08, 2010 at 08:25:22AM -0800, David Miller wrote: > From: Eric Dumazet <eric.dumazet@gmail.com> > Date: Wed, 08 Dec 2010 06:50:45 +0100 > > > Le mardi 07 décembre 2010 à 20:16 -0800, Greg KH a écrit : > >> On Tue, Dec 07, 2010 at 05:22:34PM -0800, Linus Torvalds wrote: > >> > On Tue, Dec 7, 2010 at 4:04 PM, Greg KH <gregkh@suse.de> wrote: > >> > > > >> > > From: Robin Holt <holt@sgi.com> > >> > > > >> > > [ Problem was fixed differently upstream. -DaveM ] > >> > > >> > Gaah. I'd really like to see more of a description for things like > >> > this. A commit ID for the alternate fix, or at least a few words about > >> > the different fix or reason why upstream doesn't need the stable > >> > commit. > >> > >> I'll let David confirm this, he's the one who sent it to me :) > > > > upstream uses commit 8d987e5c7510 (net: avoid limits overflow) > > > > This commit is a bit more untrusive for stable kernels : > > > > It depends on : > > a9febbb4bd13 (sysctl: min/max bounds are optional) > > 27b3d80a7b6a (sysctl: fix min/max handling in __do_proc_doulongvec_minmax()) > > Yep, this is the case. Greg, you can add a reference to: > > a9febbb4bd13 > 27b3d80a7b6a > 8d987e5c7510 > > in my "[ ... ]" in the commit message to clear this up. Now added, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2754,12 +2754,14 @@ void __init tcp_init(void) /* Set the pressure threshold to be a fraction of global memory that * is up to 1/2 at 256 MB, decreasing toward zero with the amount of - * memory, with a floor of 128 pages. + * memory, with a floor of 128 pages, and a ceiling that prevents an + * integer overflow. */ nr_pages = totalram_pages - totalhigh_pages; limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT); limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11); limit = max(limit, 128UL); + limit = min(limit, INT_MAX * 4UL / 3 / 2); sysctl_tcp_mem[0] = limit / 4 * 3; sysctl_tcp_mem[1] = limit; sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2; --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1722,11 +1722,13 @@ void __init udp_init(void) /* Set the pressure threshold up by the same strategy of TCP. It is a * fraction of global memory that is up to 1/2 at 256 MB, decreasing - * toward zero with the amount of memory, with a floor of 128 pages. + * toward zero with the amount of memory, with a floor of 128 pages, + * and a ceiling that prevents an integer overflow. */ limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT); limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11); limit = max(limit, 128UL); + limit = min(limit, INT_MAX * 4UL / 3 / 2); sysctl_udp_mem[0] = limit / 4 * 3; sysctl_udp_mem[1] = limit; sysctl_udp_mem[2] = sysctl_udp_mem[0] * 2; --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -1179,7 +1179,8 @@ SCTP_STATIC __init int sctp_init(void) /* Set the pressure threshold to be a fraction of global memory that * is up to 1/2 at 256 MB, decreasing toward zero with the amount of - * memory, with a floor of 128 pages. + * memory, with a floor of 128 pages, and a ceiling that prevents an + * integer overflow. * Note this initalizes the data in sctpv6_prot too * Unabashedly stolen from tcp_init */ @@ -1187,6 +1188,7 @@ SCTP_STATIC __init int sctp_init(void) limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT); limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11); limit = max(limit, 128UL); + limit = min(limit, INT_MAX * 4UL / 3 / 2); sysctl_sctp_mem[0] = limit / 4 * 3; sysctl_sctp_mem[1] = limit; sysctl_sctp_mem[2] = sysctl_sctp_mem[0] * 2;