Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers

2019-03-04 Thread Eric Sandeen
On 2/20/19 5:32 PM, Eric Sandeen wrote: > Today, proc_do_large_bitmap() truncates a large write input buffer > to PAGE_SIZE - 1, which may result in misparsed numbers at the > (truncated) end of the buffer. Further, it fails to notify the caller > that the buffer was truncated, so it doesn't get c

Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers

2019-02-21 Thread Eric Sandeen
On 2/21/19 11:52 AM, Luis Chamberlain wrote: > On Thu, Feb 21, 2019 at 11:47:49AM -0600, Eric Sandeen wrote: >> On 2/21/19 9:18 AM, Luis Chamberlain wrote: >>> On Wed, Feb 20, 2019 at 05:35:04PM -0600, Eric Sandeen wrote: Here's a pretty hacky test script to test this code via ip_local

Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers

2019-02-21 Thread Luis Chamberlain
On Thu, Feb 21, 2019 at 11:47:49AM -0600, Eric Sandeen wrote: > On 2/21/19 9:18 AM, Luis Chamberlain wrote: > > On Wed, Feb 20, 2019 at 05:35:04PM -0600, Eric Sandeen wrote: > >> Here's a pretty hacky test script to test this code via > >> ip_local_reserved_ports > > > > Thanks Eric! > > > > So /

Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers

2019-02-21 Thread Eric Sandeen
On 2/21/19 9:18 AM, Luis Chamberlain wrote: > On Wed, Feb 20, 2019 at 05:35:04PM -0600, Eric Sandeen wrote: >> Here's a pretty hacky test script to test this code via >> ip_local_reserved_ports > > Thanks Eric! > > So /proc/sys/net/ipv4/ip_local_reserved_ports is a production knob, and > if we wa

Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers

2019-02-21 Thread Luis Chamberlain
On Wed, Feb 20, 2019 at 05:35:04PM -0600, Eric Sandeen wrote: > Here's a pretty hacky test script to test this code via > ip_local_reserved_ports Thanks Eric! So /proc/sys/net/ipv4/ip_local_reserved_ports is a production knob, and if we wanted to stress test it with a selftest it could break othe

Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers

2019-02-20 Thread Eric Sandeen
Here's a pretty hacky test script to test this code via ip_local_reserved_ports - #!/bin/bash # Randomly construct well-formed (sequential, non-overlapping) # input for ip_local_reserved_ports, feed it to the sysctl, # then read it back and check for differences. # Port range to use PORT_ST

[PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers

2019-02-20 Thread Eric Sandeen
Today, proc_do_large_bitmap() truncates a large write input buffer to PAGE_SIZE - 1, which may result in misparsed numbers at the (truncated) end of the buffer. Further, it fails to notify the caller that the buffer was truncated, so it doesn't get called iteratively to finish the entire input buf