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] [thread-next>] [day] [month] [year] [list]
Message-ID: <519D16B4.7080905@cogentembedded.com>
Date:	Wed, 22 May 2013 23:04:20 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Jiri Slaby <jslaby@...e.cz>
CC:	jirislaby@...il.com, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, Jeff Mahoney <jeffm@...e.com>,
	Patrick Koppen <isdn4linux@...pen.de>,
	Karsten Keil <isdn@...ux-pingi.de>, netdev@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH -resend 1/6] mISDN: Add support for group membership check

Hello.

On 22-05-2013 16:59, Jiri Slaby wrote:

> From: Jeff Mahoney <jeffm@...e.com>

> This patch adds a module parameter to allow a group access to the
> mISDN devices. Otherwise, unpriviledged users on systems with ISDN
> hardware have the ability to dial out, potentially causing expensive
> bills.

> Based on a different implementation by Patrick Koppen <isdn4linux@...pen.de>

> Acked-by: Jeff Mahoney <jeffm@...e.com>
> Cc: Patrick Koppen <isdn4linux@...pen.de>
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> Cc: Karsten Keil <isdn@...ux-pingi.de>
> Cc: netdev@...r.kernel.org
> Cc: "David S. Miller" <davem@...emloft.net>
> ---
>   drivers/isdn/mISDN/core.c   | 3 +++
>   drivers/isdn/mISDN/core.h   | 1 +
>   drivers/isdn/mISDN/socket.c | 8 ++++++++
>   3 files changed, 12 insertions(+)

[...]
> diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
> index e47dcb9..71f4986 100644
> --- a/drivers/isdn/mISDN/socket.c
> +++ b/drivers/isdn/mISDN/socket.c
> @@ -612,6 +612,10 @@ data_sock_create(struct net *net, struct socket *sock, int protocol)
>   {
>   	struct sock *sk;
>
> +	if(!capable(CAP_SYS_ADMIN) && (misdn_permitted_gid != current_gid())

     Did you run this thru scripts/checkpatch.pl? There should be space 
after *if*. Also, () around != are not neccessary...

> @@ -694,6 +698,10 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
>   	case IMSETDEVNAME:
>   	{
>   		struct mISDN_devrename dn;
> +		if(!capable(CAP_SYS_ADMIN)

    Again, need space after *if*.

> +			&& (misdn_permitted_gid != current_gid())

    Better leave && on a previous line and align the line under !. () 
again are not necessary.

> +			&& (!in_group_p(misdn_permitted_gid)))

    () around !x are simply not needed -- ! operator has very high priority.

WBR, Sergei

--
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