Re: [PATCH v5 0/2] Remove false-positive VLAs when using max()

2018-03-18 Thread Rasmus Villemoes
On 2018-03-18 22:33, Linus Torvalds wrote: > On Sun, Mar 18, 2018 at 2:13 PM, Rasmus Villemoes > <li...@rasmusvillemoes.dk> wrote: >> On 2018-03-17 19:52, Linus Torvalds wrote: >>> >>> Ok, so it really looks like that same "__builtin_constant_p() does

Re: [PATCH v5 0/2] Remove false-positive VLAs when using max()

2018-03-18 Thread Rasmus Villemoes
On 2018-03-17 19:52, Linus Torvalds wrote: > On Sat, Mar 17, 2018 at 12:27 AM, Kees Cook wrote: >> >> Unfortunately my 4.4 test fails quickly: >> >> ./include/linux/jiffies.h: In function ‘jiffies_delta_to_clock_t’: >> ./include/linux/jiffies.h:444: error: first argument to

Re: [PATCH v4 1/2] kernel.h: Introduce const_max() for VLA removal

2018-03-16 Thread Rasmus Villemoes
On 2018-03-16 00:46, Linus Torvalds wrote: > On Thu, Mar 15, 2018 at 4:41 PM, Kees Cook wrote: >> >> I much prefer explicit typing, but both you and Rasmus mentioned >> wanting the int/sizeof_t mixing. > > Well, the explicit typing allows that mixing, in that you can just

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 8 March 2018 at 21:39, Kees Cook <keesc...@chromium.org> wrote: > On Thu, Mar 8, 2018 at 11:57 AM, Rasmus Villemoes > <li...@rasmusvillemoes.dk> wrote: >> On 2018-03-08 16:02, Josh Poimboeuf wrote: >>> On Wed, Mar 07, 2018 at 07:30:44PM -0800,

Re: [PATCH 0/3] Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 2018-03-08 16:02, Josh Poimboeuf wrote: > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: >> This series adds SIMPLE_MAX() to be used in places where a stack array >> is actually fixed, but the compiler still warns about VLA usage due to >> confusion caused by the safety checks in

Re: [PATCH v2 1/3] vsprintf: Remove accidental VLA usage

2018-03-08 Thread Rasmus Villemoes
On 2018-03-08 04:30, Kees Cook wrote: > In the quest to remove all stack VLAs from the kernel[1], this introduces > a new "simple max" macro, and changes the "sym" array size calculation to > use it. The value is actually a fixed size, but since the max() macro uses > some extensive tricks for

[PATCH] btrfs: use kbasename in btrfsic_mount

2015-11-27 Thread Rasmus Villemoes
This is more readable. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- I think the following strlcpy may be somewhat fragile since obviously ds->name and p overlap. It certainly relies on strlcpy doing a forward copy, and since different architectures can have their ow

Re: [PATCH] btrfs: use kbasename in btrfsic_mount

2015-11-27 Thread Rasmus Villemoes
On Fri, Nov 27 2015, kbuild test robot <l...@intel.com> wrote: > Hi Rasmus, > > [auto build test WARNING on: v4.4-rc2] > [also build test WARNING on: next-20151127] > > url: > https://github.com/0day-ci/linux/commits/Rasmus-Villemoes/btrfs-use-kbasename-in-bt

[PATCH v2] btrfs: use kbasename in btrfsic_mount

2015-11-27 Thread Rasmus Villemoes
This is more readable. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- v2: make p const char* (thanks 0day). Original comment: I think the following strlcpy may be somewhat fragile since obviously ds->name and p overlap. It certainly relies on strlcpy doing a for

Re: [PATCH-v3 3/6] vfs: don't let the dirty time inodes get more than a day stale

2014-11-25 Thread Rasmus Villemoes
On Tue, Nov 25 2014, Theodore Ts'o ty...@mit.edu wrote: static int update_time(struct inode *inode, struct timespec *time, int flags) { + struct timespec uptime; + unsigned short daycode; int ret; if (inode-i_op-update_time) { @@ -1525,17 +1527,33 @@ static int

Re: [PATCH-v2 3/5] vfs: don't let the dirty time inodes get more than a day stale

2014-11-24 Thread Rasmus Villemoes
On Sat, Nov 22 2014, Theodore Ts'o ty...@mit.edu wrote: Guarantee that the on-disk timestamps will be no more than 24 hours stale. static int update_time(struct inode *inode, struct timespec *time, int flags) { + unsigned short days_since_boot = jiffies / (HZ * 86400); int ret;

Re: [PATCH] trivial: fs/btrfs/tree-log.c: Fix closing brace followed by if

2014-08-22 Thread Rasmus Villemoes
Josef Bacik jba...@fb.com writes: On 06/20/2014 12:51 PM, Rasmus Villemoes wrote: Maybe else if was meant, but because of the goto out_unlock, it doesn't make a difference. Anyway, I chose the only whitespace fix. Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk --- fs/btrfs/tree

[PATCH] trivial: fs/btrfs/tree-log.c: Fix closing brace followed by if

2014-06-20 Thread Rasmus Villemoes
Maybe else if was meant, but because of the goto out_unlock, it doesn't make a difference. Anyway, I chose the only whitespace fix. Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk --- fs/btrfs/tree-log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/tree