summaryrefslogtreecommitdiff
path: root/ct_usermgmt.h
blob: d7caae0c966b4e6febf5b0310c24a75482fe7bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * netsniff-ng - the packet sniffing beast
 * Copyright 2011 Daniel Borkmann.
 * Subject to the GPL, version 2.
 */

#ifndef CT_USERMGMT_H
#define CT_USERMGMT_H

#include <stdint.h>

#include "curve.h"
#include "crypto_hash_sha512.h"

enum is_user_enum {
	USERNAMES_OK = 0,	/* Usernames match, valid 'token' */
	USERNAMES_NE,		/* Usernames do not match */
	USERNAMES_TS,		/* Usernames match, but 'token' invalid,
				   Drop connection here */
	USERNAMES_ERR,
};

struct username_struct {
	uint32_t salt;
	uint8_t hash[crypto_hash_sha512_BYTES];
};

extern int username_msg(char *username, size_t len, char *dst, size_t dlen);
extern enum is_user_enum username_msg_is_user(char *src, size_t slen,
					      char *username, size_t len);
extern void parse_userfile_and_generate_user_store_or_die(char *homedir);
extern void dump_user_store(void);
extern void destroy_user_store(void);

extern int get_user_by_socket(int sock, struct curve25519_proto **proto);
extern int get_user_by_sockaddr(struct sockaddr_storage *sa, size_t sa_len,
				struct curve25519_proto **proto);
extern int try_register_user_by_socket(struct curve25519_struct *c,
				       char *src, size_t slen, int sock,
				       int log);
extern int try_register_user_by_sockaddr(struct curve25519_struct *c,
					 char *src, size_t slen,
					 struct sockaddr_storage *sa,
					 size_t sa_len, int log);
extern void remove_user_by_socket(int sock);
extern void remove_user_by_sockaddr(struct sockaddr_storage *sa,
				    size_t sa_len);

#endif /* CT_USERMGMT_H */
9a81a345c1e4'>5d0e7705774dd412a465896d08d59a81a345c1e4 (diff)parent047487241ff59374fded8c477f21453681f5995c (diff)
Merge branch 'sparc64-non-resumable-user-error-recovery'
Liam R. Howlett says: ==================== sparc64: Recover from userspace non-resumable PIO & MEM errors A non-resumable error from userspace is able to cause a kernel panic or trap loop due to the setup and handling of the queued traps once in the kernel. This patch series addresses both of these issues. The queues are fixed by simply zeroing the memory before use. PIO errors from userspace will result in a SIGBUS being sent to the user process. The MEM errors form userspace will result in a SIGKILL and also cause the offending pages to be claimed so they are no longer used in future tasks. SIGKILL is used to ensure that the process does not try to coredump and result in an attempt to read the memory again from within kernel space. Although there is a HV call to scrub the memory (mem_scrub), there is no easy way to guarantee that the real memory address(es) are not used by other tasks. Clearing the error with mem_scrub would zero the memory and cause the other processes to proceed with bad data. The handling of other non-resumable errors remain unchanged and will cause a panic. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/devicetree/bindings/timer')