lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 26 May 2015 09:09:27 +0900
From:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:	Minchan Kim <minchan@...nel.org>
Cc:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
	Marcin Jabrzyk <m.jabrzyk@...sung.com>, ngupta@...are.org,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	kyungmin.park@...sung.com
Subject: Re: [PATCH] zram: check compressor name before setting it

Hi,

On (05/25/15 23:21), Minchan Kim wrote:
[..]
> find_backend is just utility function to get zcomp_backend.
> IOW, it might be used for several cases in future so I want
> make error report as caller's work.

[..]
> >  	if (sz > 0 && zram->compressor[sz - 1] == '\n')
> >  		zram->compressor[sz - 1] = 0x00;
> >  
> > +	if (!zcomp_known_algorithm(zram->compressor))
> 
> In here, we could report back to the user.

the motivation was that we actually change user land interface
here and it's quite possible that none of the existing scripts
handle errors returned from `echo X > /../comp_algorithm`, simply
because it has never issued any errors; not counting -BUSY, which
may be not relevant for the vast majority of the scripts:

  #!/bin/sh
  modprobe zram
  echo $1 > /sys/block/zram0/max_comp_streams
  echo $2 > /sys/block/zram0/comp_algorithm

  [..]

  echo $3 > /sys/block/zram0/disksize
  if [ $? ... ]
     ...
  fi

  mkfs.xxx /dev/zram0
  mount -o xxx /dev/zram0 /xxx


`echo $2 > /sys/block/zram0/comp_algorithm` -EINVAL return can be
ignored (and, thus, syslog message as well); because `comp_algorithm`
has never returned anything for that trivial script. so that's why I
wanted to print extra `unknown compression algorithm` message during
disksize store.


	-ss

> > +		len = -EINVAL;
> > +
> >  	up_write(&zram->init_lock);
> >  	return len;
> >  }
> > 
> > --
> > To unsubscribe, send a message with 'unsubscribe linux-mm' in
> > the body to majordomo@...ck.org.  For more info on Linux MM,
> > see: http://www.linux-mm.org/ .
> > Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
> 
> -- 
> Kind regards,
> Minchan Kim
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ